List Info

Thread: get clicked sub menu item




get clicked sub menu item
country flaguser name
Canada
2008-03-28 19:29:43
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
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )