.. _dijit/layout/StackContainer: dijit.layout.StackContainer =========================== :Status: Draft :Version: 1.0 :Available: since 1.0 .. contents:: :depth: 2 A container that has multiple children, but shows only one child at a time (like looking at the pages in a book one by one). ============ Introduction ============ This container is good for wizards, slide shows, and long lists or text blocks. ===== Usage ===== .. code-block :: javascript :linenos: parameters: ========== =============== =========== parameter type description ========== =============== =========== params object Optional. srcNodeRef DomNode|String ========== =============== =========== Set the current pane -------------------- StackContainer's current pane can be set via the selectChild() method, or it can be controlled from a StackController. StackController is a controller not in the MVC send of the word, but like a TV remote control... it's sets which page the StackController is tuned to. Retrieving the currently selected Container ------------------------------------------- To retrieve the currently selected container use following attribute .. code-block :: javascript :linenos: var selectedContainer = yourContainer.selectedChildWidget *yourContainer* has to be a reference (for example: dijit.byId("myStackContainer")) to the ContainerWidget, meaning the StackContainer or any widgets inheriting from StackContainer Set the size of the pane ------------------------ doLayout="false" sets the size of the StackContainer to the size of his child panes. Published topics ---------------- StackContainer publishes topics * [widgetId]-**addChild**, * [widgetId]-**removeChild**, and * [widgetId]-**selectChild**. ======== Examples ======== Programmatic example -------------------- Here's an example of a progamatically created StackContainer, and associated StackController: .. cv-compound:: .. cv:: javascript The html is very simple .. cv:: html
Declarative example ------------------- Here you will see a declaratively created StackContainer .. cv-compound:: .. cv:: javascript .. cv:: html