I am still having issues getting the context menu to work. A simple context menu does not even show up when I right click any node in the tree. Can anyone provide an example?
Thanks.
I am still having issues getting the context menu to work. A simple context menu does not even show up when I right click any node in the tree. Can anyone provide an example?
Thanks.
Please make sure that you enabled onContext event listening for the tree:
webix.ui({
id: "myTree",
view: "tree",
onContext:{},
...
});
and use attachTo method to attach Menu to Tree :
$$("myMenu").attachTo($$("myTree"));
I did this stuff already, but he docs are not clear where this code is supposed to go. I put the code in onBeforeContextMenu. Is is supposed to go somewhere else?
For my tree, every time a new onContext happens, the context menu may have a different list of options. So, should I create a new context menu every time?
Does the context menu automatically show, or is there a show() function I need to call.
are not clear where this code is supposed to go
You can init context menu in the same code where the related tree is initialized. It will be hidden by default and will appear only on context click
Does the context menu automatically show
If you have used .attachTo api, menu will be shown automatically.
menu may have a different list
You can use menu.clearAll and menu.parse to reload list of options ( or use hideItem api to hide unnecessary items only )