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\");
// Expand pasted, dragged and dropped node for jstree 3.3.1
var objtree = $('#jstree');
objtree.bind('paste.jstree', function(e, d) { objtree.jstree('open_all', '#' + d.parent); });
$(document).bind('dnd_move.vakata', function(e, d) { objtree.jstree('open_all', $(d.event.target).closest('.jstree-node').attr('id')); });
$(document).bind('dnd_stop.vakata', function(e, d) { objtree.jstree('open_all', $(d.event.target).closest('.jstree-node').attr('id')); });