I'm trying to create a tree with a static root node that has all children populated from an ASP.NET WebMethod.
I saw a similar example when I searched the forums, but I can't get it to work at all. Below is the code I'm testing with. Any help is appreciated. Thanks!
I saw a similar example when I searched the forums, but I can't get it to work at all. Below is the code I'm testing with. Any help is appreciated. Thanks!
ds =
new
kendo.data.HierarchicalDataSource({
data: [
{ FolderName: '
Documents'
, hasChildren:
true
, expanded:
true
}
],
schema: {
data:
'd'
,
model: {
id:
'FolderID'
,
hasChildren:
'HasChildren'
,
children: {
transport: {
read: {
url:
'Home.aspx/GetTreeNodes'
,
type: '
POST'
,
contentType:
'application/json; charset=utf-8'
,
},
parameterMap:
function
(data, operation) {
return
JSON.stringify({ RootFolder: '
Documents'
})
}
}
}
}
}
});