The documentation for jsTree is thorough, but not particularly easy to read. If you are looking for an easy way to add “Expand All” and “Collapse All” buttons, here’s one way:
<input type="button" value="Collapse All" onclick="$('#tree_container_id').jstree('close_all');">
<input type="button" value="Expand All" onclick="$('#tree_container_id').jstree('open_all');">
where ‘#tree_container_id’ is, of course, the ID of the container node for your tree.
Thanks, the jsTree documentation can use some improvements here and there..
Correct about the jstree documentation lacking in some parts. I was able to use Sara’s code hint in a professional project I am working on. Here’s a Codepen of it: http://codepen.io/WebDevCA/full/yinhk
Now I have to figure out how to get cookies to work on it…