Il Neofita a écrit :
If do you have time can you explain to me a little bit more, since I do
not know nothing regarding Draggable and Sortable, I will appreciate
your help.
Actually, in your specific case (which, I gather, only involved
auto-completion), there are only two event handlers being created when
you do:
new Ajax.Autocompleter(...);
- one on blur
- one on keypress
They both tackle your input field.
When you replace the DOM fragment that contains your input field (do you
really need to?!), those events never get fired again, because what the
user types in is another field, a new one, created by your
fragment-replacing code (e.g. the processing of a Ajax.Updater, or a
call of yours to Element.replace or Element.update).
It's not too bad that you didn't remove those two event observers;
they're not going to be triggered, and the garbage collector will handle
them properly.
However, what you need, at the minimum, is to follow DOM replacement by
an identical call to "new Ajax.Autocompleter(...)", to recreate the
functionality for your new DOM elements.
Still, the question remains: why on Earth do you replace your
auto-completed field (and its completion zone)? Can't you do otherwise?
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---