Results 1 to 3 of 3

Thread: .getEl() on a combo box undefined?

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    8

    Default .getEl() on a combo box undefined?

    Hi,

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

    Code:
    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
    Code:
    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.
    Code:
    console.log(Ext.getCmp("myComboId").getEl());
    logs "undefined".

    Why does this happen and how can I fix it?

    Thank you,
    Simon

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    What is mediaHeader? When are you doing this, after the combo has been rendered?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    8

    Default

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •