jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to get just the checked parent value if all the childrens are selected rather than getting all checked values

sagarreddy-gfk opened this issue · comments

Hi @jakezatecky ,

If all the childrens are selected, then I just need parent value of it rather than all checked values. Could you please let me know the way to achieve it? because it is a costly request for us as the data is more than 10k. and also if there is a way to select all/unselect all because since the data is huge, iteration would be costly to iterate over all the nodes.

Thanks in advance!

At the moment, the CheckboxTree supports either storing all leaf nodes selected (default behavior) or all nodes selected (with checkModel="all". What you describe is not yet supported, where the topmost selections are stored, but it is an enhancement we intend to support.

Unselecting all nodes is as simple as making the checked array empty, but selecting all of them is costly as you note. There is no current way to select all nodes without iterating through them.