ExtJs 4.2 布局:边框给我布局运行失败

ExtJs 4.2 layout: border gives me layout run fails

本文关键字:布局 运行 失败 ExtJs 边框      更新时间:2023-09-26

我有一个html页面,并渲染了一个面板,上面有布局:"边框"。我用渲染体配置将其渲染为div。当我运行页面时,出现此错误:布局运行失败。

这是我的 ExtJs 代码

Ext.create('Ext.panel.Panel', {
    //width: 500,  // I want to fit this panel to parent element
                 //that i render this panel to it
    //height: 300, //
    title: 'Border Layout',
    layout: 'border',
    items: [{
        title: 'South Region',
        region: 'south',
        xtype: 'panel',
        height: 100
    },{
        // xtype: 'panel' implied by default
        title: 'West Region is collapsible',
        region:'west',
        xtype: 'panel',
        width: 200,
        id: 'west-region-container',
        layout: 'fit'
    },{
        title: 'Center Region',
        region: 'center',
        xtype: 'panel',
        layout: 'fit'
    }],
    renderTo: 'div-Id'
});

我该怎么办?

给你一个主面板的高度...这将解决问题。有关示例,请参见此处:https://fiddle.sencha.com/#fiddle/ma