-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[New Feature] DataTable clear filters support #232
Comments
There is reset method that does this. See methods section; http://www.primefaces.org/primeng/#/datatable Also we can expose filters metadata so that you can clear it yourself from model instead of getting datatable instance. |
reset does not clear the filter input elements (global and columns). It does reset the table tho. |
I am playing around with the reset table exaple you gave above and have the following:
However, the JavaScript API does not appear to expose the column filter input elements. It would be cool to do:
Perhaps something to do in conjunction with the custom filter elements issue? |
reset() does not work correct. |
The assignment |
As of 2.0.x, reset also clears filters. public reset() {
this.sortField = null;
this.sortOrder = 1;
this.filteredValue = null;
this.filters = {};
if(this.paginator) {
this.paginate({
first: 0,
rows: this.rows
});
}
else {
this.updateDataToRender(this.value);
}
} |
@cagataycivici |
Would be good to be able to clear all filters with a single button click. This includes all column filters and the global filter.
Perhaps a reference to a DOM element would be good just like the global filter, i.e.:
However, I feel like both global filte and clear filters should be integrated into the table API, like:
This will clean up my templates and let you control styling/theming better.
In the meantime, can you think of a hack to be able to clear all the filters? I mean, I know I could do it with jQuery but that seems too hacky.
The text was updated successfully, but these errors were encountered: