View Full Version : Popup window going outside of main window on resize.

4 May 2014, 10:49 PM


Above are two window where popup is opening correctly when window is maximized.. But when window is resized popup is moving out of window... What might be the issue??

5 May 2014, 1:04 AM
Without some code posted its hard to help you.
First thoughts - the popup window are you using the constrainTo config?

See http://docs-origin.sencha.com/extjs/4.2.2/#!/example/window/window.html

L (http://docs-origin.sencha.com/extjs/4.2.2/#!/example/window/window.html)ook at the constrained window example

7 May 2014, 12:48 AM
I have tried with constrainTo config.. However my actual problem is, suppose popup window width is 400 and window size is resized to less then 400 then Popup wont display..
Below is code for popup..

Ext.define('CorrGen.view.AttachmentDescriptionView', {
extend: 'Ext.window.Window',
alias : 'widget.attachmentDescriptionView',

title : 'Additional Description1(50 characters max)',
layout: 'fit',
autoShow: true,
id: 'rejectReasonWindow',
border: 0,
height: 90,
width: 400,
resizable: false,
modal: true,
closable: false,
constrainTo: true,

initComponent: function() {

var required = '<span style="color:red;font-weight:bold" data-qtip="Required"> * </span>';
this.items = [
xtype: 'form',
items: [
xtype : 'textfield',
grow : true,
width: 380,
name: 'attachmentDesc',
id: 'attachmentDesc',
flex: 1,
padding: '2, 2, 2, 5'

this.buttons = [

text: 'Cancel',
scope: this,
handler: this.close,
icon : Farmers.commons.ImageURLs.ICON_REDX
xtype: 'tbfill'
text: 'OK',
action: 'addDesc',
icon : Farmers.commons.ImageURLs.ACCEPT_IMG


7 May 2014, 1:17 AM
Have a look at the x and y config - by default window should center on the container its rendered to.
Check what you are rendering the window to - probably by default the view port with a show.
Try rendering it to the container

15 May 2014, 9:43 PM
Could not get much on it.. can you please elaborate on the same???

16 May 2014, 5:05 AM
The correct option is constrain:true, not constrainTo.