Configuring jstree right-click contextmenu for different node types

前端 未结 8 2322
甜味超标
甜味超标 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:55

    You can modify @Box9 code as to suit your requirement of dynamic disabling of context menu as:

    function customMenu(node) {
    
      ............
      ................
       // Disable  the "delete" menu item  
       // Original // delete items.deleteItem; 
       if ( node[0].attributes.yyz.value == 'notdelete'  ) {
    
    
           items.deleteItem._disabled = true;
        }   
    
    }  
    

    You need add one attribute "xyz" in your XML or JSOn data

提交回复
热议问题