PDA

View Full Version : Updating loadMask message



fongg
28 Aug 2009, 12:14 PM
Any one know if there is a way to update the loadMask msg? I am loading a lot of data and would like to update the message once a while. Changing the myMask.msg does not update the message.

Thank.

ValterBorges
28 Aug 2009, 9:05 PM
The way i did it was to have a private var in my class called oLoadMask and then just keep calling new masks. Not sure this is the best way but it works for me.

in my private section of my UI class


var oLoadMask;


methods called loadMask,hideMask


loadMask: function(strMsg)
{
oLoadMask = new Ext.LoadMask(Ext.getBody(), {msg:strMsg});
oLoadMask.show();
}.
hideMask: function()
{
oLoadMask.hide();
}

then I just call my class method when i need it


UI.loadMask("Loading...")
....
UI.loadMask("Moving on to Task 1");
....
UI.loadMask("Almost done");
....
UI.hideMask();

Condor
29 Aug 2009, 1:37 AM
You creates a new LoadMask object for every new message!

You should use:

loadMask.hide();
loadMask.msg = 'New message';
loadMask.show();