PDA

View Full Version : dynamic add fields how to adjust layout?



jinjianhe
22 Dec 2011, 3:12 AM
var formPanel = Ext.getCmp('yourForm');
//add
formPanel.add(
{
xtype : 'textfield',
fieldLabel : 'Extra Field',
name : 'yourName',
id : 'yourName'
}
)
containerWindow.doLayout();


//remove

formPanel.remove(Ext.getCmp('yourName'));

using above method,it can dynamically add the field,i wanna add the field behind the exsiting field, however not dynamically adjust the layout, attache 30242the demo,plz
help,thx.

mitchellsimoens
22 Dec 2011, 11:39 AM
If you want to insert a field at a specific index, use the insert method instead of the add method