My website processes a continuously updating stream of JSON - In an effort to keep traffic at a minimum I'd like to maintain a store of updates that is used for more than one grid. Currently, as updates come in, the affected rows are updated in an Ext.data.Store with a JSON reader. The store is bound to an Ext.grid.GridPanel and Ext.DataView panel.
The problem comes in when I try to create a second GridPanel from the same store (but filtered). Any filtering applied to one grid results in modifying the other. I've researched 2 types of filtering:
1.) Use plugin for GridFilters
http://dev.sencha.com/deploy/dev/exa...id.GridFilters
As an example, I modified the grid-filtering example grid-filter-local.js and added my own button to apply a custom filter:
Code:
- handler: function () {
- grid.filters.clearFilters(); //for some reason, this is required first to set the filter programatically
- grid.filters.addFilter({ "dataIndex": "company", "type": "string", "value": "w"});
- }
Creating a second grid panel and column model, but bound to the same store will end up applying filters and sorting to both grids
2.) Apply filter on store
Code:
myStore.filter('company', 'w', true, true);
Again, any grids using this store get filtered.
Do I have to create a copy of the store to apply different filtering? Should I be looking at some other Ext data structure?
Any help is much appreciated,
starkgray