I came up with the following, using a HierarchicalDataSource:
var childrenDataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: function (options) {
return kendo.format("../api/hierarchytree/{0}", options.id); // only return child elements of a specific node
}
}
},
schema: {
model: {
hasChildren: "hasChildren",
id: "id"
}
}
})
// Setup data source, that will get the [root] elements for the treeview
var rootDataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "../api/hierarchytree" // only return root elements
}
},
schema: {
model: {
hasChildren: "hasChildren",
id: "id",
children: childrenDataSource
}
}
});