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\");
just use this if you use json
$("#treeId").on ('loaded.jstree', function() { $("#treeId").jstree("open_node", $("#nodeId")); });