开发者

When using YUI TaskNode, when clicking on labels, my listener on labelClick isn't called?

开发者 https://www.devze.com 2023-03-10 12:19 出处:网络
How come when using a YUI tree using TaskNode (illustrated below) my listener on labelClick isn\'t called, while it is called if I create the same tree with TextNode?

How come when using a YUI tree using TaskNode (illustrated below) my listener on labelClick isn't called, while it is called if I create the same tree with TextNode?

开发者_运维知识库

When using YUI TaskNode, when clicking on labels, my listener on labelClick isn't called?


This is most likely something that used to work. The YUI code in TaskNode.js calls TextNode.onLabelClick() which does just a return false. This will work if you modify TaskNode.js and instead of calling node.labelClick(node), call tree.fireEvent('labelClick', node). Specifically, replace:

sb[sb.length] = ' onclick="return ' + getNode + '.onLabelClick(' + getNode +')"';

With:

sb[sb.length] = ' onclick="' + getNode + '.tree.fireEvent(\'labelClick\',' + getNode +'); return false;"';
0

精彩评论

暂无评论...
验证码 换一张
取 消