PDA

View Full Version : General EventManager question



Eric24
24 Dec 2010, 3:55 PM
After using Ext.EventManager.on() to add a listener, is it necessary to call Ext.EventManager.un() to remove it, or does EventManager automatically "clean up" after itself? If not, why is there no Ext.EventManager.mon() function?

aramaki
24 Dec 2010, 4:35 PM
I`m not sure, but I guess listener not clean up automatically

Condor
24 Dec 2010, 11:30 PM
EventManager does clean up on window unload, but you should still write proper cleanup code if the event is part of a component (in case only the component needs to be destroyed).

Also have a look at Ext.Component.mon()

mitchellsimoens
26 Dec 2010, 8:01 AM
I have never tried it but in the options object that you can specify (not required), you can set 'single: true' and it says it will remove itself. Look at the addListener function (which is the same as the on function).