Reputation: 21
I got a problem that is simply driving me insane. I created a window based widget that displays a grid. Ok, until now that is nothing special, but, each grid has to deal with different data. For Example: Imagine a homebroker, there is the widget that show the offers of a stock. So, the instance A has to show INTC, instance B has to show CSCO and instance C has to show FB. But when I deal with the data of INTC for instance A, the grids of instances B and C are updated too. So I understand that all grid a sharing the same store. I've already tried to create a store dinamically, but, it didn't work.
The question is, how do I do to separate this? There is another way to update a grid without stores?
Upvotes: 1
Views: 3108
Reputation: 4431
You need to create an instance of the store, you're probably declaring them like this:
{
xtype: 'grid',
store: 'theStore'
// Rest of the properties
}
What you need to do is the following:
{
xtype: 'grid',
//column definitions etc...
initComponent: function() {
var me = this;
var lStore = Ext.create('App.store.MyStore');
Ext.apply(me, {
store: lStore
});
me.callParent();
}
}
This creates a unique instance of the store, if you reference the store like this: store: 'MyStore' you just get the same store, and when you sort, page, filter, ... all the stores do the same.
Hope this helps you, since you didn't share any code.
Upvotes: 10