Results 1 to 4 of 4

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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
    3
      0  

    Question 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
    18,608
    Vote Rating
    874
      0  

    Default

    Certainly looks like it's been changed on purpose, we'll review it.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha Premium User westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    1,019
    Vote Rating
    107
      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,615
    Vote Rating
    54
      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.

Tags for this Thread

Posting Permissions

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