Results 1 to 7 of 7

Thread: Component.showBy always expects an Ext.Component as reference element

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1179 in a recent build.
  1. #1
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    243
    Vote Rating
    1
      0  

    Default Component.showBy always expects an Ext.Component as reference element

    Code:
    var pnl=new Ext.Panel({html:'Some content'});
    pnl.showBy(Ext.getBody());
    The above code generates an exception. showBy only accepts an Ext.Component, passing Ext.Element throws an error: "Cannot read property "dom" of undefined".

    And I believe the problem lies in this line of Ext.Component.alignTo:

    Code:
    varg = h.element,
    
    I believe Ext.Components have a element property, but Ext.Element don't have it.

  2. #2
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    243
    Vote Rating
    1
      0  

    Default

    Changing that line in alignTo method should make it work:

    Code:
    var alignElement = alignTo.element || alignTo,

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4
    Sencha - Community Support Team mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,019
    Vote Rating
    1363
      0  

    Default

    Until this gets fixed, you can fake it:

    Code:
    panel.showBy({
        element : el
    });
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

  5. #5
    Sencha User Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    18
      0  

    Default

    This has been addressed in the next release (beta 1).
    Sencha Touch Lead Architect

  6. #6
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    243
    Vote Rating
    1
      0  

    Default

    Great, thanks Jacky!!!

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    443
    Vote Rating
    18
      0  

    Default

    The documentation doesn't indicate that you can use an Element instead of a Component. Should probably be updated.

Posting Permissions

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