How to manage jsTree context menu according to file and folder

I am stuck to control the context menu after a right click. In fact, I need to display some context menu item for the folder and some context menu item for the folder.

In the context menu, the context menu will look:

  • create
  • remove
  • rename
  • new

In the context menu, the context menu will look:

  • create
  • remove
  • rename

Is there any way to manage this menu after clicking. I am looking at documentation and another blog but not getting useful content.

Can you send me something so that I can realize this.

Thanks in advance

+6
contextmenu jstree
source share
1 answer
Hello , Thanks for take a look, but I got the way to make it Please take a look on below : $('#detail_dir_container').jstree({ "json_data" : { "ajax" : { "url" : '' } }, "contextmenu" : { "items": function(node){ if(node.attr('type') == 'file' ) { return { create : true, rename : true, remove : true } } else { return { create : true, rename : true, remove : true, new : true, } } } }); Thanks 
+10
source share

All Articles