remove all events from a component?

Hello,

How can I remove all events from any component?

var myEvent = $$(“botonAceptar”).attachEvent(“onItemClick”, function (){ … })
always returns myEvent = true, but not an object.

If I need to attach 2 events, I only will detach one of them, becouse I invoke in any case detachEvent(true),that only remove one of them, and even if I invoke detach twice, always one of them is never detached…

thank you

javi.

pd.- (I´m using 2011 November 14 touchui_debug.js version)
viewtopic.php?f=4&t=20429&p=86805#p86805
Alexandra said
(Mon Sep 19, 2011 11:10)
“You may use detachAllEvents method: toolbar.detachAllEvents();”
(Tue Sep 20, 2011 11:40 am )
“This method is not public. Public methods are attachEvent and detachEvent which removes a certain event:
var ev = toolbar.attachEvent(“onClick”,handler);
toolbar.detachEvent(ev);”

but:
TypeError: $$(“botonAceptar”).detachAllEvents is not a function

Hello Javi,

Try to use the latest Touch library. attachEvent returns an event id that can be passed in detachEvent method:

var myEvent = $$(“botonAceptar”).attachEvent(“onItemClick”, function (){ … });
$$(“botonAceptar”).detachEvent(myEvent);

detachAllEvents() is not supported and we do not have plans to add this method in Touch library.

Alexandra said “You may use detachAllEvents method: toolbar.detachAllEvents();”

I posted the answer in the forum about desktop Toolbar. Touch library is discussed only in “DHTMLX Touch” forum.