下面是我的代码段,当我使用dojo StackContainer时,一旦触发Stack container.startup,除了内容窗格的标题之外,所有内容都会被隐藏。请让我知道我要去哪里了:

        var linkOamTp = new TitlePane({
            id:"linkOamTp",
            preventCache : false,
            open :true
        });
        registry.byId(containerWdg).addChild(linkOamTp);

        domConstruct.create("div",{id:"linkOamStackControllerDiv"},linkOamTp.containerNode);
        domConstruct.create("div",{id:"linkOamStackContainerDiv"},linkOamTp.containerNode);
        var linkOamSc = new StackContainer({
            style: "width: 100% !important; height: 98% !important",
            id: "linkOamStackContainer"
        },"linkOamStackContainerDiv");

        var cp1 = new ContentPane({
            title: "A-END",
            style : " width:100%; height: 100%; ",
            content : "content a"
        });
        linkOamSc.addChild(cp1);

        var cp2 = new ContentPane({
            title: "Z-END",
            style : " width:100%; height:100%; ",
            content : "content-b"
            });
        linkOamSc.addChild(cp2);

        var controller = new StackController({containerId: linkOamSc.id},"linkOamStackControllerDiv");
        linkOamSc.startup();
        controller.startup();

最佳答案

您确定'linkOamSc.id'实际上返回了“ linkOamStackContainer”吗?

通常,StackController与StackContainer结合使用(已完成),并且StackController使用StackContainer的ID。

尝试将代码更改为

var controller = new StackController({containerId: "linkOamStackContainer"},"linkOamStackControllerDiv");

10-08 02:06