Customizable graphics
COOLjsTree and COOLjsTree Professional allow you to control trees via JavaScript. You can expand or collapse all nodes of the tree:
var tree = new COOLjsTree("tree1", TREE1_NODES, TREE1_FORMAT);
...
tree.expandAll(true);
tree.collapseAll(true);
"true" means redraw tree immediately.
You can toggle specific node, i.e. collapse it if it was expanded or expand it if it was collapsed:
var node = tree.nodeByName('Node 1');
// or
var node = tree.nodeByID(7);
if (node) tree.expandNode(node.index);
Nodes are counted from top to bottom. Root node has index 0.