我想在TabContainer
的顶部区域内放置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
的内容具有可变高度,因此我不想手动设置高度。
答案 0 :(得分:1)
设置TabContainer div的高度css属性,例如像:
<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region: 'top'" style="height: 100px;">
...
</div>
答案 1 :(得分: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();
}