Issue 364: Checkbox is not preselected of a parent node if its only children is selected
Status:  Duplicate
Merged:  issue 114
Owner: ----
Closed:  Oct 2012
Reported by i...@nethelpers.de, Oct 16, 2012
What steps will reproduce the problem?
1. Load a tree by ajax.
2. There are a few nodes with checkboxes that have children with checkboxes. 
3. If there is only one children for a node with a selected checkbox, the parent checkbox is not checked by default. It's checked as soon, as the node is expanded.

What is the expected output? What do you see instead?
 - The checkbox is unchecked but will be checked if the node is expanded. The node should be checked by default like the other nodes that have (more than one) checked children.

What version of the dynatree and jQuery are you using?
 - dynatree 1.2.2
 - jQuery 1.7.1

On what operating system and browser?
 - Windows Server 2008 R2, Firefox
What DOCTYPE declaration are you using?
 - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Please provide any additional information below.

Oct 16, 2012
Project Member #1 moo...@wwwendt.de
you are using selectMode: 3, right?

is this related to 
     issue #114  ?
Status: Waiting
Labels: Milestone-Release1.2.2
Oct 17, 2012
#2 i...@nethelpers.de
Yes, I'm using selectMode: 3, but the tree is not lazy-loading at all. 
On a button click, all leafes and nodes are loaded by ajax at once. I'll attach screenshots for better understanding.

If the node of "czech" is collapsed/expanded, the checkbox is checked and the title is italic and blue. This is the state that should appear by default after loading. This issue concerns only nodes with one children. 
The other two possibilities (node has no child-nodes or more than one children) do work.
2012-10-17_091044.png
9.9 KB   View   Download
2012-10-17_091210.png
6.6 KB   View   Download
Oct 17, 2012
#3 i...@nethelpers.de
Correcture: it doesn't matter how much child-nodes a leaf has. If 100% of the child-nodes of a leaf are checked, the parent-node has no marked checkbox unless it's collapsed and expanded again.
Oct 18, 2012
Project Member #4 moo...@wwwendt.de
I would still argue that it's related to  issue 114 .
You are adding inconsistent data, i.e. parent is deselected but all children are selected - which is not valid in selectMode 3.
Does this mean that the parent should be selected?
Or should all children be deselected?

I understand that this is a frequent source of confusion, but I am still looking for a concise and easy-to-explain behavior / solution. 
Status: Duplicate
Mergedinto: 114
Oct 18, 2012
#5 i...@nethelpers.de
The parent should be selected in any case, if at least one of its children is selected.
In the case, that only one of many child-chexboxes is selected, the parent checkbox should be displayed blue filled, like you can see in the screenshot for node "germany". If all children-checkboxes are checked, a checkmark is set in the parent checkbox.