Martin Ottenwaelter

  1. SC.Response and JSON

    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);
      }
    }
    
  2. blog comments powered by Disqus