OdinaSpb / jstree

Automatically exported from code.google.com/p/jstree
0 stars 0 forks source link

checkboxes: checking each child will automatically check the parent #908

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Make a 3-state checkbox tree with 1 root and 2 leaf nodes
2. Check the two leaf nodes

The root will be checked also.

In the context of some trees this isn't always valid (e.g. "files & folders" - 
a folder isn't selected when you select all files within it).

e.g. I'm using 3-state checkboxes for UI to prune a big tree (I like the 
indeterminate for hinting a selected child). I need the ability to delete all 
child nodes without deleting the parent.

I don't know if I've missed an option somewhere, for the time being I'm using a 
patch (on 1.0rc2) that I have to keep updated. If it's not supported I think 
this would be a useful option to have.

Thanks a lot, I love jsTree!

jsTree.1.0rc2\jquery.jstree.js: 
line 2340:
else if(a === c) { this.find("li").removeClass("jstree-checked 
jstree-unchecked").addClass("jstree-undetermined"); }

and comment out line 2298:
//$this.removeClass("jstree-unchecked 
jstree-undetermined").addClass("jstree-checked");

Original issue reported on code.google.com by olli.hol...@gmail.com on 25 Feb 2011 at 7:18

GoogleCodeExporter commented 9 years ago
We (and I'm sure plenty of others) depend on the existing functionality.  This 
would be better served with an option.

Original comment by shanecou...@gmail.com on 27 Aug 2011 at 3:49