I have studied using jstree before, but have not used it in my code. As a result, the code may be incorrect, but there must be concepts.
Based on your code, it looks like you are performing a move operation on the server side and want the tree to be updated to reflect the results.
Based on the jsTree documentation, it seems like you cannot make node updates and roll back to the last commit.
Instead of rolling back only those changes that you do not need, you can roll back the tree (all changes) and perform the following actions.
To better understand the code below, you can read it (or create a copy) without the lines where "wasTriggeredByCode" is set or specified in the condition for the if statement.
$("#tree").jstree({...}).bind("move_node.jstree", function (e, data) { var jsTree = $(this); var successes = [];
source share