【问题标题】:ExtJs 4.2 layout: border gives me layout run failsExtJs 4.2 布局:边框让我布局运行失败
【发布时间】:2013-10-02 02:16:08
【问题描述】:

我有一个 html 页面并呈现一个带有 layout: 'border' 的面板。 我使用 renderBody 配置将它渲染到一个 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'
});

我该怎么办?

【问题讨论】:

  • 你能为你的例子提供一个 jsfiddle 链接吗?这可能有助于我们弄清楚您的问题到底是什么。

标签: javascript layout extjs extjs4.2


【解决方案1】:

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

【讨论】:

  • 谢谢,但我想自动使我的 pabel 适应容器的宽度和高度
  • 查看 Ext.layout.container.Border 的文档:docs.sencha.com/extjs/4.2.1/#!/api/Ext.layout.container.Border 您必须使用固定宽度、百分比宽度或弹性配置以及北/南配置东/西高度也一样。否则,您将继续收到您提到的错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-20
  • 1970-01-01
  • 1970-01-01
  • 2012-02-24
  • 1970-01-01
  • 2011-07-30
  • 1970-01-01
相关资源
最近更新 更多