I am using the JQuery plugin jsTree, http://www.jstree.com/ I am able to expand the whole tree with the following method:
$(\"#tree\").jstree(\"open_all\");
You could use the binding
$("#tree").bind("open_node.jstree", function (event, data) { if((data.inst._get_parent(data.rslt.obj)).length) { data.inst._get_parent(data.rslt.obj).open_node(this, false); } });