I am trying to get a loader to display during ajax requests, but the "onCreate" is not getting triggered. The onComplete does.


function loadComponent(section){
values = arguments[1]
pars = $H(values).toQueryString()
pars = "section="+section+"&"+pars
var url = '';
var ComponentLoader = new Ajax.Updater('maincontent', url, {
asynchronous:true,
onCreate: function() { loadingRequest('mc_loader', 'maincontent'); },
onComplete: function() { completedRequest('mc_loader', 'maincontent'); },
method: 'post',
parameters: pars,
evalScripts: true });
}

function loadingRequest(loader, target)
{
   alert("request started");
   new Effect.Appear($(loader), {duration: 0.5});
   $(target).style.display = "none";
}

function completedRequest(loader, target)
{
   alert("request Done");
  new Effect.Fade($(loader), {duration: 0.5});
   new Effect.BlindDown($(target));
}

Can any one see what I am doing wrong?

______________________________________________________________________

Alex Duffield . Principal . InControl Solutions . http://www.incontrolsolutions.com 




_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to