11 Mar 2010 3:58 PM #1
[OPEN-718] Ext.Button.purgeListeners() doesn't clear handler config
I have just noticed that when using the handler config option on a Ext.Button, instead of registering the handler function to the click event of the button, it manages the handler configuration independently. This means that even when you are making a call to Ext.Button.purgeListeners(), the handler function is getting executed when the button is clicked.
I think this behavior should be normalized.
7 Apr 2010 9:43 AM #2
Will it be addressed?
Will it be adressed or it's not considered as an issue?
8 Apr 2010 12:12 AM #3
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
I don't really feel strongly either way about this one, I can see where it might make sense to do this. 99/100, people won't call purgeListeners without destroying the component anyway.Evan Trimboli
Twitter - @evantrimboli
Don't be afraid of the source code!
18 Apr 2010 6:54 AM #4
Well, letting it like that means that you must code for exceptions, which is a bad thing.
I don't see any points in favor of making the handler configuration completely independant from the whole events model but I can see at least one drawback: purgeListeners() is not really doing what it should, leaving behind one listener on the button. At least, it should be said in the documentation that the handler configuration is not getting cleared by the purgeListeners() method and that you need to manually delete the handler configuration to get rid of that listener.
Anyway, I don't think it would requires a lots of changes in Ext code...
5 Oct 2010 10:41 AM #5