I am using the following code:
$("#treeview").jstree();
$("#treeview").jstree(\'open_all\');
With the following html:
all the answers above not work in my workspace. I searched again and find this link(Why doesn't jsTree open_all() work for me?) is helpful, and post my answer:
jstree version: 3.0.0-bata10
$(document).ready(function() {
$("#tree").bind("loaded.jstree", function(event, data) {
data.instance.open_all();
});
$("#tree").jstree();
})