Forum: Ruby on Rails Question about Callbacks in link_to_remote

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A73f446eaaf56db0aeaa578aa373989b?d=identicon&s=25 Terry Donaghe (Guest)
on 2006-04-25 21:30
(Received via mailing list)
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
93d451b5350bcbe0dabbd8bd5323689b?d=identicon&s=25 Dan V. (Guest)
on 2006-04-25 22:35
(Received via mailing list)
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.
A73f446eaaf56db0aeaa578aa373989b?d=identicon&s=25 Terry Donaghe (Guest)
on 2006-04-26 21:48
(Received via mailing list)
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!
This topic is locked and can not be replied to.