使用 + 使 YUI TreeView 仅展开/折叠/ - 图标

发布于 2024-08-10 13:42:54 字数 222 浏览 1 评论 0原文

我遇到的问题是,当用户单击节点时展开/折叠节点的默认 YUI TreeView 行为妨碍了我正在实现的某些自定义 UI 功能。我已经能够通过订阅“clickEvent”并返回 false 在某种程度上减少这种情况;但是,在我编辑节点的标题(通过双击)后,问题仍然存在。该节点以默认方式突出显示和/或展开/折叠。我尝试了“focusChanged”和编辑事件的几种组合,但没有成功。

非常感谢!

肖恩

The problem I am having is that the default YUI TreeView behavior of expanding/collapsing nodes when a user clicks on them is getting in the way of some custom UI functionality I am implementing. I have been able to reduce this to some degree by subscribing to the "clickEvent" and returning false; however the problem still presents itself after I edit the title of a node (by double-clicking). The node is highlighted and/or expanded/collapsed in the default fashion. I've tried a few combinations of "focusChanged" and editing events without success.

Thank you very much!

Sean

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

傻比既视感 2024-08-17 13:42:54

您可能想使用用于实现 YAHOO.widget.Tasknode 的技巧。你只需监听树的 clickEvent ,然后让监听器返回 false ,就像这样

//...
this.treeView.subscribe("clickEvent", this.tree_onClickEvent, this, true);
//...
tree_onClickEvent: function(p_oEvent, p_args)
{
   return false;

},
//...

You may want to use the trick used to implement the YAHOO.widget.Tasknode. You just listen to the clickEvent of the tree, and make the listener return false, something like this

//...
this.treeView.subscribe("clickEvent", this.tree_onClickEvent, this, true);
//...
tree_onClickEvent: function(p_oEvent, p_args)
{
   return false;

},
//...
淡淡绿茶香 2024-08-17 13:42:54

我对你最终想要实现的目标有点困惑,但我会开始阅读这里

I am a bit confused by what you ultimately want to achieve but I would start reading here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文