PDA

View Full Version : how to bind a store to all the references to an xtype



AssetWorks
29 May 2014, 12:02 PM
so I have an xtype (extending grid) that has no store defined. in the controller I do a

grid.bindStore(store);
and now that grid is bound to that store as expected. but other references of that xtype are not.
I understand why. I want to know if there is a way of doing it with out creating a for loop of the

Ext.ComponentQuery.query('mygrid')[i].bindStore(store);

skirtle
29 May 2014, 12:59 PM
Perhaps you could give them all the same store when they are first created, via a storeId? Rather than setting the store dynamically just update the data in the store.

Sharing stores is a dangerous area though. A store doesn't just hold the data, it also includes the sorting, filtering, etc.

For a grid you should use the reconfigure method to change the store rather than going directly through bindStore.