View Full Version : Changing default msg on LoadMask

25 Aug 2011, 2:00 AM
I am trying to change the default msg of the loadMask. I tried

Ext.apply(Ext.LoadMask.prototype,{msg:"Wait a minute..."});

but it is not working...

25 Aug 2011, 2:58 AM
It belongs to where you want to use it:

when you use it for a grid you can set

loadMask: 'text to display'
in the grid config.

if you want to directly create it, then you can use

new Ext.LoadMask({Ext.Element}, {msg: 'text to display'});

Ext.LoadMask is the only class i know where you have to use new Ext.LoadMask instead of Ext.create('Ext.LoadMask); as you see here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.LoadMask-method-constructor

h (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.LoadMask-method-constructor)ope i could help

27 Aug 2011, 7:49 AM
@vasion, I just tried your code and it worked fine. Using Ext.apply() seems like a bit of a strange way to set a single property value though, why not just:

Ext.LoadMask.prototype.msg = 'Wait a minute...';

I agree with raz0r1 that this probably isn't a good idea though I can sympathize with why you might want to do it. A line almost identical to this appears in each of the locale files to translate the default message into other languages.

@raz0r1, you can use Ext.create() with a loadmask:

Ext.create('Ext.LoadMask', el, {msg: 'text to display'});