DataTable reset() method doesn't clear all filter input fields
I'm submitting a ... (check one with "x")
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior
DataTable's reset() method doesn't clear all filter input fields after it's called. If there's only one filter filled, it will clear it normally, but if there's more than one, data will still be displayed without any filters, but input fields will still have previously inputed values.
Expected behavior
reset() method should clear all filter input fields.
-
Angular version: 2.4.5
-
PrimeNG version: 2.0.0-rc.2
-
Browser: All
-
Language: All
-
Node (for AoT issues):
node --version= v6.3.0
This can be replicated with custom filters only.If you use built-in filters then it won't cause this issue.The local component control values also need to be reset.
That is not true, I'm simply using [filter]="true" filterMatchMode="contains" on all of my columns, there's no trace of anything custom.
This is how I tried.
1.Filter on 3 columns without using custom filter feature

- After clicking on reset button all filter inputs got cleared and the table displayed with initial records

+1. Can only be replicated with custom filters.
-
Apply filters (normal and custom). Works as expected

-
Reset. Table reset with no filters. But the "selection" in the custom filter stays. In this example, I would have expected the Offset filter of 3 to be cleared too. It doesn't make sense for the filter text to not change when the filter was reset. Like it did for Well Name

@Mrtcndkn - Could someone from your team please take a look at this?
We can't know what are inside custom filters, so you need to clear them manually. Online example has a slider with manual clear.
Could you please provide a link to said slider?
@DraghiciR You can check it from over here: http://primefaces.org/primeng/#/datatable/filter
I had similar issue with a custom filter with a primeng calendar, where it was only clearing it's filter after I forced called reset on the component using: @ViewChild(DataTable) dataTableComponent: DataTable; to access the datatable component methods, but the problem with this approach was that it resets all the filters. So I solved it by deleting the filter property manually on the onClearClick event of the calendar as follows:
onMyCalClearClick(){
delete this.dataTableComponent.filters.myFilterProp; // work around to clear custom filter
this.dataTableComponent.onLazyLoad.emit(); // here I force the datatable to refresh, bu maintaining the other filters if it has.
}