Letractively / dynatree

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

Checkbox is not preselected of a parent node if its only children is selected #364

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by i...@nethelpers.de on 16 Oct 2012 at 11:40

GoogleCodeExporter commented 8 years ago
you are using selectMode: 3, right?

is this related to 
    issue #114 ?

Original comment by moo...@wwwendt.de on 16 Oct 2012 at 5:20

GoogleCodeExporter commented 8 years ago
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.

Original comment by i...@nethelpers.de on 17 Oct 2012 at 7:16

Attachments:

GoogleCodeExporter commented 8 years ago
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.

Original comment by i...@nethelpers.de on 17 Oct 2012 at 8:53

GoogleCodeExporter commented 8 years ago
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. 

Original comment by moo...@wwwendt.de on 18 Oct 2012 at 6:26

GoogleCodeExporter commented 8 years ago
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. 

Original comment by i...@nethelpers.de on 18 Oct 2012 at 6:35