Ext JS Message Box Position

I have a very long screen, and apparently when I use a message with an Ext JS 3.3.1 message, it goes all the way down and deletes everything in the background.

This is a sample code:

Ext.Msg.show({ title:'[SOME TITLE]', msg: '[SOME MESSAGE]', buttons: Ext.Msg.YESNO, fn: function (btn){ if(btn=='yes'){ //Do something } } }, icon: Ext.Msg.QUESTION} ); 
+6
extjs
source share
2 answers

try it

  Ext.MessageBox.show({ msg: 'Saving your data, please wait...', progressText: 'Saving...', width:300, wait:true, waitConfig: {interval:200}, icon:'ext-mb-download', //custom class in msg-box.html animEl: 'mb7' }); 
+2
source share

So, you want to set only the Y-position of your MessageBox? Do it:

 var msg=Ext.Msg.show({ title:'[SOME TITLE]', msg: '[SOME MESSAGE]', buttons: Ext.Msg.YESNO, fn: function (btn){ if(btn=='yes'){ //Do something } } }); msg.getDialog().getPositionEl().setTop(50); //this is enough for Y position only 

Using setPosition, do the following:

 msg.getDialog().setPosition(undefined,50) 

In this example, I used 50 pixels because it is close to the top. You can install it on something else on top.

+4
source share

All Articles