I was trying to intercept the click event on a TreeNode using the beforeclick event in TreeNodeUI. I need to check some conditions and cancel the node click in certain cases (such as if the user will be abandoning unsaved work). However, as it is currently implemented, TreeNodeUI's fireEvent method swallows the event handler's return
Code:
fireEvent : function(){
this.node.fireEvent.apply(this.node, arguments);
}
When I changed the above to
Code:
fireEvent : function(){
return this.node.fireEvent.apply(this.node, arguments);
}
everything seems hunky dunky.
On a related note, why doesn't TreeNodeUI extend Observable? If it did, it would get this functionality for free.
Keep up the amazing work.
Justin