title: Dojo DataGrid not populating Data in Custom widget
body: <p>I am trying to generate Data Grid from custom widget in Dojo 1.6, but only HTML corresponding to DataGrid is getting generated and no data is populated into Grid.</p>
  
  <p>Here is custom widget code :-</p>
  
  <pre><code> dojo.require("dojox.grid.DataGrid"); 
   dojo.require("dojo.parser");
  
   dojo.require("dijit._Widget"); 
   dojo.require("dijit._Templated");
  
   dojo.declare("FormGenerator", [dijit._Widget, dijit._Templated],   {
  
      widgetsInTemplate: true,
  
      templateString: dojo.cache("widget", "templates/dummyHTML.html"),
  
      postCreate : function(){
          this.inherited(arguments);
  
            layout =
                  [
                      { name: 'Name', field: 'name', width: '100px' },
                      { name: 'Color', field: 'color', width: '100px' }
                  ];
           dataStore = {
                      data :
                      {items :[
                      { name : 'John Doe', color: 'green' },
                      { name : 'Jane Doe', color: 'red' }
                      ],
                      label:'name',
                      identifier:'color'
                      }
                  };
            var grid = new dojox.grid.DataGrid
              (
                  {
                  store: new dojo.data.ItemFileReadStore(window.dataStore),
                  autoRender : true,
                  structure: window.layout
                  },
                  "dummy" // this id should be there in HTML .
              );
  
            grid.startup();
  
      },
  
  });
  </code></pre>
  
  <p>Here is the dummyHTML.html template :-</p>
  
  <pre><code> &lt;div&gt;
   &lt;div id="dummy"&gt;&lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>This HTML is generated by above code :-</p>
  
  <pre><code>    &lt;div id="formRequirement" widgetid="formRequirement"&gt;
      &lt;div align="left" dojoattachevent="onmouseout:_mouseOut" role="grid" hidefocus="hidefocus" tabindex="0" aria-multiselectable="true" class="dojoxGrid" id="dummy" widgetid="dummy" aria-readonly="true" style="height: 0px; -moz-user-select: none;"&gt;
          &lt;div role="presentation" dojoattachpoint="viewsHeaderNode" class="dojoxGridMasterHeader" style="display: none; height: 0px;"&gt;&lt;div role="presentation" dojoattachpoint="headerNode" class="dojoxGridHeader" style="width: 1270px; left: 1px; top: 0pt;"&gt;
              &lt;div role="presentation" style="width: 9000em;" dojoattachpoint="headerNodeContainer"&gt;
                  &lt;div role="row" dojoattachpoint="headerContentNode"&gt;
                                &lt;table cellspacing="0" cellpadding="0" border="0" role="presentation" class="dojoxGridRowTable"&gt;
                               &lt;tbody&gt;&lt;tr&gt;
                                   &lt;th dndtype="gridColumn_dummy" style="width: 100px;" idx="0" class="dojoxGridCell dojoDndItem " id="dummyHdr0" role="columnheader" aria-readonly="true" tabindex="-1"&gt;
                                 &lt;div class="dojoxGridSortNode"&gt;Name&lt;/div&gt;
                                   &lt;/th&gt;
                                   &lt;th dndtype="gridColumn_dummy" style="width: 100px;" idx="1" class="dojoxGridCell dojoDndItem " id="dummyHdr1" role="columnheader" aria-readonly="true" tabindex="-1"&gt;&lt;div class="dojoxGridSortNode"&gt;Color&lt;/div&gt;&lt;/th&gt;
                              &lt;/tr&gt;
                    &lt;/tbody&gt;
                 &lt;/table&gt;
                &lt;/div&gt;
          &lt;/div&gt;
          &lt;/div&gt;&lt;/div&gt;
          &lt;div role="presentation" dojoattachpoint="viewsNode" class="dojoxGridMasterView"&gt;&lt;div role="presentation" class="dojoxGridView" id="dojox_grid__View_1" widgetid="dojox_grid__View_1" style="width: 1270px; height: 0px; left: 1px; top: 0px;"&gt;
  
          &lt;input type="checkbox" role="presentation" dojoattachpoint="hiddenFocusNode" class="dojoxGridHiddenFocus"&gt;
          &lt;input type="checkbox" role="presentation" class="dojoxGridHiddenFocus"&gt;
          &lt;div role="presentation" dojoattachpoint="scrollboxNode" class="dojoxGridScrollbox" style="height: 0px;"&gt;
              &lt;div role="presentation" hidefocus="hidefocus" dojoattachpoint="contentNode" class="dojoxGridContent" style="height: 64px; width: 1255px;"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;&lt;/div&gt;
          &lt;div dojoattachpoint="messagesNode" style="display: none;" class="dojoxGridMasterMessages"&gt;&lt;/div&gt;
          &lt;span tabindex="0" dojoattachpoint="lastFocusNode"&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>You can see that above code is not populating any data. You can also see that I have made layout and dataStore as Global variables but no success. Even I have tried putting DataGrid into Template file(dummyHTML.html) itself and initializing DataGrid by Markup but it was also not working.</p>
  
  <p>Please tell me if I am missing anything.</p>
  
  <p>Thanks</p>