1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    24
    Vote Rating
    1
    rvelasquez is on a distinguished road

      0  

    Default Simple Layout not Working

    Simple Layout not Working


    Hi,

    I'm trying to nest an hbox inside a vbox. Seems fairly straightforward but I can't get the layout to display the two pieces of text. I can see the titlebar though.

    Code:
    Ext.define("senchatest.view.Main", {
        extend: 'Ext.Container',
        xtype: 'mainview',
        
        config: {
            layout: {
                type: 'vbox',
            },
            items: [
                {
                    xtype: 'titlebar',
                    title: 'Title',
                    docked: 'top'
                },
                {
                    xtype: 'container',
                    config: {
                        layout: {
                            type: 'hbox'
                        },
                        items: [
                            {
                                html: '<p>Content 1</p>'
                            },
                            {
                                html: '<p>Content 2</p>'
                            }
                        ]
                    }
                }
            ]
        }
    });

  2. #2
    Sencha User wilzdezign's Avatar
    Join Date
    Jul 2011
    Location
    WA
    Posts
    65
    Vote Rating
    0
    wilzdezign is on a distinguished road

      0  

    Default


    I do not think you need the nested config, as that is used as part of the initial Ext.define()
    Does this work:
    Code:
    Ext.define("senchatest.view.Main", {
        extend: 'Ext.Container',
        xtype: 'mainview',
        
        config: {
            layout: {
                type: 'vbox',
            },
            items: [
                {
                    xtype: 'titlebar',
                    title: 'Title',
                    docked: 'top'
                },
                {
                    xtype: 'container',
                    layout:  'hbox',
                    items: [
                            {
                                html: '<p>Content 1</p>'
                            },
                            {
                                html: '<p>Content 2</p>'
                            }
                     ]
                }
            ]
        }
    });

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    24
    Vote Rating
    1
    rvelasquez is on a distinguished road

      0  

    Default


    Thanks that worked great! No I know to not use the config attribute for objects not created with Ext.define.

Thread Participants: 1