SC.Response and JSON

  November 13th, 2009

SproutCore’s SC.Response was recently rewritten and I patched it to avoid an exception to be thrown when a malformed JSON string was parsed. The standard way to write your data source didFetch method is now:

didFetch: function(response, params) {
  var results, query = params.query;
  if (SC.ok(response) && SC.ok(results = response.get('body'))) {
    ...
  } else {
    store.dataSourceDidErrorQuery(query);
  }
}

3 Responses to “SC.Response and JSON”

  1. Mil says:

    Hello, is there a way to put the data you retrieve from reading a json file to a table?
    If there is, is it ok if you could show me how is it done.

    Thank You.

  2. martin says:

    Hi Mil, if you need SproutCore help for a specific problem, the best place to do that is the Google Group http://groups.google.com/group/sproutcore or the IRC channel (#sproutcore on Freenode).

  3. Mil says:

    Ok, Thanks Martin. :)
    By the way this post helps me a lot in reading the file i needed..

    Thanks again.

Leave a comment