I use the code below to successfully create a new tree node in jstree outside of contextmenu. My question is how can you dynamically RENAME the text in a tree node in a similar manner outside of the contextmenu? Is there a .jstree("rename" ….) function that can be called to accomplish this? Much appreciated!
$("#RequirementsTree").jstree("create", null, "last", {"data" : "new_node_text",
"state" : "open",
"attr" : { "id" : "new_node_id", "name" : "requirement" },
});
I've tried the following:
.bind("select_node.jstree", function(event, data) {
ReqNode = data.rslt;
$("#RequirementsTree").rename_node(ReqNode, "test");
That didn't work, however. Is there something I'm doing wrong?
Best Answer
This should work for you:
JSTree Core Documentation...
how-can-i-rename-a-jstree-node