Make disabled nodes expandable?

3 posts, 1 answers
  1. Yuriy Rogach
    Yuriy Rogach avatar
    9 posts
    Member since:
    Feb 2008

    Posted 20 Oct Link to this post

    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. Answer
    Svetlin
    Admin
    Svetlin avatar
    444 posts

    Posted 22 Oct Link to this post

    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).

  3. Yuriy Rogach
    Yuriy Rogach avatar
    9 posts
    Member since:
    Feb 2008

    Posted 22 Oct in reply to Svetlin Link to this post

    Hi Svetlin,

     

    Thanks for the info!

     
Back to Top