<ArrayOfNode xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://....Controllers">
<Node>
<notificationType>Test1 (20)</notificationType>
<notifications xmlns:d3p1="http://...Serialization/Arrays">
<d3p1:string>3298</d3p1:string>
<d3p1:string>983932</d3p1:string>
... (20 items here)
</Node>
<Node>
<notificationType>Test2 (40)</notificationType>
<notifications xmlns:d3p1="http://...Serialization/Arrays">
<d3p1:string>ABCD</d3p1:string>
<d3p1:string>AZYX</d3p1:string>
...(40 items here)
</Node>
</ArrayOfNode>
这不起作用:
var notificationTypes = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "http://..."
}
},
schema: {
model: {
notificationType: "notificationType",
notifications: "notifications",
children: "notifications",
string: "string",
hasChildren: true
}
}
});
$("#treeview").kendoTreeView({
dataSource: notificationTypes,
checkboxes: {
checkChildren: true
},
dataTextField: ["notificationType", "notifications"]
});
它只加载父节点,但我想让每个节点的“通知”成为树的子项。
它应该如下所示:
- 测试1 (20)
-- 3298
-- 983932
- 测试2 (40)
- A B C D
-- 983932