I have one dynamic ExtJS grid.
items: {
xtype: 'grid',
border: false,
columnLines: true,
scrollable: true,
stripeRows: true,
columns: changeColumns,
store: store1 /// How to change store here
},
and store 1 is some thing like
store1 = Ext.create('Ext.data.Store', {
fields: Fields1,
data: Data1
});
and store 1 is some thing like
store2 = Ext.create('Ext.data.Store', {
fields: Fields1,
data: Data2
});
So I want to change my store on basis of some condition given below. Now my condition is
if(headersXmlDoc.getAttribute("ST") == 1){
Store1
}else if(headersXmlDoc.getAttribute("ST") == 2){
Store2
}
Can any body tell me how to achive this.