Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I programmatically close a context menu in jsTree?

Tags:

jstree

Is there a way I can programatically close a context menu in jsTree? I implemented a way to open the context menus on hover using show_contextmenu but I need to close it when the mouse leaves

like image 854
Arturo Molina Avatar asked Feb 14 '26 10:02

Arturo Molina


1 Answers

Ok, looking through the code I found what I needed, there is a property called hide_on_mouseleave which I just set to true in the source and it started working as expected.

If that doesn't work, this is the code used to close the context menu executed when hide_on_mouseleave property is true:

$.vakata.context.hide();
like image 119
Arturo Molina Avatar answered Feb 16 '26 19:02

Arturo Molina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!