When will MenuBar.MenuItemClicked Event fire?

Answered
0
0

Hi.

I have dropped a FlexLayoutPanel into a Page and then a MenuBar into the panel. Created some Items and added a MenuItemClicked event to one of them. While debugging, realized the event never got fired once I clicked the menu item. So I added a Click event handler and it worked just fine. Just curious, will the MenuItemClicked get fired in some different scenario?

Best.

Ivan

 

  • You must to post comments
Good Answer
0
0

MenuItemClicked fires when you click a MenuItem (child menu item). It allows a menu control to handle events on child menu items instead of having to attach the Click event on each menu item. The clicked menu item is referenced in e.MenuItem.

  • You must to post comments
0
0

Thanks for the explanation Luca. I am probably doing something wrong, then, as the MenuItemClicked handler never runs. However, it is so straight forward that I can’t think of anything else that should be done.

 

  • Levie (ITG)
    Hi Ivan! MenuItemClicked only fires when it’s attached to a MenuBar, ContextMenu, etc.. Not when attached to the actual MenuItem. I’ll log the issue of the event not firing when attached to a MenuItem. The expected behavior would be that it fires when a child of the attached MenuItem is clicked. Best, Levie
  • Ivan Borges
    Thanks Levie. It makes sense, I got it to work now. I apparently didn’t see it in the MenuBar Events, go figure! :-) As per Luca explanation, this should really be the expected behavior. Maybe the fix should be to get rid of MenuItemClicked from the MenuItems events. Cheers.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.