如果没有要显示的孩子,我如何删除 kendo ui 树视图中的展开箭头 [英] How can i remove the expand arrow in kendo ui treeview if there are no child's to display

查看:16
本文介绍了如果没有要显示的孩子,我如何删除 kendo ui 树视图中的展开箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 kendo ui 树视图.我正在从数据库动态加载树视图.但我的问题是,如果没有要显示的孩子,我会收到扩展错误.如何移除展开箭头.

I am using kendo ui treeview. I am loading the treeview dynamically from the database. But my issue is i am getting the expand error if there are no child's to display. How can i remove the expand arrow.

问候,

斯里兰卡

推荐答案

HierarchicalDataSource schema.model 对象有一个配置字段叫做hasChildren 你可以在你的模型中添加一个布尔属性来指示你的模型是否有项目.

There is a configuration field of the HierarchicalDataSource schema.model object called hasChildren you can add a boolean property to your model which indicates if the your model has items.

这样,当 TreeView 创建其元素时,它将检查该属性(或调用该函数 - 例如,如果 items.leght 大于零,您可以返回),如果返回的值为 false,则不会创建扩展箭头在项目前面.

This way when the TreeView creates its elements it will check that property (or call the function - you could for example return if the items.leght is greater than zero) and if the returned value is false it wont create the expand arrow in front of the item.

查看这个演示.

这篇关于如果没有要显示的孩子,我如何删除 kendo ui 树视图中的展开箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆