ContextMenu - Nested items' click events

I’m trying to create a ContextMenu with some nested items.
onItemClick handler is firing for the main items but not the subitems.

Could you please check the snippet below :
http://snippet.webix.io/3d72188f

Clicks on the (sub)menu items “red”,“green” and “blue” is not being detected (or I’m missing something…)

Check the updated sample

http://snippet.webix.io/b142eb9a

  • onItemClick was changed to onMenuItemClick
  • instead of “this” code uses “submenu” to locate menu item

This is one of tricky points, which is probably need to be imroved in the next updates. When you are using nested menu, each submenu is a separate object, with separate events, so when you are clicking on item in a submenu, onItemClick is called for that submenu, and not for top context menu. onMenuItemClick is a special event, which is always called for the top menu in hierarchy.

maksim, your sample (Code Snippet) don’t work.
How I can get click on SubItems in ContextMenu ?

BTW, in Documentation (see ContextMenu - The ContextMenu UI widget documentation: overview and configuration. Webix Docs) “2 . ContextMenu - Menu”
Relatated Sample (snippet Code Snippet ) also don’t work click on SubItems.


ADD TO POST

I found in snippet Code Snippet (see forum - https://forum.webix.com/discussion/4220/menuitem-click-functionality)
onMenuItemClick works!
// Unlike the onItemClick, this event fires for all menu item regardless of their nesting level.