I am using dynatree and would like to have "open all" and "close all" links above the tree. How do I do this using a link?
Thanks in advance.
There's an example of expanding all nodes in the documentation. Use the .visit()
method and call .expand()
on each node:
$("#tree").dynatree("getRoot").visit(function(node){
node.expand(true);
});
Pass false
to collapse each node.