It is possible to return to the previous selected node?
what is the “preserve” parameter for the selectItem(itemId, mode, preserve) function?
It is possible to return to the previous selected node?
what is the “preserve” parameter for the selectItem(itemId, mode, preserve) function?
What do you mean under “return”?
According to the documentation:
docs.dhtmlx.com/doku.php?id=dhtm … lectitem&s[]=selectItem
preserve - (boolean) if true, the earlier selected nodes will be preserved = saves previous nodes
How to select the previous selected node?
For example I created dynamically a new node, but if something happens, I will remove the new node and select the previous one.
There is an “onSelect” event:
docs.dhtmlx.com/doku.php?id=dhtm … onselect&s[]=onselect
Inthis case you can push your selected item to a special array to take it from there at any time you need.
OK, thanks. That is the easy solution. I thought that there was a way to use the preserve parameter of selectItem function to do so
In your case parameter ‘preserve’ is not suitable, because when you delete some items, tree unselects all.