title: JsonRest get values to feed grid header dynamicaly
body: <p>I am using a dojo grid which I need to populate with a JsonRest.</p>
  
  <p>This is the code:</p>
  
  <pre><code>require 
      (
          [ 'dojo/_base/lang', 'dojox/grid/DataGrid', 'dojo/data/ObjectStore', 'dojo/store/JsonRest', 'dojo/dom', 'dojo/domReady!' ],
          function ( lang, DataGrid, ObjectStore, JsonRest, dom )
          {
  
              jsonr = new JsonRest
              (
                  { target: 'carrierSlideListStrategiesByGroupOrCarrierAction.do?output=&lt;%=Constants.OUTPUT_JSON%&gt;' }
  
              );
  
              var layout =
              [
                  [
                      { 'name': 'strategyname', 'field': 'strategyid', 'width': '23%', 'cellStyles': 'white-space: nowrap;', 'headerStyles': 'white-space: normal; word-wrap: normal; text-align: center;' }              
                  ]
              ];
  
              grid00 = new DataGrid 
              (
                  {
                      store: store00 = new ObjectStore ( { objectStore: jsonr } ),
                      structure: layout,
                      rowSelector: '20px'
                  }
              );
  
              grid00.placeAt ( 'grid00' );
              grid00.startup ();
              dojo.connect 
              (
                  grid00, 
                  "_onFetchComplete",
                  function ()
                  {
                      $ ( '#msg_home' ).empty ();
                      $ ( '#msg_home' ).html ( '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;bean:message key="bodycarrierslidebygrouporcarrier.query.businessnumbers.done00"/&gt;' + '&lt;b&gt;' + grid00.rowCount + '&lt;/b&gt;' + '&lt;bean:message key="bodycarrierslidebygrouporcarrier.query.done01"/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;' );
                  }
              );
          }
      );
  </code></pre>
  
  <p>The data collection I am getting is the following :</p>
  
  <pre><code>[{"strategyid":"1","strategyname":"AR","strategycompliantflag":"GROUP_STRATEGY_NA"},
  {"strategyid":"0","strategyname":"Facilities","strategycompliantflag":"GROUP_STRATEGY_NA"},
  {"strategyid":"1","strategyname":"Panel","strategycompliantflag":"GROUP_STRATEGY_NA"},
  {"strategyid":"0","strategyname":"Agreem.","strategycompliantflag":"GROUP_STRATEGY_NA"}
  </code></pre>
  
  <p>--etc</p>
  
  <p>My objective, which I don't seem to know how to achieve, is to put in the grid´s header the value of the field strategyname and in the row the value of the field strategyid, instead I am getting in the header only one column like this:</p>
  
  <pre><code>-------------
  strategyname
  -------------
  1  
  0  
  1  
  </code></pre>
  
  <p>and I would like to have </p>
  
  <pre><code>------ ------------- -------   ----
  AR      Facilities     Panel    Agreem
  ------  ------------ --------  --------
  1         0             1       0
  </code></pre>
  
  <p>To do that I thought that I could query the JsonRest in a loop through the data collection to form the structure that I need and pass it to the grid.<br>
  Could someone help me please? </p>