
Originally Posted by
purnima_iyer
I am facing the same problem how can i reuse to same store for different components
To reuse the same store with multiple components just refer to it by name like this:
Assuming you have store Sample defined
Code:
Ext.define('XX.store.Sample', {...});
You can refer to it in view(s):
Code:
Ext.define('XX.view.PanelX',
{
....
initComponent: function(){
this.items = [
{
xtype: 'combo',
itemId: 'comboOne',
.....
store: 'Sample'
},
{
xtype: 'grid',
itemId: 'comboTwo',
....
store: 'Sample'
}
]
}
}
Keep in mind though that both combobox and grid share the same instance of store, so all filtering/sorting/changes to it will be automatically propagated to both.