PDA

View Full Version : .getEl() on a combo box undefined?



Simon1
29 Nov 2011, 4:01 PM
Hi,

I'm trying to hide the label of a combobox:


Ext.getCmp("myComboId").getEl().up('.x-form-item').setDisplayed(false);

When I do this, Firebug shows the error message: "Ext.getCmp("myComboId").getEl() is undefined".

However, if I put a

console.log(Ext.getCmp("myComboId"));
directly in front of that line of code, the object is logged in the console and I can check and find the method getEl() in Firebug.
console.log(Ext.getCmp("myComboId").getEl()); logs "undefined".

Why does this happen and how can I fix it?

Thank you,
Simon

mitchellsimoens
29 Nov 2011, 4:04 PM
What is mediaHeader? When are you doing this, after the combo has been rendered?

Simon1
29 Nov 2011, 4:09 PM
mediaHeader is the id of the combo, I changed it to myComboId to make the code easier to read and forgot it twice. Fixed now, sorry for the confusion. The combo should have been rendered when I'm doing this, but the file is pretty complex, so I'm not entirely sure. Is there a way to check that?