I run on 3 Questions while configuring Context Menu:
Q1. Tried to implement animation of Contexy menu. Failed. http://webix.com/snippet/0fed20b6
Enabled animation of menu with default settings, and sub-menu with:
Why Webix executes “click” handler of Menu and Sub-Menu when I click on Sub-Menu and it supposed to execute Sub-Menu handler only? http://webix.com/snippet/58809cd2
(Q1) Currently animate will not have effect on popup elements, such as menu panels
(Q2) autowidth works for horizontal menu panels, autoheight for vertical menu panels only. We will update the documentation.
(Q3) It is by design. When creating complex menu, it allows to define a single handler, on top menu object, to handle all clicks in the menu. ( for webix - each submenu is a separate object, but when you are working with UI, in most case you expect that all menu panels will works as a single component )
You can use onItemClick event that is separate for each menu object.
onItemClick resolved the issue with multiple fires of code.
Also, proper formatting resolved the issut of early fire.
Thank you.
There is another issue that still remaining – only the 1st line of the event handler gets executed. In the example below when I click on sub-menu the only message I see is: “Sub-Menu1”:
Again, in case of single event handler on top menu object, your original code is correct. But as you are attaching handlers for separate sub menu you need to use getTopMenu to get the top menu object in hierarchy.