1

我只想创建一个布局,在其中定义了我的自定义应用程序标题..以及它们下面的一些内容..例如边框布局...

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: [{ ...

此代码总是返回错误布局运行失败...当我更改应该是边框的第二个项目的布局时,它可以工作..不知何故它与边框布局不符...

有人能告诉我为什么吗?一个解决方案的提示也很好:)我是一个 ext js layout newb :(

4

1 回答 1

4

要创建带有顶部标题的标题:

new Ext.container.Viewport({
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items: [{
        xtype: 'app-header'
    }, {
        flex: 1,
        layout: 'border',
        xtype: 'container',
        items: [] // border stuff
    }]
});
于 2013-06-17T12:59:57.190 回答