PDA

View Full Version : FormPanel remove field



zombeerose
30 Sep 2009, 3:14 PM
Is there a reason that I can't remove fields dynamically from an existing form panel? Do I have to call something special? I am trying to execute the following code but get this error:

this.dom is undefined
http://www/includes/library/extjs/ext/ext-all-debug.js
Line 4784

Code example:


var f = this.getForm()
,bf = f.getForm()
,fld;

//also doesn't work...
//f.removeAll(true);

for(var i = 0, l = f.items.length; i < l; i++){
fld = f.getComponent(i);
bf.remove(fld);
f.remove(fld,true);
}



Using ext 3.0

Animal
30 Sep 2009, 9:24 PM
You will need the latest version of Ext (I don't know if the latest AVAILABLE version has the fix though) and remove from the Container, not the form.