PDA

View Full Version : [FIXED] GXT 2.0 m3 checkable tree bug?



ypfamily
18 Jun 2009, 3:19 PM
Hi,

I am very new to GXT, so it's possible that I am just doing something wrong, but...

I deployed the example provided with the download, specifically, I deployed the GUI coded in the CheckBoxTreePanelExample. The only thing that I changed (as I was playing with it), was that I added the last line here:

....
tree.setCheckable(true);
tree.setCheckStyle(CheckCascase.CHILDREN); // this is the line I added

I know that by default, the cascading is done from leafs to parent nodes, so I wanted to reverse that. However, when I add this line, the behavior is a bit weird.

If I check on a node that contains other nodes, only that node is checked. However, if I check the leaf node first, then the consecutive checks to its containing parent will check and uncheck the leaf node together with the parent.

Is this a bug or am I doing something wrong?

Thanks,
Yaakov.

darrellmeyer
22 Jun 2009, 2:05 PM
Fixed in SVN. We updated the checkbox demo and you can switch cascade types (http://extjs.com/examples-dev/explorer.html#checkboxtree).

ypfamily
22 Jun 2009, 6:16 PM
Hi,

Well, unfortunately, it's still pretty buggy. Now, I am just using your link to discover those bug (i.e., I didn't write any code to verify)

Looking at your example that you posted:
1) When the nodes are not expanded, checking higher (closer to the root) nodes does **not** check the children nodes in "children" mode. However, if the nodes are expanded, checking that same higher node will check all the children nodes as well.

2) When all the nodes are expanded and you check one of the root nodes in that subtree, the child nodes do get checked. However, collapsing and expanding the higher root node has the affect of unchecking all non-leaf nodes in that subtree.

That's just the ones that I noticed.

Please let me know when these are fixed.

Thanks,
Yaakov.

darrellmeyer
23 Jun 2009, 6:41 AM
Both items should be fixed now. Can you validate at http://extjs.com/examples-dev/explorer.html#checkboxtree ?

ypfamily
23 Jun 2009, 8:15 AM
Looks good... A few more though.. :-)

1) In "parent" mode, checking the leaf checks its parent(s). However, if you now uncheck that same leaf, the parent(s) stays checked.

2) In "parent" mode, checking the leaf checks its parent(s). However, if you now uncheck the parent, the leaf gets unchecked as well. That doesn't make sense in "parent" mode.

3) In "children" mode, checking the parent check all of its leaves. However, if you now (manually) uncheck all of the leafs, the parent stays checked. In "children" mode, it seems the collective state of the children should propagate to the parent. Since this component simulates your regular explorer view, it only seems right to keep the same behavior.

Thanks for fixing the bugs so far and I'll be happy to validate again once these are fixed.

Thanks,
Yaakov.

darrellmeyer
25 Jun 2009, 9:00 AM
I think the expected behavior will vary per use case. I have added a new method to TreePanel:


protected void onCheckCascade(M model, boolean checked) {
}

You can subclass TreePanel and provide the your desired behavior. Change is in RC1.