Configuring jstree right-click contextmenu for different node types

前端 未结 8 2319
甜味超标
甜味超标 2020-12-04 07:29

I\'ve seen an example somewhere online showing how to customise the appearance of jstree\'s right-click context menu (using contextmenu plugin).

For example, allow

8条回答
  •  情话喂你
    2020-12-04 07:54

    as of jsTree 3.0.9 I needed to use something like

    var currentNode = treeElem.jstree('get_node', node, true);
    if (currentNode.hasClass("folder")) {
        // Delete the "delete" menu item
        delete items.deleteItem;
    }
    

    because the node object that is provided is not a jQuery object.

提交回复
热议问题