返回的 JSON/XML:
<ArrayOfNode xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DGA.Take2.WebUI.Controllers">
<Node>
<notificationType>NZY (1)</notificationType>
<notifications xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>notification1</d3p1:string>
<d3p1:string>notification2</d3p1:string>
<d3p1:string>notification3</d3p1:string>
</notifications>
</Node>
</ArrayOfNode>
我正在尝试将此树加载到 Kendo UI TreeView 中:
var notificationTypes = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "X"
}
},
schema: {
model: {
notificationType: "notificationType",
notifications: "notifications",
hasChildren: true,
string: "string"
}
}
});
$("#treeview").kendoTreeView({
dataSource: notificationTypes,
checkboxes: {
checkChildren: true
},
dataTextField: ["notificationType", "notifications", "string"]
});
这是问题所在: