Results 1 to 2 of 2

Thread: proportionately resizing window

  1. #1
    Sencha User
    Join Date
    Nov 2008
    Posts
    61

    Default proportionately resizing window

    Is there a way to make a window resize proportionately?
    Maybe in a similar manner to Ext.Resizable, preserveRatio: true
    Many thanks.
    SWK

  2. #2

    Default

    You should use the hbox or vbox layouts on your top component. Then the components that you want to have re size proportionately should have a flex value. So if you have two components and you want one to take up 2 thirds and the other to take up 1 third. Set componentA's flex to 2 and componentB's flex to 1. Then component A will always take up two thirds of the screen. If you want them half and half, set them both to one. In the example below, I have a grid and form that are both the same size and re-size proportionately (1 to 1)when the window size changes.

    Code:
    this.items = [
                {
                    xtype: 'container',
                    layout: 'hbox',
                    height: 150,
                    items: [
                        {
                            flex: 1,
                            height: 150,
                            xtype: 'myForm'
                        },
                        {
                            flex: 1,
                            height: 150,
                            xtype: 'myGrid'
                        }
                    ]
                },


Posting Permissions

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