How can we prevent expansion of a node when we click on the label adjacent to that node in YUI treeview? Though I have tried something given in this post. YUI Treeview (override labelClick) But it did not work for me.
what I have done is as follows.
tree.subscribe("labelClick", function(node) {
//some code here which I want to execute when user clicks on label.
YAHOO.util.Event.preventDefault(node.event);
return false /*In order to prevent the node from expanding.*/
});
what happens is when I click on label the node gets expanded and the event listener code also gets executed.So I do not want the node to expand.Just want the event listner code to execute.Please help.