Hi, I have a doubt about the way that i can update a DOM Element of my index.html when the page is loaded. I''m kinda new in RoR and i only found the function link_to_remote that does what i want, but it creates an <a> tag in the html that makes that ajax call when i click, and this in not what i want. Can anyone help me? Sergio --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, In Scriptaculous controls.js I noticed a DelayedObserver, which is like Form.Element.Observer, but waits for delay after last key input. Ideal for live-search fields (that''s from comment). Obviously very interesting function, but I don''t find any example of how to use it. Is anyone using it already? I''d like to use it just for that: live search field, which posts contents with short delay after last key press. Best regards Janko --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I managed to make an example use of DelayedObserver and I''d like to share it with you: <input id="id1" type="text" name="field1" value=""/> <script type="text/javascript"> new Form.Element.DelayedObserver ("id1", 0.5, function () {new Ajax.Updater(''id2'', ''/url-for-me.html'', {method: ''post'', postBody: ''field1=''+$F (''id1''), evalScripts: true}); }); </script> <!-- element to update --> <div id="id2"> ... </div> I got and idea from a Benjamin David''s blog and I''d like to thank him for that: http://www.nyxen.net/archives/2006/10/28/spy-v2-exemple-ajax-avec-scriptaculous/ Best regards Janko Janko Mivek wrote:> Hi, > > In Scriptaculous controls.js I noticed a DelayedObserver, which is like > Form.Element.Observer, but waits for delay after last key input. Ideal > for live-search fields (that''s from comment). > > Obviously very interesting function, but I don''t find any example of how > to use it. Is anyone using it already? I''d like to use it just for that: > live search field, which posts contents with short delay after last key > press. > > Best regards > Janko >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
bentpieceoflight-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-29 02:40 UTC
Re: DelayedObserver usage
Very cool, but how would one use it with Form.Observer? It seems like this would have to involve overriding Form.serialize but Form.Methods is over my head. Anyone see an elegant way to do this? On 2/7/07, Janko Mivek <janko.mivsek-E3fUNmXwn2NDlGyqqv13OA@public.gmane.org> wrote:> > > I managed to make an example use of DelayedObserver and I''d like to > share it with you: > > > <input id="id1" type="text" name="field1" value=""/> > > <script type="text/javascript"> > new Form.Element.DelayedObserver ("id1", 0.5, > function () > {new Ajax.Updater(''id2'', ''/url-for-me.html'', > {method: ''post'', > postBody: ''field1=''+$F (''id1''), > evalScripts: true}); > }); > </script> > > <!-- element to update --> > <div id="id2"> > ... > </div> > > I got and idea from a Benjamin David''s blog and I''d like to thank him > for that: > > > http://www.nyxen.net/archives/2006/10/28/spy-v2-exemple-ajax-avec-scriptaculous/ > > Best regards > Janko > > Janko Mivek wrote: > > Hi, > > > > In Scriptaculous controls.js I noticed a DelayedObserver, which is like > > Form.Element.Observer, but waits for delay after last key input. Ideal > > for live-search fields (that''s from comment). > > > > Obviously very interesting function, but I don''t find any example of how > > to use it. Is anyone using it already? I''d like to use it just for that: > > live search field, which posts contents with short delay after last key > > press. > > > > Best regards > > Janko > > > > > >-- -=jack[turner-fBgUz5AM8P2sTnJN9+BGXg@public.gmane.org] --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---