Currently, I have a link_to_remote like this: <%= link_to_remote("Get Results", :update => ''query_results'', :with => "''tags='' + $F(''query_tags'')", :loading => "new Effect.Appear(''comment_loading'')", :complete => "Element.hide(''comment_loading'')", :url => { :action => :get_results }) Can I have more than one callback for :loading and :complete? That is, using this syntax, can I make more than one element appear and hide when get_results is executing? If so, how might I edit this code? Thanks! Terry -- Terry (TAD) Donaghe http://www.tadspot.com http://www.rubynoob.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/4ba3556b/attachment.html
Hi Terry. Have you tried separating javascript statements in the loading and complete parameters with semicolons? e.g. :loading => "new Effect.Appear(''comment_loading''); new Effect.Appear (''another_element'')" Cheers, Dan. On 4/25/06, Terry Donaghe <terry.donaghe@gmail.com> wrote:> > Currently, I have a link_to_remote like this: > > <%= link_to_remote("Get Results", > :update => ''query_results'', > :with => "''tags='' + $F(''query_tags'')", > :loading => "new Effect.Appear(''comment_loading'')", > :complete => "Element.hide(''comment_loading'')", > :url => { :action => :get_results }) > > Can I have more than one callback for :loading and :complete? That is, > using this syntax, can I make more than one element appear and hide when > get_results is executing? If so, how might I edit this code? > > Thanks! > > Terry > > -- > Terry (TAD) Donaghe > http://www.tadspot.com > http://www.rubynoob.com > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org<https://mail.google.com/mail?view=cm&tf=0&to=Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/d742ac2c/attachment.html
Yup - thanks Dan! I figured that out on my own about 10 minutes after sending the email. Felt like a noob for asking, but for someone who doesn''t know much javascript it wasn''t blindingly obvious. Thanks again! On 4/25/06, Dan V. <dan.v@ieee.org> wrote:> > Hi Terry. > > Have you tried separating javascript statements in the loading and > complete parameters with semicolons? > > e.g. :loading => "new Effect.Appear(''comment_loading''); new Effect.Appear(''another_element'')" > > > > Cheers, > > Dan. > > On 4/25/06, Terry Donaghe <terry.donaghe@gmail.com> wrote: > > > Currently, I have a link_to_remote like this: > > <%= link_to_remote("Get Results", > :update => ''query_results'', > :with => "''tags='' + $F(''query_tags'')", > :loading => "new Effect.Appear(''comment_loading'')", > :complete => "Element.hide(''comment_loading'')", > :url => { :action => :get_results }) > > Can I have more than one callback for :loading and :complete? That is, > using this syntax, can I make more than one element appear and hide when > get_results is executing? If so, how might I edit this code? > > Thanks! > > Terry > > -- > Terry (TAD) Donaghe > http://www.tadspot.com > http://www.rubynoob.com > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org<https://mail.google.com/mail?view=cm&tf=0&to=Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Terry (TAD) Donaghe http://www.tadspot.com http://www.rubynoob.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060426/22c98335/attachment-0001.html