# Local and Remote Data Binding

The DropDownTree provides options for binding it to [local data arrays](https://www.telerik.com/kendo-jquery-ui/documentation/controls/dropdowntree/binding/data-binding#binding-to-local-data) and [remote data services](https://www.telerik.com/kendo-jquery-ui/documentation/controls/dropdowntree/binding/data-binding#binding-to-remote-data).

## Binding to Local Data

Local arrays are suitable for limited value options.

To initialize the DropDownTree by binding the widget to a local data array, use the [Data Source component](https://www.telerik.com/kendo-jquery-ui/documentation/framework/datasource/overview). It is an abstraction for local and remote data.

```
<input id="dropdowntree">

<script>
    $(document).ready(function() {
        $("#dropdowntree").kendoDropDownTree({
            dataSource: [
            {
                text: "Item 1",
                items: [
                    { text: "Item 1.1" },
                    { text: "Item 1.2" }
                ]
            },
            { text: "Item 2" }
            ]
        });
    });
</script>
```

## Binding to Remote Data

The following example demonstrates how to create a DropDownTree and bind it to a remote HierarchicalDataSource.

```
<input id="dropdowntree"></input>

<script>
    var serviceRoot = "https://demos.telerik.com/service/v2/core";
    var myDataSource = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
            url: serviceRoot + "/Employees"
            }
        },
        schema: {
            model: {
            id: "EmployeeId",
            hasChildren: "HasEmployees"
            }
        }
    });

    $("#dropdowntree").kendoDropDownTree({
        dataSource: myDataSource,
        dataTextField: "FullName"
    });
</script>
```

## See Also

* [Remote Data Binding by the DropDownTree (Demo)](https://demos.telerik.com/kendo-ui/dropdowntree/remote-data-binding)
* [OData Binding by the DropDownTree (Demo)](https://demos.telerik.com/kendo-ui/dropdowntree/odata-binding)
* [JavaScript API Reference of the DropDownTree](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/dropdowntree)
