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
?
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;"';
精彩评论