title: How to programmatically create a dijit.Dialog with a dojox.grid.DataGrid
body: <p>I have the following problem:</p>
  
  <p>Programmatically creating a dijit.Dialog and a dojox.grid.DataGrid (linked to a global Variable Data Store (dojo.store.Memory) ) the content of the Dialog is not shown while the Dialog size remains at a minimum.</p>
  
  <p>The DataGrids Store is filled correctly and Firebug shows the Grid inside the Dialog.</p>
  
  <pre class="lang-javascript prettyprint-override"><code>data = new dojo.data.ObjectStore(
    { objectStore: new dojo.store.Memory({data:[]}) });
  
  data.put({id:0,name:'Franklin'});
  
  showDialog = function(){
    var dlg = dijit.byId('myDlg');
    if(dlg){
      dlg.show();
    }
    else{
      var cp = new dijit.layout.ContentPane({style:"width:500;height:500;"});
      var grid = new dojox.grid.DataGrid({
        store : data,
        structure : [
          {field:'id',name:'ID',width:'50px'},
          {field:'name',name:'Name',width:'400px'}]
      },cp);
  
      dlg = new dijit.Dialog({
        id:'myDlg',
        title:'Names',
        content:cp.domNode
      });
  
      grid.startup();
      dlg.show();
    }
  );
  </code></pre>
  
  <p>Maybe I added something in the wrong order?</p>
  
  <p>Also I do not know if my way of combining/appending dojo widgets
  using the domNode property is the correct way of doing things.</p>
  
  <p>I do not know if the ContentPane I am using is necessary to place
  the Grid inside the Dialog. Both variants did not work so far.</p>
  
  <p>Finally I am unsure if and where the Dialog needs static measurements
  to size correctly. In my experience the Dialog itself does not need static
  width or height, but I have no experience so far with adding a dynamic component
  like the Grid - which might change its size later at startup - to a Dialog.</p>