-
11 Jan 2007 9:10 AM #1
TreeNodeUI beforeclick event cancelation not working
TreeNodeUI beforeclick event cancelation not working
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
When I changed the above toCode:fireEvent : function(){ this.node.fireEvent.apply(this.node, arguments); }
everything seems hunky dunky.Code:fireEvent : function(){ return this.node.fireEvent.apply(this.node, arguments); }
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
-
12 Jan 2007 5:48 AM #2
Thanks, that indeed is a bug.
You could extend TreeNodeUI to add Observable type functionality if you wanted to. It doesn't currently to keep the API clean. You can listen on a node, or on the tree. Adding in a 3rd listening spot seems like extra complexity IMO but I could be wrong.
Similar Threads
-
how to stop click event when having dblclick event
By seldon in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 8 Nov 2011, 12:31 AM -
ComboBox not working with IE6
By liotrox in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 8 Mar 2007, 5:11 AM -
autoSizeColumns not working!!
By n01champion in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 20 Feb 2007, 11:34 PM -
Tree 'selectionchange' event is not working
By liotrox in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 5 Jan 2007, 9:20 AM -
YUI-EXT BorderLayout not working in IE
By saasira in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 20 Dec 2006, 9:12 PM


Reply With Quote