1
votes

Is it possible in ExtJS to display different records from a store in different grids? I have a Store containing contact information (name, department, phone number) used to populate the contacts tab of my application. My goal is to be able to add grids elsewhere in the application that display contacts from specific departments (eg a grid for everyone in the tech department, another for everyone in the sales department). However, when I attach a filter, the filter seems to apply to the store itself, changing the display of all of the grids to the last version I try to load.

Do I need to create child grids and sync them to make this work?

2

2 Answers

2
votes

No, it is not possible. The store gets filtered, not the grid itself. You do have to create multiple stores and assign a different one to every grid.

Another way to say it is that store (when used with a grid) is a ViewModel, that is, a model that is kept in sync with the view. Therefore, the same store can't be used for multiple views as you would expect.

2
votes

No, but if you need a work-around, use same store for all the grids and filter store on grid's aftererender listener. But if you use these grids on tab then you need to do it on viewready event. Anyway, using same store for multiple grids will not be a good idea. Think twice before use.