title: Loading encoded JSON into Dojo Grid
body: <p>I am programming in php,
  I want to take an <code>array</code> I have (which is extracted from mysql result set), convert it to <code>JSON</code> and then use it in <code>dojox.grid.DataGrid</code>.</p>
  
  <p>I got an idea from <a href="http://mail.dojotoolkit.org/pipermail/dojo-interest/2011-June/056055.html" rel="nofollow">this link:</a></p>
  
  <p>I used the following on the <code>array</code> (in a file called <code>getJSON.php</code>)</p>
  
  <pre><code>echo $ajax = "{identifier: 'db_id', 'items':".json_encode($array)."}";
  </code></pre>
  
  <p>Then I try doing this (in my main page):</p>
  
  <pre><code>var store = new dojo.data.ItemFileWriteStore({ url: 'getJSON.php' });
  </code></pre>
  
  <p>Everything else is exactly as the Dojo documentation specifies.
  The grid shows up, but doesn't load the data and instead writes <code>Sorry, an error occurred</code></p>
  
  <p>Does anyone know the reason? Hopefully I gave you enough to go on.</p>