View Full Version : How can I set the position of a MessageBox window?

23 Feb 2010, 7:22 AM
I am trying to figure out how to position a MessageBox window. My page has a document viewer applet and the messagebox windows are showing up behind it.

I saw this thread in the 2.0 help forum but it doesn't have a solution: http://www.extjs.com/forum/showthread.php?t=59185

I would like to reposition the messagebox preferably but would settle for changing the z-index or using a regular Window but I can't really make a Window look just like a MessageBox.

Does anyone have any ideas? I don't see how I can use msgObj.getEl().setXY(...). I don't see a getEl() method on MessageBox in the API but tried anyway and it failed.

23 Feb 2010, 2:35 PM
you can use getDialog (http://www.extjs.com/forum/../deploy/dev/docs/source/MessageBox.html#method-Ext.MessageBox-getDialog)() to get the window control then add a style class to the object


var a= new Ext.Msg.alert('something here', 'something here');


i having tested the code but i think it should work

23 Feb 2010, 4:24 PM
Thanks for the response! Not sure how I missed getDialog() but that's what I needed. That gets me the underlying Window as you pointed out which allows me to call setPosition() to move the MessageBox:


23 Feb 2010, 6:20 PM
no prob.