Results 1 to 2 of 2

Thread: hbox vbox layout issue

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
      0  

    Default hbox vbox layout issue

    Hi guys,

    Im trying to build something like this. There is a window inside that a tab panel and on the first tab, I have a border layout. The center region has a few charts and the south region has some data view. Here the vbox containers don't show up unless I give a width to the vboxes. Below is the code

    Code:
    var win = new Ext.Window({
        title: 'Window',
        width: 1024,
        height: 600,
        layout: 'fit',
        items:[{
            xtype: 'tabpanel',
            deferRender: false,
            activeTab: 0,
            items: [{
                title: 'First tab',
                layout: 'border',
                items:[{
                    xtype: 'container',
                    region: 'center',
                    layout: 'hbox',
                    layoutConfig: {
                        align: 'stretch',
                        pack: 'center'
                    },
                    items: [{
                        xtype: 'container',
                        layout: 'vbox',
                        flex: 1,
                        layoutConfig: {
                            align: 'stretch',
                            padding: '5'
                        },
                        items: [{
                            xtype: 'linechart'
                        },{
                            xtype: 'label',
                            height: 10,
                            text: 'Chart 1'
                        }]
                    },{
                        xtype: 'container',
                        layout: 'vbox',
                        flex: 1,
                        layoutConfig: {
                            align: 'stretch',
                            padding: '5'
                        },
                        items: [{
                            xtype: 'linechart'
                        },{
                            xtype: 'label',
                            height: 10,
                            text: 'Chart 2'
                        }]
                    }]
                },{
                    xtype: 'container',
                    region: 'south',
                    height: 225,
                    layout: 'border',
                    items: [{
                        //some things that work fine
                    }]
                }]
            }, {
                title: 'Some other tab'
            }]
        }]
    });
    Any help would be appreciated

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1270
      0  

    Default

    vbox and hbox do no support auto sizing so you either have to give them fixed height/width or use the flex configs.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •