loadCompleted
This event triggers only when loadOnDemand
is set to false
- it indicates that all nodes that need to be loaded are ready and present as data items in the DataSource of the TreeView.
Event Data
e.nodes Array
Applicable for remote binding scenario only. All the nodes that have children and are loaded. If empty array is passed then no nodes have children to be loaded. For a local binding scenario the argument will always be an empty array.
Example
<div id="treeview"></div>
<script>
var dataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "https://demos.telerik.com/kendo-ui/service/Employees",
dataType: "jsonp"
}
},
schema: {
model: {
id: "EmployeeId",
hasChildren: "HasEmployees"
}
}
});
$("#treeview").kendoTreeView({
loadOnDemand: false,
dataSource: dataSource,
dataTextField: "FullName",
loadCompleted: function (ev) {
console.log("Load Completed: ", ev.nodes);
}
});
</script>