JuHwon
JuHwon

Reputation: 2063

Ext JS 4.2.1 Layout run failed

I just want to create a layout where i've defined my custom application header.. and them some content beneath.. e.g. a border layout...

Ext.define('app.view.Main', {
    extend: 'Ext.container.Container',
    requires:[
        'Ext.tab.Panel',
        'Ext.layout.container.Border',
        'Ext.layout.container.Anchor',
        'Ext.form.field.Text'
    ],

    xtype: 'app-main',

    layout: { type: 'anchor' },

    items: [
        { xtype: 'app-header' },
        {
            //xtype: 'container',
            layout: 'border',
            items: [{
                region: 'west',
                xtype: 'panel',
                title: 'west',
                width: 150
            }, {
                region: 'center',
                xtype: 'tabpanel',
                items: [{ ...

this code is always returning the error Layout run failed... When i change the layout of my second item which should be a border it works.. Somehow it doesnt get along with the border layout...

Can someone tell me why? A hint for a solution would be nice too :) I am an ext js layout newb :(

Upvotes: 1

Views: 3658

Answers (1)

Evan Trimboli
Evan Trimboli

Reputation: 30082

To create a header with a top header:

new Ext.container.Viewport({
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items: [{
        xtype: 'app-header'
    }, {
        flex: 1,
        layout: 'border',
        xtype: 'container',
        items: [] // border stuff
    }]
});

Upvotes: 4

Related Questions