vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Custom ContextMenu based on multiple selection #1922

Closed minedun6 closed 6 years ago

minedun6 commented 6 years ago

Hey, How can I go about conditionally adding/remove menu items based on multiple/single selection ? I tried to attack this but problem is that this can be acheived through the variable data accessible in the _disabled property through a callback. But I want to remove the menu item completely if I have a multiple selection.

vakata commented 6 years ago

https://www.jstree.com/api/#/?q=contextmenu.items&f=$.jstree.defaults.contextmenu.items - set to a callback - if multipleselection is detected - return no items, otherwise - the items you want.