x1c 0d1x我试图通过编程的方式将dijit/layout/ content窗格添加到dijit/title窗格中。我遇到的问题是我无法将content窗格放入title窗格中,它被放置在title窗格下面。我的代码如下:知道我哪里做错了吗
谢谢
皮特
[![require(\[
"dijit/TitlePane",
"dijit/layout/ContentPane",
"dojo/dom",
"dojo/domReady!"
\], function (TitlePane, ContentPane, dom) {
//create the title pane to hold the layer list
var tp = new TitlePane({ title: "Layers", id: "tp" });
dom.byId("viewDiv").appendChild(tp.domNode);
tp.startup();
var cp = new ContentPane({ id: "cp", content: "Test" });
cp.placeAt("tp");
cp.startup();
dom.byId("tp").appendChild(cp.domNode);
});][1]][1]
1条答案
按热度按时间hec6srdp1#
TitlePane作为属性内容,您需要使用它来设置contentpane
实施例1:
实施例2: