我想在kendotreeview中添加另一个节点,但与其他两个静态/硬编码不同,这将是动态的。 这是代码:
var inlineDefault = new kendo.data.HierarchicalDataSource({
data: [{
text: "Furniture",
items: [{
text: "Tables & Chairs"
}, {
text: "Sofas"
}, {
text: "Occasional Furniture"
}]
}, {
text: "Decor",
items: [{
text: "Bed Linen"
}, {
text: "Curtains & Blinds"
}, {
text: "Carpets"
}]
}]
});
var treeview = $("#treeview-left").data("kendoTreeView");
treeview.add(new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: ResolveUrl("/Analysis/GetData/"),
dataType: "jsonp",
}
},
}));
$("#treeview-left").kendoTreeView({
dataSource: inlineDefault
});
我如何处理这个问题?