How to disable checkboxes in Dropdowntree

1 Answer 357 Views
DropDownTree wrapper
Jerry
Top achievements
Rank 1
Iron
Iron
Iron
Jerry asked on 22 Jun 2021, 07:18 PM

Is there a way to disable just the checkbox in the dropdowntree? I need to be able to select and drill down in each node, but also need some checkboxes to be disabled. So a node could be disabled, but I would still like to drill down and select items inside that node that are enabled.

"myDataSource" has a "isEnabled" property that is set to true or false.

How can I disable just the checkbox in the control below

<dropdowntree
      :data-source="myDataSource"
      tagMode="single"
      :autoClose=false
      :checkboxes-check-children="true"
      :check-all="true"
      dataTextField="text"
      dataValueField="id"
      style="width: 100%;"
      height="auto"
    >
    </dropdowntree>


1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 24 Jun 2021, 08:04 AM

Hello,

You can achieve this by using checkboxes-template prop as for example it is done in this example - https://stackblitz.com/edit/supfa8?file=src/main.vue

 tmp: `<input type='checkbox' class='k-checkbox #= item.isEnabled ? "" : "k-state-disabled" #' value='true' />`,

Regards,
Plamen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DropDownTree wrapper
Asked by
Jerry
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Plamen
Telerik team
Share this question
or