Would it be possible to create a hierarchical datasource not from two endpoints, as the example shows below, but from two functions returning json. Could the two transport sections below be replaced with data (as in data: getProductData()) functions which return data that the dataSource then "combines" the way it does with remote endpoints? If this is possible, how would the function returning the second level data (like products below) look?
var Categories = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "http://demos.kendoui.com/service/Categories"
}
},
schema: {
model: {
hasChildren: "Products",
id: "CategoryID",
children: {
transport: {
read: {
url: "http://demos.kendoui.com/service/Products"
}
},
schema: {
model: {
id: "ProductID",
hasChildren: false
}
}
}
}
}
});
var Categories = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "http://demos.kendoui.com/service/Categories"
}
},
schema: {
model: {
hasChildren: "Products",
id: "CategoryID",
children: {
transport: {
read: {
url: "http://demos.kendoui.com/service/Products"
}
},
schema: {
model: {
id: "ProductID",
hasChildren: false
}
}
}
}
}
});