【发布时间】:2016-08-16 15:26:55
【问题描述】:
我想填充 Kendo TreeView,其中 2 个节点是本地数据源,最后一个节点应该是远程数据源
这是我的代码:
$("#AftermarketTreeView").kendoTreeView({
dataTextField: ["text", "text", "MC_ANALYSIS_NAME"],
dataSource: {
data: [
{
text: "Initiate",
items: [
{ text: "Parts Selection", haschildren: false },
{ text: "Assumptions", haschildren: false },
{ text: "Team", haschildren: false },
]
},
{
text: "Analyze",
items: [
{ text: "Part Attributes", haschildren: false },
{ text: "Aftermarket Evaluation", haschildren: false }
]
},
{
text: "Monto Carlo",
items: [
{ text: "Monto Carlo", haschildren: true }
]
}
],
schema: {
model: {
hasChildren: "items",
children: {
schema: {
data: "items",
model: {
hasChildren: "haschildren",
children: {
schema: {
// override the schema.data setting from the parent
data: function (response) {
return response;
}
},
transport: {
read: {
url: ResolveUrl("/CreateMaintainAnalysis/GetMontoCarloData/"),
dataType: "jsonp",
data:onDataSendAnalysisID,
}
},
}
}
}
}
}
}
}
});
使用上面的代码,我得到如下结构 其中 Initiate 和 Analyze 是本地数据源,Monto Carlo 是远程数据源,但我不希望节点再次成为其下的 Monto Carlo,它应该是来自数据库的直接远程数据源
提前致谢!!!
【问题讨论】:
标签: javascript kendo-ui kendo-treeview