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

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

问题描述

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

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对象的配置字段称为

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天全站免登陆