I am using Dojo StackContainer to get it to display a couple of widgets correctly.
Here is my HTML (as described by the Dojo documentation)
<div id="scontainer-prog"></div>
In my JS file, I have the following code:
require([
"dijit/layout/StackContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(StackContainer, ContentPane){
var sc = new StackContainer({
style: "height: 300px; width: 400px;",
id: "myProgStackContainer"
}, "scontainer-prog");
var cp1 = new ContentPane({
title: "page 1",
content: "page 1 content"
});
sc.addChild(cp1);
var cp2 = new ContentPane({
title: "page 2",
content: "page 2 content"
});
sc.addChild(cp2);
sc.startup();
});
However, the page looks like the following:
Any idea on what I am doing wrong? This example is similar to what is provided on the Dojo StackContainer documentation page.

You missed to add
dijit/layout/StackController, that generates the buttons which switches between content panes :What you have to do is :
import
dijit/layout/StackControllerCreate a div for the StackController:
<div id="stackContolerDiv" ></div>You can see live example as bellow Snippet :