title: Parsing JSON to populate the dhtmlx grid
body: <p>I get JSON as a response, from an ajax call, the contents of which I then want to be loaded in the grid.</p>
  
  <p>From the JQuery documentation, <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow noreferrer">http://api.jquery.com/jQuery.ajax/</a>,  for response of type JSON:</p>
  
  <blockquote>
    <p>"json": Evaluates the response as JSON and returns a JavaScript
    object.</p>
  </blockquote>
  
  <p>So I convert the JavaScript object back to JSON using JSON.stringify:</p>
  
  <pre><code>importConfigurationStatusGrid.parse(JSON.stringify(result), "json");
  </code></pre>
  
  <p>But the grid doesn't get populated.</p>
  
  <p>The response I get looks like this:</p>
  
  <blockquote>
    <p>{"rows":{"Added to index":["file1", "file2",...."],
    "Conflicting":["file3", "file4",..."], "Removed":["file5",
    "file6",...."]}}</p>
  </blockquote>
  
  <p>I checked the JSON format on <a href="https://docs.dhtmlx.com/grid__data_formats.html#jsonformat" rel="nofollow noreferrer">https://docs.dhtmlx.com/grid__data_formats.html#jsonformat</a>, and I think the difference between the two(the response I get and the format specified) might be the cause.</p>
  
  <p>How can I parse the JSON string using the parse method of dhtmlxGridObject?</p>
  
  <pre><code>result = {"rows":{"Added to index":["file1", "file2",...."], "Conflicting":["file3", "file4",..."], "Removed":["file5", "file6",...."]}}
  importConfigurationStatusGrid.parse(result, "json");
  </code></pre>
  
  <p><strong>Edit 1:</strong></p>
  
  <blockquote>
    <p>@ogui: I don't know what your AJAX request looks like, but you can add
    a dataType property and set it to json so that your result gets
    automatically parsed as an object for you.</p>
  </blockquote>
  
  <p>The ajax request does have a <code>dataType: 'json'</code> property specified. So there isn't a need to use JSON.parse(). The problem lies in converting the JS object to a valid JSON format that the parse(dhtmlx) method requires.</p>
  
  <blockquote>
    <p>@ogui: You could aso use jQuery.getJSON().</p>
  </blockquote>
  
  <p>Even if I were to use this method, the grid object would have have to parse the same JSON, which it is failing at.</p>