NlsTree Professional supports tree level and node level context menu. Tree level context menu is context menu applies to all tree nodes, and node level context menu applies only to a specific node. The node level context menu override tree context menu.

 Expand All Collapse All


  • Right click on the node to open the context menu.
    This feature is not supported on IE4.0. In Opera, use CTRL+ALT+Left Click.
  • Disable context menu or display browser context menu on certain nodes is possible.
  • NlsTree supports multiple selection, use CTRL or SHIFT + click to select nodes

To create global context menu:

var globalContext=new NlsCtxMenu("global");
globalContext.add("1", "Add New Node");
globalContext.add("2", "Delete Node");
globalContext.add("3", "Edit Node");


To create node context menu:

var nodeContext=new NlsCtxMenu("nodelevel");
nodeContext.add("1", "Expand");
nodeContext.add("2", "Collapse");

[tree].setNodeCtxMenu(3, nodeContext); //set context menu for node 3
[tree].setNodeCtxMenu(5, nodeContext); //set context menu for node 5
[tree].setNodeCtxMenu(8, nodeContext); //set context menu for node 8

[tree].setNodeCtxMenu(2, "NONE"); //disable context menu
{tree}.setNodeCtxMenu(6, "DEFAULT"); //turn on browser native context menu