Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable global filter is reset when applying other filters #1087

Closed
ahmedkandel opened this issue Mar 15, 2021 · 2 comments · Fixed by #1196
Closed

DataTable global filter is reset when applying other filters #1087

ahmedkandel opened this issue Mar 15, 2021 · 2 comments · Fixed by #1196
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@ahmedkandel
Copy link
Contributor

When using a global filter like <InputText v-model="filters1['global'].value" placeholder="Keyword Search" /> toghether with column filters, Each time you apply a filter the global filter value gets reset.

To reproduce the issue visit the demo, Type in some search value it will filter as expected but then if you select any column filter and click Apply the global filter gets reset.

The reason is that the DataTable component is using a filter object d_filters which is a clone of the filters provided by the parent component as a prop. Then the Datatable component watches any changes in the provided filter prop to reclone it. The issue is that changing any nested object property will not trigger the watcher unless the watch is deep.

Will create e PR to fix.

ahmedkandel added a commit to ahmedkandel/primevue that referenced this issue Mar 15, 2021
@ahmedkandel
Copy link
Contributor Author

@cagataycivici any updates regarding this issue? thanks.

ahmedkandel added a commit to ahmedkandel/primevue that referenced this issue Apr 19, 2021
@cagataycivici cagataycivici added priority - medium Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels May 10, 2021
@cagataycivici cagataycivici added this to the 3.5.0 milestone May 11, 2021
mertsincan added a commit that referenced this issue May 17, 2021
@mertsincan
Copy link
Member

Hi @ahmedkandel,

You're right! Thanks a lot for your contribution!

Best Regards,

fanaticscripter added a commit to fanaticscripter/Egg that referenced this issue Jul 9, 2021
We need the fix for primefaces/primevue#1087. Also,
my TS fixes have been merged, so no need to use my git branch any more.
carpetsage pushed a commit to carpetsage/egg that referenced this issue Dec 19, 2022
We need the fix for primefaces/primevue#1087. Also,
my TS fixes have been merged, so no need to use my git branch any more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants