You got it from the middle Aaron. He was talking about moo 1.1. But thats it i think everything is clearer now for electrobender (cool nick).
Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Wed, Apr 15, 2009 at 3:30 AM, nutron <[email protected]> wrote: > There is no method Element.remove(). Only Element.dispose() (which removes > it from the DOM, but it can be injected again later; it still exists) and > Element.destroy() which removes it from memory entirely. The destroy method > obviously removes any events attached to it. > > On Tue, Apr 14, 2009 at 6:34 PM, Steve Onnis (via Nabble) < > ml-user%2b120788-510555...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2637225&i=0> > > wrote: > >> >> remove() only removes the element but the events stay in memory so before >> you call remove() call removeEvents() also on the element >> >> -----Original Message----- >> From: >> mootools-us...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=0> >> [mailto:mootools-us...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=1>] >> On Behalf Of electronbender >> Sent: Wednesday, 15 April 2009 1:21 AM >> To: MooTools Users >> Subject: [Moo] Re: Multiple events applied >> >> >> Ok, what i've done is do a removeEvents before setting the event, so >> that appears to work. >> >> On Apr 14, 4:52 pm, Thierry bela nanga >> <bna...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=2>> >> wrote: >> >> > I think remove does the same as dispose, >> > it remove the element from the DOM. >> > >> > 2009/4/14 Fábio Costa >> > <fabiomco...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=3>> >> >> > >> > >> > >> > > remove sould be equal to dispose. >> > > Isn't it? >> > >> > > Fábio Miranda Costa >> > > Engenheiro de Computação >> > >http://meiocodigo.com >> > >> > > On Tue, Apr 14, 2009 at 11:45 AM, electronbender < >> > > ognen.plavev...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=4>> >> wrote: >> > >> > >> No dispose in 1.11 :( >> > >> > >> On Apr 14, 4:44 pm, Fábio Costa >> > >> <fabiomco...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=5>> >> wrote: >> > >> > Don't know moo 1.1 :S >> > >> > But looks like a dispose, so maybe i've helped. >> > >> > >> > Fábio Miranda Costa >> > >> > Engenheiro de Computaçãohttp://meiocodigo.com >> > >> > >> > On Tue, Apr 14, 2009 at 11:42 AM, electronbender >> > >> > <ognen.plavev...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=6>>wrote: >> >> > >> > >> > > Using moo 1.11.. >> > >> > > I just checked and i do a .remove() on the parent div. >> > >> > >> > > On Apr 14, 4:16 pm, Fábio Costa >> > >> > > <fabiomco...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=7>> >> wrote: >> > >> > > > Are you destroying or disposing the element? >> > >> > > > There are 2 methods to remove elements from the DOM, destroy() >> and >> > >> > > > dispose(). >> > >> > > > destroy() removes the element from the DOM and really destroy >> it >> and >> > >> its >> > >> > > > references and, i think, everything related to it (events >> included). >> >> > >> > > > dispose() removes the element from the DOM, and that's it. >> > >> > >> > > > So... you might be using dispose. And that's correct as you are >> >> > >> removing >> > >> > > and >> > >> > > > adding it again to the DOM, it's more efficient. >> > >> > > > So just try not to re-add the event. If you still need to >> re-add, >> > >> remove >> > >> > > the >> > >> > > > old one first than add the new one. >> > >> > >> > > > Fábio Miranda Costa >> > >> > > > Engenheiro de Computaçãohttp://meiocodigo.com >> > >> > >> > > > On Tue, Apr 14, 2009 at 10:56 AM, electronbender >> > >> > > > <ognen.plavev...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2636365&i=8>>wrote: >> >> > >> > >> > > > > I create a dropdown, and add a change event to it. >> > >> > >> > > > > Then i destroy the element. >> > >> > >> > > > > After a while i recreate it (same id, same name), and add the >> >> same >> > >> > > > > change event to it. >> > >> > > > > However, when i actually fire the change event this time >> around, >> > >> it is >> > >> > > > > fired twice! >> > >> > >> > > > > So, every time i delete, re-create it, and add the new event, >> >> all >> > >> the >> > >> > > > > previous events apply, plus the new one. >> > >> > >> > > > > So, question 1: >> > >> > > > > - Why? This is a new element, even though it has the same >> name, >> > >> the >> > >> > > > > event should have died with the old element? >> > >> > >> > > > > Question 2: >> > >> > > > > - How do i prevent it? Is there a way to check if an event >> has >> > >> been >> > >> > > > > applied to an element? >> > >> > -- >> > fax : (+33) 08 26 51 94 51 >> > > The MooTools Tutorial: www.mootorial.com Clientcide: www.clientcide.com > > ------------------------------ > View this message in context: Re: [Moo] Re: Multiple events > applied<http://n2.nabble.com/-Moo--Multiple-events-applied-tp2633261p2637225.html> > Sent from the MooTools Users mailing list > archive<http://n2.nabble.com/MooTools-Users-f660466.html>at Nabble.com. >
