Closed pccolella closed 11 years ago
I was able to reproduce and fix the issue. In your example you explicitly set the checkedAttr property on the model, however, both the expandChecked() and collapseUnChecked() methods looked for a checked property (e.g the default value of checkedAttr).
The issue has been fixed and checked in to github. Please fetch the updated Tree.js module from github and let me know if this fixed the issue for you.
(No download package with the fix available yet).
Thank you I understand your changes. I've updated my Tree.js and unfortunately my tree does not expand to checked leafs. I've also tried tried changing my store object property from 'event_id' to 'checked' and have removed the checkedAttr in the Model and although the leaf does get checked properly, the expandChecked function still does not work. But thank you for your help.
The solution I found to this is:
Model should have: checkedRoot: true otherwise by default the root is not getting a checked state
Also, there seems to be a timing issue with calling expandChecked directly after the creation. Perhaps the delay in loading data via a URL is an issue. Instead by setting: openOnChecked: true in the tree properties, there is no need to call expendChecked as this will occur properly after the tree is loaded.
Thanks for your help.
I have tweaked the expandChecked() method a little more to account for tree's that don't have a root checkbox. In addition, I also added a new property to the tree, branchCheckBox which will offer the ability to hide checkboxes associated with branch nodes.
To account for any delays due to loading the store using a URL you should do the following:
tree.on("load", function () {
this.expandChecked();
});
I checked in the tree update, and added documentation for the branchCheckBox property. Please fetch Tree.js from github and give it a try.
Please let me know if this fixes your issue(s).
Hi,
This is a great tool! I'm trying to expand all branches which have checked leafs. I thought the expandChecked() function may be the solution but it doesn't seem to do that.
Code is fairly simple and using dojo 1.9.1
Any guidance would be greatly appreciated.