PDA

View Full Version : Customizable "Loading" module.


Animal
10-24-2006, 03:10 AM
Right now, the Element's UpdateManager writes content into the Element being updated which is then wiped when the content comes through.

Can we have a pluggable way to put our own indicators in?

I know we can override YAHOO.ext.UpdateManager.prototype.showLoading

But the clearing of the indicator is left to the update() function dumping the new content in.

What I'd like is my own global indicator. I could have an animation in a tab somewhere else on the page (The MenuBar say), and I'd need a hook into the update comipletion to stop the animation, or clear the indicator.

Perhaps update should look like this:


YAHOO.ext.Element.prototype.update = function(html, loadScripts)
{
this.dom.innerHTML = html +
"<script type='text/javascript'>YAHOO.ext.UpdateManager.prototype.clearLoading.call(new YAHOO.ext.UpdateManager(" + this.dom.id + "));</script>";

jack.slocum
10-24-2006, 01:44 PM
Turn off the showLoadIndicator and instead subscribe to the beforeUpdate and onUpdate to show/hide your global indicator.

Animal
10-25-2006, 03:14 AM
That would work on an instance of an Element, but I want to override globally. I guess I can override UpdateManager.processSuccess.

jack.slocum
10-25-2006, 11:36 AM
Whoops wrong post.

Let me look at this. I don't see why it can't be added.