I am using ExtJS 4.1. I am using stores's clearFilter()
to remove the filter from the store. I am applying filter to the store by using filterBy
method. I am filtering all the records where name is not Ronaldo.
After clearing the filter, I load a view which contains a grid (attached to store). But when I load the grid, I can still see that filter is not cleared. The store is local store. I have not applied any grouping on the store. Store is only using one model.
myStore.filterBy(function (record) {
if (record.get('Name') != 'Ronaldo') {
return true;
}
});
While all this is working fine, but when I clear the filter by using clearFilter()
, it is taking some time. Is there any faster\better\correct way to clear the filter on a store when filter is applied by using filterBy()
?
When you use clearFilter()
it doesn't make a difference if you used filterBy()
or filter()
or the filters were configured on the store.
Here's what happens when you clear the filters:
Note that you can suppress the events to be fired by using clearFilter(true)
which may be useful if you want to filter the store again after clearing the existing filters.
If clearing the store's filters performs slowly then it is probably related to the layout process (on your grid or whatever you're using the store with) which is triggered by step 3.
Also refer to the docs or the source code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With