Tree to be opened with all nodes closed


I want the all the nodes in the tree to be closed when the tree is loaded from the xml.

I have been using the below code.

But I still the nodes are open when the tree is loaded.

Please advice.Thanks in advance.

Actually if you have not “open” statements inside XML tree must load in closed state by default.

In you code instruction not executed correctly because loadXML is async command, so you can’t just call command after it, you need to wait when data will be really loaded, it can be written as