ExtJs组件扩展问题

问题描述:

我扩展了Ext.form.FormPanel。它包含带按钮的first panel和通过按钮单击呈现的second panel。像上图:ExtJs组件扩展问题

enter image description here

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...}] 

}); 

所以grid创建一次,当我创建我的扩展FormPanel中。每当第二个面板显示时我怎样才能创建它?

使用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...}] 
}); 
+0

但什么店?它只加载一次。我的意思是我可以在网格内创建它,但是为了加载数据,我要在服务器上发送POST参数。为此我使用load()方法。它可能与'autoLoad'做? –

+0

我不确定。但你想用xtype创建商店,就像网格一样,你可以定义baseParams。它将在加载数据时使用。但我从不使用,所以你必须测试。 – peernohell

+0

'baseParams'的作品。但无论如何,我需要重新加载商店。但仍然不知道如何在我的问题中这样做。 –