View Full Version : refresh grid/store after data changed in store

4 Sep 2012, 3:56 AM
I have a store with loaded data and filter on this store. Then I change one item in the store (not in database) and want to refresh the store(/grid) without reloading the data from DB so that the filter filters considering the changes i made. Is there any method for this? I can not find any.


4 Sep 2012, 4:15 AM
its not clear to me what you want to do. do you want to cancel the changes so that the old data is visible again or you are not able to see the change which you made in the grid and want to refresh the view?

4 Sep 2012, 5:39 AM
i have data in store, which are visible in grid. the store has filter (for example with condition item.Flag != 'A'), i change Flag on one item in store to 'A' and it is still visible. Is it clear now?
P.S.: Sorry if my english is bad.

4 Sep 2012, 5:40 AM
Changes made to the store are automatically seen by the grid.



4 Sep 2012, 5:47 AM
ok. i think I understand your problem now. I am not sure if it will work but give it a try. After you change a record, do the following:


4 Sep 2012, 6:02 AM
I tried the above and it doesnt work. what you can do is to create a listener for the event which is fired when you change data in your store and then reapply the existing filters. I am giving you an example when you change something using the rowediting plugin in a grid:

rowEditing.on('edit', function(editor, e, eOpts) {
var store = editor.grid.getStore();
var filters = editor.grid.getStore().filters;
for(var i=0; i<filters.length; i++)

this may not be the best way to do it but it works. may be someone else can suggest something better.

4 Sep 2012, 6:22 AM
Thanks, that helped.