PDA

View Full Version : Add a wait gif to a tab label



dmayer
20 Nov 2006, 12:06 PM
Jack,

Can I add a wait icon to a tab label without modifying the yui-ext source code?

I want to load remote data into different tabs using yui layouts and I want to show which tabs are still working.

Thanks,

Denis

tryanDLS
20 Nov 2006, 1:42 PM
You would have to override the UpdateManager.showLoading method to do something other than what it does know.

After you include all the js files, add your override via prototype, e.g.

YAHOO.ext.UpdateManager.prototype.showLoading = function() {
... your code...
}

You might have to consider how intelligent you want this code to be, as it applies to the loading indicator of all elements. Rather than overriding at this level, you might instead only add your new functionality to the actual tabs you're adding. This is all theory - I haven't tried this :)

<mock>
var mytab1 = myTabPanel.AddTab(blah, blah)
mytab1.showLoading = myshowLoading;

....
myShowLoading = function() {alert('loading');}

</mock>