# Using Helper Functions

The TreeView enables you to update parent and child nodes as well as items in an indeterminate state by using helper functions.

## Setup

To implement such use case scenarios, use the following helper functions:

* [`handleTreeViewCheckChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/handletreeviewcheckchange)—Provides the ids of the checked TreeView items. Allows you to automatically check parent and child nodes, and to configure a single or multiple selection mode. For more information, refer to [`TreeViewCheckChangeSettings`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckchangesettings).
* [`processTreeViewItems`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/processtreeviewitems)—Based on the provided ids of the checked TreeView items, updates the data in an immutable way. Enables you to configure the application of an [indeterminate state](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes) to the items.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/treeview/checkbox/checkbox-helper/source.txt)

## Customizing Single Item Checking

By default, [`handleTreeViewCheckChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/handletreeviewcheckchange) and [`processTreeViewItems`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/processtreeviewitems) work with hierarchical item indices. Alternatively, you can use a custom item field which uniquely describes the item (for example, an **ID** column from a database) by setting the [`idField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor#idfield) of the TreeViewCheckDescriptor to the name of the custom field.

By default, a TreeView item is in an [indeterminate state](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes) when its `checkIndeterminate` field is set to `true`. Also, the application of an [indeterminate state](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes) to TreeView items is decoupled from the selection mode (single or multiple).

To enable the application of an indeterminate state, use the [`applyCheckIndeterminate`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor#applycheckindeterminate) field of the TreeViewCheckDescriptor. To use a custom item field instead of the `checkIndeterminate` field:

1. Set the [`checkIndeterminateField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor#applycheckindeterminate) field of the TreeViewCheckDescriptor to the name of the custom field.
2. Set the [`checkIndeterminateField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#checkindeterminatefield) property of the TreeView to the name of the custom field.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/treeview/checkbox/checkbox-helper-single/source.txt)

## Customizing Multiple Item Checking

By default, [`handleTreeViewCheckChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/handletreeviewcheckchange) and [`processTreeViewItems`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/processtreeviewitems) work with hierarchical item indices. Alternatively, you can use a custom item field which uniquely describes the item (for example, an **ID** column from a database) by setting the [`idField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor#idfield) of the TreeViewCheckDescriptor to the name of the custom field.

By default, a TreeView item is checked when its `checked` field is set to `true`. To use a custom item field instead of the `checked` field:

1. Set the [`operationField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor#operationfield) field of the TreeViewCheckDescriptor to the name of the custom field.
2. Set the [`checkField`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#checkfield) property of the TreeView to the name of the custom field.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/treeview/checkbox/checkbox-helper-multiple/source.txt)

## Suggested Links

* [`handleTreeViewCheckChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/handletreeviewcheckchange)
* [`TreeViewCheckChangeSettings`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckchangesettings)
* [`processTreeViewItems`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/processtreeviewitems)
* [`TreeViewCheckDescriptor`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckdescriptor)
* [`onCheckChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewcheckchangeevent)
* [API Reference of the TreeView](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops)
