-
Notifications
You must be signed in to change notification settings - Fork 215
Checking all children of a node should only check the root node #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There are a few ways to go about here:
While the react-checkbox-tree component currently uses the first model, I do not see why we could not also support the other two models. Could be a component parameter. |
Any progress on these models? I could use the 3rd one - "Record every checked node in |
@qodesmith No progress has been made. Much of the component makes assumptions about check state based on child nodes. Nevertheless, of the additional models, the third one you are wanting is the easier one to implement. A PR is welcome. Otherwise, I'll get to this when I can. I certainly agree that it would be useful to have implemented. |
Hi, The component designed by you is very useful but |
Hi, I tried updating to your V1.1.0: I got the following error: |
@VikramMaiya There are no 1.1.0 release yet. |
Hi William, |
@VikramMaiya None of that is implemented yet. I only marked it for next release. |
Hi jakezatecky, |
Hi jakezatecky, |
I solved some of my issue, but its not fully done. With this code, i can get the id of my parent, when i select all the values using parent. But if i deselect one of my child then it doesn't exclude the parent value from checked array. Here is the code that i changed:
|
Any updates on the suggested models? I could really use the second option: |
@jakezatecky Any updates on this? The third option is an incredible plus for me and would love that to be an "official" addition |
Model 3 is the one that can most easily be added. The second model would take more...thought. While some interest in Model 2 has been expressed, I can likely get a partial implementation with (Tesla) Model 3 in the next major release. I have recently acquired some additional free time, so I think sometime before the end of this year is a good possibility. I am wrapping up some updates on one of my other libraries and then I will come back to this one. |
@jakezatecky Hi, |
…the `checked` array Currently only supporting 'leaf' (the default behavior) and 'all'. This lines up with models 1 and 3 on #13. Model 2 still needs implementation, although some pieces have been included in this commit.
Model 3 has been fully implemented on the It remains to be seen whether the second model will be included in the v1.6 release, as implementing its behavior is a bit awkward. |
I just coded up a fork that does model 2 (if I understood it correctly). |
checkModel="all" does not work. I updated my package with src files from v1.6-dev |
@jakezatecky I've done a little testing on v1.6.0-alpha.1 and I am still thinking of the consequences of this. I suppose what matters is how the wrapping program uses the I think I will put together some more test examples to expand my understanding of what is going on... |
@worthlutz, yes the partial nodes are intentionally not included in the |
@bikashkomprise can you post a live example showing your issue? I created a quick sandbox example that logs to the console all nodes when items are checked/unchecked: |
Hi, any updates on this cool new feature ? :D |
any news about this? I want to include not only checked leafs but their parent nodes in checked array |
checkModel="all" does works for v1.6 |
It does not select all the parents and only select the first parent if and only if all the children of a parent are selected. |
How can I do this?
|
As asked by @worthlutz, |
Is there any update about half checked nodes |
The only thing that helped me to get all the half checked nodes in onCheck was to override the code of the library as per my needs. |
Say you have made a selection like so;

Shouldn't
All
be the only item in the checked array in this scenario? Cause right now, every children will populate the checked array, and the root node will not be included. Or am I wrong here?The text was updated successfully, but these errors were encountered: