AnsweredAssumed Answered

How to assign content from variable to contentPane programmatically

Question asked by amreecihuy on Mar 6, 2015
Latest reply on Mar 6, 2015 by kenbuja

Hi All,  I'm newbie in dojo. I have created TabContainer programmatically based on dojotoolkit tutorial.

here is the code

require(["dijit/layout/TabContainer", "dijit/layout/ContentPane","dojo/dom", "dojo/domReady!"],
    function(TabContainer, ContentPane,dom){
    var tc = new TabContainer({
        style: "height: 100%; width: 100%;"
    }, "layerPanel");

    var layerlistMenu = new ContentPane({
         title: "Layer",
         content: "this is layer list"

    var legendMenu = new ContentPane({
         title: "Legend",
         content: "this is legend"


here is the actual result, the content is harcoded.



I have legend variable in another script like this :

var legend = new Legend ({
                        map: map
                    }, "legendDiv");


I want to assign the legend content to legend tab.

here is my expectation :



I did it using declarative method, could anyone please advice me how to assign legend content using programmatically method ?

thank you