0
votes

I'm trying to reuse a grid under different tabs.

Is there a way I can have one centralized store for that grid and show data under different tabs based on a filter? In other words, can I add a store to a grid with a data filter via designer / in the event handler.

I'm using Ext JS: 3.4 (if it helps)

Here is a snapshot of what I'm looking for.

enter image description here

1
4 grids, 1 store. sounds like a bad porno... - Alex
Well.. technically it is just 1 grid (config) that is created at run time based on some selected entities.. So it is still 1 Grid, 1 Store.. It is made to look 4 ways to make sense to the user. - Aswin Ramakrishnan

1 Answers

1
votes

You can probably create 4 grids, linked to a single store.

Then you will have to listen to the tabchange event ( http://docs.sencha.com/ext-js/3-4/#!/api/Ext.TabPanel-event-tabchange ), figure out which tab you've selected (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.Panel-method-getComponent ), then filter your store again based on which tab you are using. (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-filter )