vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.15k stars 1.38k forks source link

Unable to get the ID from a node created with create_node() #2655

Closed ozwki closed 1 year ago

ozwki commented 2 years ago

When I use create_node(), a node is created in my tree but when I try to get the ID which is supposed to be the return of create_node() I get false

I want to know why I get a false (boolean) and not a string, the ID of the new node even though it's created

(I have set check_callback to true)

vakata commented 1 year ago

If there is an error false will be returned. Also keep in mind - if the parent node is not loaded you will not get the ID, as the parent will be loaded first and then create_node will be called again. Aside from those two instances - you will get the ID. You might want to switch to listening for the create_node.jstree event if async is the issue. If not - please provide a demo.