PDA

View Full Version : Unable to set message box position



chot2
29 Dec 2011, 6:11 AM
Hello ppl,

I m pretty much new to EXTJS . I have a button which displays alert in center . But when i scroll down to the bottom of the page a click the button this is not happening as expected alert box is getting displayed in bottom of the page and not at the center . I thought of two ways to fix this issue ,

1) Make a fixed position for the alert box
2) When i scroll down and click the button set the window position so that alert comes in the middle .

When I searched the forums I found few examples http://www.sencha.com/forum/showthread.php?92735-How-can-I-set-the-position-of-a-MessageBox-window

http://www.sencha.com/forum/showthread.php?72161-x-and-ypos-of-an-ext.Messagebox

http://www.sencha.com/forum/archive/index.php/t-12182.html

All of them have used getDialaog() method . When tried using it I am getting the following error in the console . "getDialog is not a function" . Have i missed something here to get that function ? Can someone please help me .
3035230352

mitchellsimoens
29 Dec 2011, 9:32 AM
Ext.Msg is an instance of Ext.window.MessageBox. Ext.window.MessageBox is an extension of Ext.window.Window. So if you want to move the Ext.Msg, you can use the setPosition method

chot2
30 Dec 2011, 7:19 AM
Thanks mitchellsimoens ,

You mean to say it in this way ?

var mbox = Ext.Msg.alert('Alert','this is ffom alert .');
mbox.setPosition(100,100);