1
votes

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?

2
So let me get this straight, you load all of the data from your web service on first load, which probably means you've set up your store to be an ajax proxy? But if you load all of it in one fell swoop, why don't you just make that an actual Ajax call, and make your store a memory store? Do you rely on the back-end for filtering/sorting?incutonez
Yes, I load all data from the service in one go, one http request. It has finite number of entires so it can be done like this. I filter all data localy, just change the filter. And the store is already memory. And no, I don't rely on the backend for filtering/sortingVlad
Ok, so it sounds like you can do what I said then... or is there some other piece of information I'm missing?incutonez
What function do I call to view all data again in the grid? store.load()? I have all the data in a global variableVlad
I tried store.filter() with no params, it doesn't workVlad

2 Answers

1
votes

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/

1
votes

I suspect that your grid's view is not refreshed. Try this:

mygrid.getView().refresh()