Reputation: 5299
I extend Ext.form.FormPanel. It's contains first panel
with buttons and second panel
which render by button click. Like on the picture:
But second panel's
items it's variable i give it to me extended FormPanel when create this like this:
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...}]
});
So grid
created only once when i create my extended FormPanel. How can i create it every time when the second panel shows?
Upvotes: 0
Views: 48
Reputation: 817
use xtype. so grid will be created each time you instantiate it (edit: add store as xtype)
var usersPanel = new myapp.StandartForm({
//**some config**//
secondPanelItems:[{
xtype: 'grid',
//**grid config**//
store: {
xtype: 'jsonstore',
autoLoad: true,
// other store attr
baseParams: {...}
}
},{field1},{filed2...}]
});
Upvotes: 1