0

我想将 aTabContainer放在 a 的顶部区域内,BorderContainer如下所示:

<div id="appLayout" data-dojo-type="dijit/layout/BorderContainer">
    <div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region: 'top'">
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 1'">tab 1</div>
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 2'">tab 2</div>
    </div>
    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'">center</div>
</div>​

当我尝试这个时,它TabContainer是不可见的。TabContainer当我将 放置在 的中心区域时,一切正常BorderContainer

<div id="appLayout" data-dojo-type="dijit/layout/BorderContainer">
    <div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region: 'center'">
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 1'">tab 1</div>
        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="title:'Tab 2'">tab 2</div>
    </div>
    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'">bottom</div>
</div>​

为什么TabContainer顶部区域不可见?我可以让它可见吗?

编辑: 的内容TabContainer具有可变高度,所以我不想手动设置高度。

4

2 回答 2

1

设置 TabContainer div 的高度 css 属性,例如:

<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region: 'top'" style="height: 100px;">
    ...
</div>
于 2012-12-03T20:27:17.047 回答
1

尝试调整根 BorderContainer 的大小。

它看起来像一些黑客,但它适用于我:

<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-attach-point="rootContainerWidget">
   <!-- content panes, tab containers etc -->
</div>

并在小部件代码中添加公共调整大小方法:

resize: function () {
    // resize hack
    this.rootContainerWidget.resize();
}
于 2014-04-07T14:58:27.240 回答