while renaming a node in jstree, I wanted to validate for special characters in renaming, and if found , I wanted to alert user, and roll back to the old name.
for that I have added
- rename context menu
- after that I did bind with node_rename and rename event
- in binding I check for event.type === node_rename
- I am able to validate special characters of new name as I get new name in data.args[1]
- but before my alert comes, rename is already taken place, and I dont find a way to undo that.
Any help is appreciated.
Instead of binding
rename_node, I needed to bind torename.jstree, and then needed to use rollback of action.Here the bind event code.