Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ext JS Message Box Position

Tags:

extjs

I have a very 'long' screen and apparently when I am using the Ext JS 3.3.1 messagebox, it goes all the way to the bottom and removed everything in the background.

This is some example 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}
);
like image 270
user510210 Avatar asked Dec 22 '10 21:12

user510210


1 Answers

So you want to set only the Y position of your MessageBox? Do this:

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 this:

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

I used 50 pixels in this example because that's near the top. You can set it to something else from the top.

like image 140
Christiaan Westerbeek Avatar answered Sep 24 '22 11:09

Christiaan Westerbeek