I have a tree that is the mirror of my database driven filesystem.
I'm following the steps:
1) Add a new leaf to the database.
2) Reload the page where the TM is
3) Select the new leaf (by ID) created
The problem is that the reload() takes some time to generate the tree and while being generated it executes the my_tree.select(), therefore it never can find the New Created Leaf because it's still being processed.
My question is, is there any way to select a leaf only after the process of buiding a tree is complete ? My approach now (to have more time to process) is to show to the user a window.alert() message, but it relies completly on the computer the user is using, if it's a slow enough PC my approach will fail.
I saw the thread about this but this thread didn't help me because I'm selecting by ID, and I couldn't see any solution for my problem in that thread.
I appreciate your help, thank you
You can use afterInit handler function to call your custom function after the process of buiding a tree is complete .