Results 1 to 3 of 3

Thread: Maximizing form that have constrain set to false

  1. #1
    Sencha Premium Member Dejan Beciric's Avatar
    Join Date
    Feb 2014
    Location
    Belgrade, Serbia
    Posts
    49
    Answers
    2

    Default Maximizing form that have constrain set to false

    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:
    https://fiddle.sencha.com/#fiddle/131

    T
    hanks for answering.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    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?

  3. #3
    Sencha Premium Member Dejan Beciric's Avatar
    Join Date
    Feb 2014
    Location
    Belgrade, Serbia
    Posts
    49
    Answers
    2

    Default

    Thanks for reply, here is in detail:

    I have this code:

    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:

    Attachment 48673

    When I click on maximize, it looks like this:


    Attachment 48674

    I want maximizing to look like :

    Attachment 48675

    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:

    Attachment 48676

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •