enables context menu
mode | boolean | true to enable context menu, false to disable it |
// initialize treeview
var myTreeView = new dhtmlXTreeView("parentId");
// enable context menu
myTreeView.enableContextMenu(true);
// initialize dhtmlx menu
var myContextMenu = new dhtmlXMenuObject({
context: true // render it as context menu
});
myTreeView.attachEvent("onContextMenu", function(id, x, y, ev){
// show context menu here
myContextMenu.showContextMenu(x, y);
// optionally, you can select treeview item
myTreeView.selectItem(id);
// prevent default context menu
return false;
});
Back to top