How to listen for double-click on jstree?

Alex Reynolds picture Alex Reynolds · May 9, 2011 · Viewed 11.7k times · Source

How would I write a listener for a double-click event on a jstree object? (For example, I'd like to double-click on a tree node and paste its anchor's href value into an input field in a form somewhere.)

Answer

Nirmal picture Nirmal · May 9, 2011

I have used something like this way back a year ago, i don't know if there's any change in the current jstree version :

jstree.bind("dblclick.jstree", function (event) {
   var node = $(event.target).closest("li");
   var data = node.data("jstree");
   // Do some action
});

node : Contains the li that is being clicked.

data : Contains the metadata.