I have a jstree set up (on div id ="surveyManager"). And i have bound the dbclick and rename function to it as under:
.bind("rename.jstree", function (node, data) {
edit_node(node,data);
}),
.bind("dblclick.jstree", function (event) {
//Double Click to Rename
jQuery("#surveyManager").jstree("rename");
})
over here edit_node is a function that have to implement to pass all the node information thru an ajax call.
Is it possible to setup the tree, such that on dbclick, instead of renaming the node, i can just trigger the edit_node(node,data). Maybe another jstree function , or somewhereelse i could define it. Please help
I'm answering my own question here, which i figured out by trying a few other things out. Instead of having a rename function on double click for editing, we can pretty much have a select_node and edit item.
the parameters passed are event and data. we can use the event.target to get the nodal information and data is already provided, enabling us to simply call the other function .
.bind("select_node.jstree", function (e,data) {
var node = $(e.target).closest("li");
edit_node(node,data);
});
Thanks for the help