$scope.contextMenu = {
"Export" : {
"label" : "Export",
"icon" : "glyphicon glyphicon-download-alt",
"_class" : "contextMenuListClass",
"action" : function(obj, data) {
console.log(obj);
}
},
};
<div class="tree-div" id='myTree' style="display: none;">
<js-tree tree-plugins="contextmenu,wholerow,sort,search,types"
tree-types="types" tree-contextmenu="contextMenu" tree-data="scope"
tree-model="data" selected
tree-events="dblclick:onTreeNodeDoubleClick"></js-tree>
</div>
我正在使用角度jsTree-directive。我的要求是首先在Jstree的特定节点上显示上下文菜单我检查所选节点上的条件,如果所选节点满足该条件,则上下文菜单将出现在该节点或上下文菜单上将不会显示该节点。