That did the trick - thanks for help :-)
|---------+-------------------------------------------->
| | "Jerod Venema" |
| | <[EMAIL PROTECTED]> |
| | Sent by: |
| | [EMAIL PROTECTED]|
| | onrails.org |
| | |
| | |
| | 08/09/2006 06:15 PM |
| | Please respond to rails-spinoffs |
| | |
|---------+-------------------------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [email protected]
|
| cc: (bcc: Tyler L. Adamson/UPC)
|
| Subject: Re: [Rails-spinoffs] newbie question
|
>------------------------------------------------------------------------------------------------------------------------------|
Check the Responders class...
http://www.sergiopereira.com/articles/prototype.js.html#Ajax.Responders
You can register your callback function to hide the div there.
-Jerod
On 8/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I'm new to the forum and I have what I assume will be a basic question
for
> a lot of you...
>
> I am using Ajax.Updater to make async calls to my service. I am calling
> the same function three times so I can populate three different divs. My
> issue is I would like to have a loading indicator that shows when I start
> and doesn't hide until the last call is complete. Below is my function:
>
> As you can see, I have a call to checkAllCalls() which is my attempt to
> hide the indicator only after everything is loaded. It works but only
> ocassionally.
>
> Just curisous if someone has a better approach. I just want to show one
> indicator for all three calls that disappears when all the data is
loaded.
>
>
> function executeCall(day, inDiv, inURL, inParams, inSync) {
> reqDay = day;
>
> var opt = {
> method: 'get',
> postBody: inParams,
> on404: function(t) {
> alert('Error 404: location "' + t.statusText + '"
> was not found.');
> },
> onFailure: function(t) {
> ErrorHandler(t);
> },
> asynchronous: inSync
> }
> new Ajax.Updater(inDiv + 'Container', inURL, opt);
>
> setTimeout('checkAllCalls()', 1000);
> }
>
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs