Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jstree: I can't reset all the checkboxes to uncheck by default when I reload my tree

I tried to use this:

$("#jstree_demo_div").jstree("destroy").empty();  

It removes the checked nodes and reload the tree but does not apply the new changes. Any suggestion will be greatly appreciated.

Globally I need to reset my tree with unchecked checkBox

like image 368
user3542482 Avatar asked Sep 17 '25 01:09

user3542482


2 Answers

this is working nice for me !

 $('#jstree_demo_div').jstree(true).deselect_all();
like image 90
user3542482 Avatar answered Sep 18 '25 16:09

user3542482


for checking all the checkboxes

$("#jstree").jstree(true).check_all();

for unchecking all the checkboxes

$("#jstree").jstree(true).uncheck_all();
like image 43
Ravindra Gupta Avatar answered Sep 18 '25 18:09

Ravindra Gupta