When a sub menu item is clicked, how can I get that menu
item?
I applied a "click" event handler to a menu button
in order to change
the button label when a menu item is selected:
button.getMenu().subscribe('click', function
(event)
{
button.set('label',
button.getMenu().activeItem.cfg.getProperty('text'));
});
It works for simple menu items, but not for sub menu items:
http://cgi.sfu.ca/~jdbates/tmp/yui/200803280/test.html
In this test case, selecting either "AAA" or
"CCC" will correctly change
the button label. However selecting the "BBB" sub
menu item incorrectly
changes the button label to "AAA"
How can I get the sub menu item which was clicked, so I can
set the
button label to "BBB" when "BBB" is
selected?
Thanks and best wishes, Jack
|