PDA

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



ShatyUT
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.

lleslie84
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


i.e:

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


.changeMyZindex{z-index:100}


i having tested the code but i think it should work

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

a.getDialog().setPosition(100,100);

lleslie84
23 Feb 2010, 6:20 PM
no prob.