dipson88 / treeselectjs

Treeselect on vanilla JS
MIT License
83 stars 15 forks source link

Select Parent as individul node don't select all child element when parent is selected #57

Closed Ajay-Bacancy closed 1 year ago

Ajay-Bacancy commented 1 year ago

I want that parent should be selected as separate node don't select all child when parent is selected. Is there any props available like this?

dipson88 commented 1 year ago

Hi @Ajay-Bacancy, it is a nice feature. Do you mean that every node should be independent? If we check the parent node - children will not be selected, so if you check all children - the parent node will not be selected as well? Did I understand correctly? If it works this way, I can implement it.

masiorama commented 1 year ago

This is something I would like too as an optional configuration option, as you just described in your comment @dipson88

dipson88 commented 1 year ago

@masiorama I will try to include this feature in the next release.

dotgourav commented 1 year ago

I was also searching on a way to do something similar. In our application, we allow parent nodes to be assigned to different entities. So, in order to filter by the parent node, I need to find parent node myself.

But if I can just select the parent node without selecting the children nodes automatically then it would solve the problem.

When is the next release by the way? Is there anything planned?

dipson88 commented 1 year ago

Now I can't say the exact date of the next release. But I've investigated this feature. This leads to more complicated code, but if people need this, I will set higher priority to this feature.

masiorama commented 1 year ago

For us it would be a mandatory addition because some clients need this. +1 high priority for me, thanks

MirkoFarina commented 1 year ago

+1 high priority for me, i need the same things.

massiws commented 1 year ago

An option to include/exclude the parent in the searchable items would be a very cool feature.

dipson88 commented 1 year ago

Hi, everyone. I added one more prop isIndependentNodes - All nodes in treeselect work as an independent entity. Check/uncheck action ignore children/parent updates workflow. Disabled nodes ignore children/parent workflow as well. You can check the documentation. And also I've added an example on the demo page - https://dipson88.github.io/treeselectjs/ You need to use a new version 0.9.0. @massiws - could you please create a separate issue? I will try to think about it there.

masiorama commented 1 year ago

Thanks! I will check it out asap and give a feedback!