View Full Version : Maximizing form that have constrain set to false

Dejan Beciric
13 Apr 2014, 9:26 AM
I have a border layout viewport.

In viewport I have a toolbar which is region north and a panel which has region parameter set to center and layout absolute.

In the panel I have a window which is maximizable. When I set constrain to true to that window, and maximize it, everything works OK, but when I set constrain to true I have two problems:

1. how to set constrain only to south, east and west - for I don't want user to move form over the toolbar
2. when I click on maximize button, I want form to be maximized as it is when constrain is set to false. Again, I don't want window to be positioned over the toolbar.

Here is described example:

T (https://fiddle.sencha.com/#fiddle/131)hanks for answering.

13 Apr 2014, 4:06 PM
I am not sure I understand your requirement, as you mention regions S, E, W .. but you only have North and Center setup in your fiddle.
If you set constraint to center in you fiddle it will not bleed into north.

Can you provide more info?

Dejan Beciric
13 Apr 2014, 10:15 PM
Thanks for reply, here is in detail:

I have this code:

Ext.create("Ext.container.Viewport", {
layout: "border",

items: [{
width: 100,
height: 100,
region: "north",
xtype: 'toolbar',
items: []
region: "center",
xtype: 'panel',
layout: 'absolute',
items : [ {
xtype: 'window',
maximizable: true,
width: 150,
height: 100,
title: 'Hello',
constrain: false,
autoShow: true

It looks like this:


When I click on maximize, it looks like this:


I want maximizing to look like :


When I change code and set constrain : true I will get result that I want, but I need it to stay false for user can move the form outside the panel.

Second problem is that when constrain is false, user can move form outside the panel (which is ok), but I want to forbid moving it over the toolbar. So i don't want this situation:


For this problem I have the solution - handling move and manually adjust the position of the form if it was moved over the toolbar. Is there any better solution that that ?

For maximizing problem I've described, I didn't find any workaronds or solutions.