# Persisting the Disabled State

The TreeView enables you to define and persist the disabled state of its nodes when the component is re-rendered.

## Basics

The TreeView determines the disabled state of its nodes by exposing the `isDisabled` function.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treeview/disable-state/basic/source.txt)

## Built-in Directives

To persist the disabled state of the TreeView, either:

* [Use the built-in `DisableDirective`](https://www.telerik.com/kendo-angular-ui-develop/components/treeview/disabled-state#using-the-built-in-directive), or
* [Set an item field](https://www.telerik.com/kendo-angular-ui-develop/components/treeview/disabled-state#setting-an-item-field).

### Using the Built-In Directive

By default, the built-in [`DisableDirective`](https://www.telerik.com/kendo-angular-ui-develop/components/treeview/api/disabledirective) persists the disabled items based on their hierarchical index.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treeview/disable-state/using-directive/source.txt)

### Setting an Item Field

You can also persist the disabled state of the TreeView by item field—for example, the `text` field.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treeview/disable-state/by-id/source.txt)

## Disable Parent Nodes

By default, the `TreeView` component disables all child nodes of a disabled node. The component can be configured to disable parent nodes only without disabling its children by setting the [`disableParentNodesOnly`](https://www.telerik.com/kendo-angular-ui-develop/components/treeview/api/treeviewcomponent#disableparentnodesonly) field to `true`.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treeview/disable-state/parent-field/source.txt)

## Suggested Links

* [Angular TreeView Homepage](https://www.telerik.com/kendo-angular-ui/treeview)
* [API Reference of the Angular TreeView](https://www.telerik.com/kendo-angular-ui-develop/components/treeview/api)
