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>
In this article