PDA

View Full Version : [CLOSED] menu.lookupReference('menuItemRef') returns null



razvanioan
4 Oct 2014, 6:06 AM
In a ViewController, on a context menu I try to lookup menuItem by reference.

Using menu.lookupReference('menuItemRef') returns null.
Using component query like menu.down('[reference=menuItemRef]') it's working fine....

Fiddle bellow. Right click on any grid record.

PS: please do not take into account the double reference warning, that's ok because for other bug reports using the same fiddle I've used the same menu config in top toolbar as well. You can disable it there and the issue will remain.

b83

evant
4 Oct 2014, 5:31 PM
This isn't a bug. The "menu" object isn't a reference holder, the view controller is.

For the toolbar to be able to hold a reference and capture things underneath it, you'd need to specify referenceHolder: true.

There's more info here: http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.container.Container