PDA

View Full Version : Customizable "Loading" module.



Animal
23 Oct 2006, 11:10 PM
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
24 Oct 2006, 9:44 AM
Turn off the showLoadIndicator and instead subscribe to the beforeUpdate and onUpdate to show/hide your global indicator.

Animal
24 Oct 2006, 11:14 PM
That would work on an instance of an Element, but I want to override globally. I guess I can override UpdateManager.processSuccess.

jack.slocum
25 Oct 2006, 7:36 AM
Whoops wrong post.

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