This is a migrated thread and some comments may be shown as answers.

Make disabled nodes expandable?

2 Answers 81 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yuriy Rogach
Top achievements
Rank 1
Iron
Yuriy Rogach asked on 20 Oct 2020, 09:01 PM

I have a treeview where some parent nodes are disabled on certain criteria, however, the children are enabled, but I can't expand disabled parents.

Example https://stackblitz.com/edit/angular-gxqjsq

Is that scenario supportable or is there any workaround to achieve it?

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Svet
Telerik team
answered on 22 Oct 2020, 10:33 AM

Hi Yuriy,

Thank you for the provided example.

Indeed, I can confirm that when an item is disabled its expand icon, checkbox, and children will be disabled as well. Thus, what could be done as a workaround for this case is to use the built - in kendoTreeViewExpandable directive, but not use the kendoTreeViewCheckable directive. Instead custom checkboxes could be created within the node template. That will allow to apply some styles conditionally to each tree node and to disable just the checkbox but leave the expand icon active. The drawback of such approach is that it will require the developer to create their own custom implementation of checking/unchecking the items when the corresponding checkbox is checked/unchecked.

I hope the provided information helps. Please let me know in case any further details are required for this case. Thank you.

Regards,
Svetlin
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Yuriy Rogach
Top achievements
Rank 1
Iron
answered on 22 Oct 2020, 06:14 PM

Hi Svetlin,

 

Thanks for the info!

 
Tags
TreeView
Asked by
Yuriy Rogach
Top achievements
Rank 1
Iron
Answers by
Svet
Telerik team
Yuriy Rogach
Top achievements
Rank 1
Iron
Share this question
or