Skip to content

Instantly share code, notes, and snippets.

@ttdonovan
Created April 8, 2009 18:33
Show Gist options
  • Select an option

  • Save ttdonovan/91920 to your computer and use it in GitHub Desktop.

Select an option

Save ttdonovan/91920 to your computer and use it in GitHub Desktop.
CDWeb.requestController = SC.DataSource.create(
/** @scope CDWeb.requestController */ {
retrieveRecords: function(store, storeKeys) {
var storeKey = storeKeys[0] ; // only the first
var id = store.idFor(storeKey) ;
var rec = store.find(CDWeb.Data, id) ;
$.ajax({
type: 'GET',
dataType: 'json',
url: rec.get('resourceURL'),
success: function(response) { store.dataSourceDidComplete(storeKey, response) ; },
error: function(response) { console.log(response) ; }
}) ;
// store.dataSourceDidComplete(storeKey, dataHash, newId)
}
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment