I explicitly add a filter to a Ext.data.Store
using the store.filter(string, string)
method.
However, I can not figure out how to remove filters from the store. So the filters always apply even after reloading using store.load()
. The only workaround I see is to restart the entire web app.
How do I remove a filter from an Ext.data.Store
?
In addition to Mchi's answer, I want to say that it is possible to remove specific filter (clearFilter() removes them all).
To do that, instead of using store.filter('property_to_filter','value')
method, use:
store.filters.add('filtersId', new Ext.util.Filter({
property: 'property_to_filter',
value: 'value'
}));
store.load();
to remove filter use:
store.filters.removeAtKey('filtersId');
In 4.2.0 methods for adding/removing specific filter were added:
store.addFilter({
id: 'filtersId',
property: 'property_to_filter',
value: 'value'
});
store.removeFilter('filtersId');
For more info check out docs: Ext.data.Store.addFilter, Ext.data.Store.removeFilter