Thanks kangax, that's what I had to know ! So right now, I don't see any solution to my issue but to add the behaviors explicitly to all inputs I create.
On Jul 10, 2:05 am, kangax <[EMAIL PROTECTED]> wrote: > Object.extend does nothing but adds properties to an object : ) > Element.addMethods, on the other hand, allows you to "inject" set of > methods into element "definitions" (of certain type). > These "injected" methods then become available on elements implicitly > (in some browsers like FF, Safari, etc.) or explicitly (e.g. in IE, > where an element needs to be first extended). > Prototype doesn't have any predefined way of intercepting element > creation (or "initialization" as you call it) as well as insertion or > modification. > You need to "initialize inputs" manually - attach event handlers, > change style, etc. > > It's possible that later versions of prototype will fire custom events > before/after some methods' calls (e.g. "element:updated", > "element:inserted", "element:removed"). > > Best, > kangax > > On Jul 9, 6:03 pm, onitsuka <[EMAIL PROTECTED]> wrote: > > > ok i'll try to re-explain it : > > > I would like to extend the class "INPUT" to add specific behaviors for > > all INPUTs already in the loaded document or which will be added later > > dynamically to the document. > > I want to add custom behaviors at INPUTs initialization, INPUTs focus > > and INPUTs blur (out of focus). > > > So I imagined there was a way to do this once for all thanks to > > prototype Object.extend(...) > > > On Jul 9, 11:30 pm, kangax <[EMAIL PROTECTED]> wrote: > > > > I still don't understand what the problem is... > > > > -- kangax > > > > On Jul 9, 2:59 pm, onitsuka <[EMAIL PROTECTED]> wrote: > > > > > Thanks, that's interesting, but still not what i'm looking for. > > > > > On Jul 9, 8:12 pm, jdalton <[EMAIL PROTECTED]> wrote: > > > > > > Ahh now I remember where I saw event deligation for blur and focus > > > > > (works in IE too) > > > > > :)http://ajaxian.com/archives/event-delegation-for-blur-and-focushttp:/... > > > > > > Here is a test I did of this for Prototype back in April > > > > > 08:http://pastie.org/pastes/186221(usesonfocusinandonfocusout) > > > > > > - JDD --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---