Hybrid View
-
21 Aug 2012 1:37 PM #1
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)
-
21 Aug 2012 3:23 PM #2
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!
-
22 Aug 2012 2:48 AM #3
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.
-
9 Sep 2012 11:58 AM #4
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.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7052
in
4.1.3 Sprint 1.


Reply With Quote