score:0

Accepted answer

very simple solution to this. assuming you're using mike's example, the collapse method is designed to be recursive. by default, the tree is expanded when loaded. the program calls the line root.children.foreach(collapse); to collapse it. but note that this only calls collapse on the children, and does not collapse the root itself.

thus, to get the behavior you want, simply change that line to:

collapse(root);

and it will load up with the root also being collapsed.


Related Query