我有一个动态 ExtJS 网格。
items: {
xtype: 'grid',
border: false,
columnLines: true,
scrollable: true,
stripeRows: true,
columns: changeColumns,
store: store1 /// How to change store here
},
商店 1 是这样的
store1 = Ext.create('Ext.data.Store', {
fields: Fields1,
data: Data1
});
商店 1 是这样的
store2 = Ext.create('Ext.data.Store', {
fields: Fields1,
data: Data2
});
所以我想根据下面给出的某些条件更改我的商店。 现在我的情况是
if(headersXmlDoc.getAttribute("ST") == 1){
Store1
}else if(headersXmlDoc.getAttribute("ST") == 2){
Store2
}
任何人都可以告诉我如何实现这一目标吗?
最佳答案
您将需要使用网格的reconfigure方法。
关于javascript - 如何在某些条件下更改网格存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41979673/