setDataSource

Sets the dataSource of an existing DropDownTree and rebinds it.

Parameters

dataSource kendo.data.HierarchicalDataSource

Example

<input id="dropdowntree" />

<script>
    $("#dropdowntree").kendoDropDownTree({
        dataSource: [{ text: "a-item1", value: 1 }, { text: "b-item2", value: 2 }],
        filter: "startswith"
    });
    var dropdowntree = $("#dropdowntree").data("kendoDropDownTree");
    var dataSource = new kendo.data.HierarchicalDataSource({
        data: [{ text: "item1", value: 1 }, { text: "item2", value: 2 }]
    });
    var dropdowntree = $("#dropdowntree").data("kendoDropDownTree");
    dropdowntree.setDataSource(dataSource);
</script>
In this article
Not finding the help you need? Improve this article