Edit this page

enable

Enables or disables nodes.

Parameters

nodes jQuery |Element |String |Boolean

The nodes that are to be enabled/disabled. Or, if Boolean parameter is passed, all nodes will be enabled/disabled.

enable Boolean (optional, default: true)

Whether the nodes should be enabled or disabled.

Example

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", enabled: false },
    { text: "bar", enabled: false }
  ]
});

var treeview = $("#treeview").data("kendoTreeView");
// enable the item with text "foo"
treeview.enable(treeview.findByText("foo"));

// enable all items
treeview.enable(".k-item");
</script>

Example - enable all nodes

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo", enabled: false },
    { text: "bar", enabled: false }
  ]
});

var treeview = $("#treeview").data("kendoTreeView");

// enable all items
treeview.enable(true);
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy