I use the following code to rename jstree node (with crrm plugin):
$('#categoriesTree').jstree('rename');
How do I know whether the node was successfully renamed (by pressing Enter) or renaming was cancelled (by pressing Esc)? Event ‘rename_node.jstree’ doesn’t provide useful information.
You can’t know it by built-in functions but you can modify jquery.jstree.js.
In non-compressed version find string
_show_input : function (obj, callback)(near line 1263) and you’ll see:I added three lines here (
console.log) and now you can see in console what’s happening with your node. Instead ofconsole.logyou can add some class to your element as flag and read it later or make your custom event, but I don’t know how to do this. It’s up to you.