I am using jsTree to display a tree. I want to select all the nodes in the tree of which I can use $("#my-tree").jstree("check_all")
. This works fine.
However, this will expand all the nodes and having a big tree will push the rest of the content all the way down.
I want to collapse the tree after checking all the nodes but using $("#my-tree").jstree("close_all")
after checking all nodes doesn't work.
Anyone has a solution to this?
$("#my-tree").jstree({
"checkbox": {
"keep_selected_style": false
},
"plugins": ["checkbox"]});
$("#my-tree").jstree("hide_dots");
$("#my-tree").jstree("check_all");
$("#my-tree").jstree("close_all");
You can use ready.jstree event Should use something like this: