Value
methodsGets or sets the value of the DropDownTree.
Important: If there are no items, the value method will pre-fetch the data before continue with the value setting.
Important: The widget will clear the applied filter if a new value is set. Thus it ensures that the original/whole data set is available for selection.
Important: This method does not trigger change event.
This could affect MVVM value binding. The model bound to the widget will not be updated.
You can overcome this behavior by triggering the change event manually using trigger("change") method.
<input id="dropdowntree" />
<script>
$("#dropdowntree").kendoDropDownTree({
dataSource: [{ text: "Item1", value: 1 }, { text: "Item2", value: 2 } ],
});
var dropdowntree = $("#dropdowntree").data("kendoDropDownTree");
dropdowntree.value("2");
dropdowntree.trigger("change");
</script>
The value to set. A String value, when checkboxes is 'false', and an Array of items of the value field type (number or string), when checkboxes is true. To clear the value, pass an empty array.
The value of the DropDownTree.