【发布时间】:2016-03-25 05:45:09
【问题描述】:
我正在尝试使用此代码
How can i remove the expand arrow in kendo ui treeview if there are no child's to display
现在,它不是选定的答案,但它对我有部分作用
这是我基于 hasChildren 的答案
var inline = new kendo.data.HierarchicalDataSource({
data: @Html.Raw(dataSource),
schema: {
model: {
children: "Children",
hasChildren: function(e) {
var test = e.Children.length;
return test > 0;
}
}
}
});
我的代码如下所示:
children: "items",
//hasChildren: "Id" // Id I was using as that is a key
hasChildren: function(e) {
var test = e.items.length;
return test > 0;
}
- 数据负载看起来不错。全部折叠,我看到只有带有子节点的父节点有箭头图标。完美
-
问题,当我点击展开任何父节点时,我得到一个错误
Uncaught TypeError: Cannot read property 'length' of undefined
为什么会这样?
【问题讨论】:
标签: javascript kendo-ui treeview kendo-treeview