Skip to content
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

Enhance TreeList Selection with Parent-Child Checkbox Propagation #2174

Open
Nassefferjeni opened this issue Apr 15, 2024 · 4 comments
Open
Labels
Enhancement New feature of an existing functionality or an improvement of an existing functionality FP: Unplanned Label that indicates that this is a valid feature request or a bug report. KendoReact pkg:Treelist

Comments

@Nassefferjeni
Copy link

Currently, KendoReact TreeList doesn't offer a built-in way to achieve selection behavior where selecting a parent node automatically selects all its children, and vice versa (deselecting all children deselects the parent). This feature would be highly beneficial for use cases involving hierarchical data structures where managing parent-child selection is crucial.

Question
Do we have a logic in place for this? ( even if the logic is custom )

If not:

Here's a proposed approach:

  • Introduce a new option for the selectable prop, potentially named propagateSelection or recursiveSelection (similar to applyCheckIndeterminate provided in the TreeView component ). When set to true, it activates the desired behavior where selecting a parent selects all children, and deselecting all children deselects the parent.

Benefits:

  • Simplifies selection logic for developers working with hierarchical data.
  • Improves user experience by making parent-child selection intuitive.
  • Reduces the need for custom selection logic implementations.
@PaskalevStoyan
Copy link

Hi @Nassefferjeni,

Thanks for the proposed Feature Request.

Firstly, i want to say that, Ive created a StackBlitz demo to demonstrate how to implement the desire behaviour. You can see the main logic which is in the includeChildSelection method:

https://stackblitz.com/edit/react-cyjuac?file=app%2Fmain.tsx

I've also opened a feature request in our FeedBack portal where we track the demand for features. Also, I've upvoted from your behalf:

https://feedback.telerik.com/kendo-react-ui/1649047-parent-child-checkbox-propagation

@PaskalevStoyan PaskalevStoyan added Enhancement New feature of an existing functionality or an improvement of an existing functionality pkg:Treelist FP: Unplanned Label that indicates that this is a valid feature request or a bug report. KendoReact labels Apr 17, 2024
@Nassefferjeni
Copy link
Author

Thank you @PaskalevStoyan for the demo and also the feature request.

But I still think the demo is missing one thing: when you select all of the children of a node the parent should autamtically be selected also.

@PaskalevStoyan
Copy link

Hi, @Nassefferjeni,

Thanks for the feedback.

The idea around this demo is to lay grounds for a starting point where it would help people who will come in the future to see this issue. As this is still not a built-in feature and it's quite specific which transforms in a lot of scenarios, it will need the developers' effort to adjust the desired scenario to its needs.

What I mean here is that some will want to check a parent if all of its direct children and all their children are selected, some people will want to leave out the parent out of the selection when all of its children below are selected.

We recommend if there are any questions regarding our components or their specific configuration to submit a support ticket on our support platform.

@Nassefferjeni
Copy link
Author

Yes makes sense then.

Thank you @PaskalevStoyan for the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature of an existing functionality or an improvement of an existing functionality FP: Unplanned Label that indicates that this is a valid feature request or a bug report. KendoReact pkg:Treelist
Projects
None yet
Development

No branches or pull requests

2 participants