我使用Dojo Toolkit在BorderContainer中有 2 个contentPanes。很像以下内容:
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainerB" style="height: 200px">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'top'" style="width: 100px;">Hi, I'm leading pane<br><br>Lots of stuff goes here.</div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'center'">Hi, I'm center pane</div>
</div>
我想使用 JavaScript 以编程方式更改拆分器的位置。在一种情况下,我想将它一直移到一边,这样只有一个 contentPane 是可见的。我该怎么做才能改变分离器的位置?
已经尝试过:
var datasetArea = document.getElementById("studiesDatasetArea");
datasetArea.style.height = newHeight + "px";
这不起作用,以及:
dojo.widget.byId('studiesDatasetArea').resizeTo(400, newHeight);
它改变了borderContainer的大小,而不仅仅是移动分割器的位置。我不想改变外边框容器的大小。