# Data Binding

The Kendo UI for Vue TreeView enables you to work with various types of data.

## Basics

To bind the TreeView to data:

1. Add children items to an item with an `items` field.
2. Configure the [`dataItems`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#dataitems) property.

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

## Item Fields

By default, the TreeView provides the following fields for its items:

* [`text`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#textfield)—The string representation of the item.
* `items`—The children of the item.
* [`expanded`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#expandfield)—If set to `true`, expands the item.
* [`selected`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#selectfield)—If set to `true`, selects the item.
* [`disabled`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#disablefield)—If set to `true`, disables the item.
* [`checked`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#checkfield)—If set to `true`, checks the item.
* [`checkIndeterminate`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#checkindeterminatefield)—If set to `true`, applies an indeterminate check to the item.
* [`hasChildren`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops#haschildrenfield)—If set to `true`, notifies the TreeView that the item has children even if they are not initially passed. Used for implementing the load-on-demand feature.

Apart form `items`, you can replace each of the default TreeView fields with custom ones. To include your own fields, set the corresponding TreeView property to the name of the custom field. The TreeView also supports the nesting of its item fields.

[Demo Source](https://demos.telerik.com/kendo-vue-ui/treeview/data-binding/item-fields/source.txt)

## Loading Data on Demand

The following example demonstrates how to fetch remote data and bind the TreeView to it.

To implement the load-on-demand feature:

1. Set the `hasChildren` field of the root items.
2. Provide their children afterwards.

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

## Suggested Links

* [`onExpandChange`](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewexpandchangeevent)
* [API Reference of the TreeView](https://www.telerik.com/kendo-vue-ui/components/treeview/api/treeviewprops)
