如何检查Kendo treeView中的节点是否已扩展 [英] How do i check if the node is expanded in Kendo treeView
本文介绍了如何检查Kendo treeView中的节点是否已扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个剑道树视图.我想通过单击折叠节点(默认为双击).为此,我需要知道节点是否已经扩展,以便可以调用collapse(e.node).那么,如何检查节点是否已经扩展?
I have a Kendo treeView. I want to collapse the node on single click (the default is on double click). To do that I need to know if the node is expanded already so I can call collapse(e.node). So, how do I check if the node has been expanded already?
非常感谢
推荐答案
您可以使用 $(e.node).attr("data-expanded")==="true"
进行测试,或者 kendoTreeView._expanded(e.node)
,但是如果您的目标是根据当前状态折叠/展开,则只需调用
You can test with $(e.node).attr("data-expanded") === "true"
or kendoTreeView._expanded(e.node)
, however if your goal is to collapse/expand depending on the current state, you can simply call
kendoTreeView.toggle(e.node);
这篇关于如何检查Kendo treeView中的节点是否已扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文