I am using jstree for tree view on web page.
The tree allows you to rename and move nodes. Moving or renaming a node raises the rename_node.jstree and rename_node.jstree events.
With new nodes (created using rename_node.jstree events ), the node can be renamed and moved, but the move_node.jstree and rename_node.jstree events do not fire.
It seems that events are only related to internal nodes. I do not see any "live" method for binding events to nodes created after.
Is there any way to do this?
Here is an example that helps (I hope) to understand my problem:
$(function(){ $("#nodes").jstree({ "plugins" : [ "themes", "html_data", "dnd", "ui", "crrm" ] }).bind("move_node.jstree", function (event, data) { alert('move'); }).bind("rename_node.jstree", function (event, data) { alert('rename'); }).bind("create_node.jstree", function (event, data) { alert('create_node'); }) $("#create_button").click(function () { $("#nodes").jstree("create",null,"last",{data:"name"}); }); });
source share