我扩展了Ext.form.FormPanel。它包含带有按钮的first panel
和通过按钮点击呈现的second panel
。就像图片一样:
但是second panel's
项目的变量我在创建这样的时候给了我扩展的FormPanel:
var store = new Ext.data.JsonStore({...});]
sote.load({params:{....}});
var grid = new Ext.grid.GridPanel({
//**config**//
store:store
});
var usersPanel = new myapp.StandartForm({
//**some config**//
secondPanelItems:[grid,{field1},{filed2...}]
});
因此,当我创建扩展的FormPanel时,grid
只创建了一次。每当第二个面板显示时,我怎样才能创建它?
答案 0 :(得分:1)
使用xtype。因此每次实例化时都会创建网格(编辑:将商店添加为xtype)
var usersPanel = new myapp.StandartForm({
//**some config**//
secondPanelItems:[{
xtype: 'grid',
//**grid config**//
store: {
xtype: 'jsonstore',
autoLoad: true,
// other store attr
baseParams: {...}
}
},{field1},{filed2...}]
});