有人可以帮助我吗?我想实现放置在 BorderContainer 内的 ContentPane 的自动调整大小。这是一个简单的测试用例:http: //jsfiddle.net/3dft2/1/ 在这种情况下,我在 ContentPane 中有 TitlePane(但一般来说,它可能是里面的任何内容)。当我单击 TitlePane (它打开 => 内容高度更改)时,我想相应地自动调整 ContentPane 的大小。即我想移动分离器。如何归档这个?如果更改了此大小,如何查看内容大小(无论是哪种内容)并自动调整 ContentPane 的大小?
测试用例:
dojo.require("dijit.TitlePane");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
dojo.ready(function() {
// create a BorderContainer as the top widget in the hierarchy
var bc = new dijit.layout.BorderContainer({
style: "height: 300px; width: 500px;"
});
var TitlePane = new dijit.TitlePane({
title: 'title pane',
open: false,
content: "Collapse me!"
});
// create a ContentPane as the left pane in the BorderContainer
var cp1 = new dijit.layout.ContentPane({
region: "top",
style: "width: 100px",
content: TitlePane,
splitter: "true"
});
bc.addChild(cp1);
// create a ContentPane as the center pane in the BorderContainer
var cp2 = new dijit.layout.ContentPane({
region: "center",
content: "how are you?"
});
bc.addChild(cp2);
// put the top level widget into the document, and then call startup()
bc.placeAt(document.body);
bc.startup();
});