Hi,
Based on your beta demo here: http://demos.kendoui.com/beta/web/treeview/odata-binding.html
I have put together the following:
var Folders = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: function(opt) {
if(opt.UID == undefined) opt.UID = 0;
return kendo.format("/api/GetFolders/{0}",opt.UID)
},
type: "GET",
dataType: "json"
}
},
schema: {
model: {
hasChildren: function() {
return true;
},
id: "UID",
children: Folders
}
}
});
$("#testTree").kendoTreeView({
dataSource: Folders,
dataTextField: ["Title"]
});
As you can see I am using a fairly ugly hack for the initial UID setting. But it works with my data.
Since there is no documentation yet (that I can see) can you advise if there is a better way of doing this? In particular I'd like to have more than one TreeView on screen (sharing a single data source if possible) and be able to specify at runtime where each TreeView should 'start'.
Thank,
Mark.
Based on your beta demo here: http://demos.kendoui.com/beta/web/treeview/odata-binding.html
I have put together the following:
var Folders = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: function(opt) {
if(opt.UID == undefined) opt.UID = 0;
return kendo.format("/api/GetFolders/{0}",opt.UID)
},
type: "GET",
dataType: "json"
}
},
schema: {
model: {
hasChildren: function() {
return true;
},
id: "UID",
children: Folders
}
}
});
$("#testTree").kendoTreeView({
dataSource: Folders,
dataTextField: ["Title"]
});
As you can see I am using a fairly ugly hack for the initial UID setting. But it works with my data.
Since there is no documentation yet (that I can see) can you advise if there is a better way of doing this? In particular I'd like to have more than one TreeView on screen (sharing a single data source if possible) and be able to specify at runtime where each TreeView should 'start'.
Thank,
Mark.