PDA

View Full Version : Applying config options to Ext.MessageBox.show ?



drunkmoose
18 Nov 2010, 8:07 AM
Hi!

I'm trying to apply config. options to these, but failing.

I've tried:



Ext.apply(Ext.MessageBox.prototype, {

animEl: Ext.getBody()

});

Ext.apply(Ext.MessageBox.show.prototype, {

animEl: Ext.getBody()

});

Ext.apply(Ext.Msg.show.prototype, {

animEl: Ext.getBody()

});

Ext.apply(Ext.Msg.prototype, {

animEl: Ext.getBody()

});

Ext.Msg.animEl = Ext.getBody();


None of this work. Any ideas ?

Thx! :)

plalx
18 Nov 2010, 9:13 AM
Yes, you can create an interceptor to do this. The following code will wrap the show function in another function that will make sure that animEl is the body, if no animEl config was passed.


Ext.MessageBox.show = Ext.MessageBox.show.createInterceptor(function(config) {
Ext.applyIf(config, { animEl: Ext.getBody() });
});

drunkmoose
18 Nov 2010, 11:05 AM
That does work, but the messagebox appears in the lower right corner ... ?

If I pass the animEl: Ext.getBody() each time I use it, it'll display alright though. Thanks alot anyways.