Making YUI TreeView only expand/collapse using the + / - icons
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 subs开发者_如何转开发cribing 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
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;
},
//...
I am a bit confused by what you ultimately want to achieve but I would start reading here.
精彩评论