Hi List, I missed some day ago a useful function, to remove any event listener just by event type, without knowing the id or the reference to the event him self. May be useful for others:
/**
* TODOC
*
* @param target {void} any widget
* @param eventType {string} any event type; e.g. 'execute'
* @return {void}
*/
removeListenerByType : function(target, eventType)
{
var listenerIds =
qx.event.Registration.getManager(target).getListeners(target, eventType);
if (listenerIds == null) {
return;
}
for (var i=0; i<listenerIds.length; i++)
{
var listenerHandler = listenerIds[i].handler;
var context = listenerIds[i].context;
qx.event.Registration.getManager(target).removeListener(target,
eventType, listenerHandler, context);
}
}
SAKsystems
Inh. Mustafa Sak
Varrelmannstr. 16
30453 Hannover
Tel. +49 511 / 165 969 40
Fax +49 511 / 165 969 49
Mobil +49 163 / 312 6144
http://www.saksys.de
[email protected]
STEUER-Nr. 2613817458
-----Ursprüngliche Nachricht-----
Von: benco [mailto:[email protected]]
Gesendet: Montag, 4. Juli 2011 18:36
An: [email protected]
Betreff: Re: [qooxdoo-devel] removeListener vs removeListenerById
Hi Christian,
Many thanks... I think I misunderstood how to declare the removal and how it
works internally :-)
Best,
Benoît.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/removeListener-vs-removeListenerById-tp6546
722p6546761.html
Sent from the qooxdoo mailing list archive at Nabble.com.
----------------------------------------------------------------------------
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
<<attachment: Mustafa Sak ([email protected]).vcf>>
------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
