react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Parent ids in checked state

Open AliBayatMokhtari opened this issue 4 years ago • 4 comments

what is the approach or algorithm if we need to store all the selected leaves ids and their parents ids recursively?

AliBayatMokhtari avatar Apr 11 '21 23:04 AliBayatMokhtari

You can use checkModel="all" such that if a parent node has all children fully checked it will be included in the checked array.

jakezatecky avatar Jun 08 '21 22:06 jakezatecky

You can use checkModel="all" such that if a parent node has all children fully checked it will be included in the checked array.

Yes but what if we wanna add the parent to the checked array if at least one of its children is checked?

AliBayatMokhtari avatar Jun 13 '21 08:06 AliBayatMokhtari

Currently, that is not possible. Partially-checked nodes (that is, nodes with at least one child checked but not all children checked) are never included in the checked array.

A future version could support such behavior, but it would require a bit of a rework of the internals.

jakezatecky avatar Jun 13 '21 08:06 jakezatecky

Is there any news on this yet?

fs86 avatar Mar 24 '22 09:03 fs86