Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7052 in 4.1.3.
  1. #1
    Ext JS Premium Member aedos's Avatar
    Join Date
    Dec 2009
    Posts
    148
    Vote Rating
    2
    aedos is on a distinguished road

      0  

    Question 4.1.1: ownerCt or floatParent is no longer set for Button Menu

    4.1.1: ownerCt or floatParent is no longer set for Button Menu


    After we upgraded from 4.0.2a to 4.1.1, we noticed that "ownerCt" and "floatParent" are both undefined for a Menu under a Button. One of them used to be set to the owner button before the upgrade.

    With some debugging, we found the "ownerButton" property of the menu is set to the owner Button, however, this ownerButton is not documented anywhere.

    Is it a bug that ownerCt and floatParent not getting set for Button Menu? Otherwise, is there a supported way to access the owner Button from a Menu?
    • Tested Browser: Chrome (Windows)

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,995
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Certainly looks like it's been changed on purpose, we'll review it.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    924
    Vote Rating
    47
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    See here.

    Now need to use getBubbleTarget, e.g:
    Code:
                /**
                 * Retrieves the parent control for the specified menu.
                 * In most cases this will be the button that was used to launch the menu.
                 * @param {Object} menu The menu whose parent to determine.
                 * @return {Object} The parent control for the menu, or undefined if not found.
                 */
                getTopMenusParent: function(menu) {
                    var parent = undefined;
    
    
                    if (menu) {
                        // Go up until we do not have a parentMenu, in case we are on a menus sub-menu.
                        while (menu.parentMenu) {
                            menu = menu.parentMenu;
                        }
    
    
                        parent = menu.getBubbleTarget();
                    }
    
    
                    return parent;
                }
    Product Architect
    Altus Ltd.

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    The recommended way is the up() method.

    http://docs.sencha.com/ext-js/4-1/#!...nent-method-up

    There is not an actual container->child ownership relationship there, so the up method hides these differences. There are quite a few places where there is a definite hierarchy, but it is not container->child. For example a column menu goes up() to the column header component.

    I think maybe a note attached to the ownerCt property describing and linking to the up() method would be good.