extjsextjs4extjs-gridextjs-stores

Show all rows in grid after clearing filters in ExtJS


I have a data store and a grid. I add filters in the store and they work properly as I see the results in my grid. But once I disable all my filters aka clear them from my store I want to view all my rows in the grid without reloading them from a web service which is a kind of heavy task. All data is already fetched from the service and there is no need to reaload it again.

How can I do this? Is there some function in the store?


Solution

  • There already was a similar question with correct answer. In short, you need to call filter method without params after setting remoteFilter to false:

    store.remoteFilter = false;
    store.clearFilter();
    store.remoteFilter = true;
    store.filter();
    

    Here is a jsfiddle: http://jsfiddle.net/8Gmtd/