1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    85
    Vote Rating
    0
    kohyea is on a distinguished road

      0  

    Default Card Layout does not display in HBox Layout

    Card Layout does not display in HBox Layout


    Code:
    Ext.define('MyApp.view.tablet.Main', {
        extend: 'Ext.Container',
        requires: [
            'Ext.TitleBar', 'Ext.SegmentedButton'
        ],
        config: {
            fullscreen: true,
            layout: 'hbox',
            items: [{
                xtype: 'panel',
                flex: 1,
                cls: 'ui-side-bar',
                items: [{
                    docked: 'top',
                    xtype: 'titlebar',
                    title: 'Browse'
                }, {
                    xtype: 'toolbar',
                    ui: 'neutral',
                    docked: 'top',
                    scrollable: {
                        direction: 'horizontal',
                        indicators: false
                    },
                    items: [{
                        xtype: 'spacer'
                    }, {
                        xtype: 'segmentedbutton',
                        allowDepress: true,
                        items: [{
                            text: 'Folder',
                            pressed: true
                        },{
                            text: 'Name'
                        }]                    
                    }, {
                        xtype: 'spacer'
                    }]
                },{
                    layout: 'card',
                    items: [{
                        html: 'First Item'
                    }, {
                        html: 'Second Item'
                    }]
                }]
            },{
                xtype: 'panel',
                flex: 2,
                items: [{
                    docked: 'top',
                    xtype: 'titlebar',
                    title: 'Content'                
                }]
            }]
        }
    });

    Hi all,

    I put a Card layout in HBox layout, but the card layout does not display, anyone call tell me how to fix this?

    Thanks,
    Kohyea

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,643
    Vote Rating
    816
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to give it a height or it's parent needs to give it a height via some layout.

    The reason that container (assuming the one with First Item and Second Item) is not showing is because card layout makes the children have 100% height and width but if it doesn't have a size then it can't give it's children a size can it?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

Thread Participants: 1