jmakeig
11 Jan 2007, 9:10 AM
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
fireEvent : function(){
this.node.fireEvent.apply(this.node, arguments);
}
When I changed the above to
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
fireEvent : function(){
this.node.fireEvent.apply(this.node, arguments);
}
When I changed the above to
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