Skip to content

Instantly share code, notes, and snippets.

@edspencer
Created April 17, 2009 13:29
Show Gist options
  • Save edspencer/97023 to your computer and use it in GitHub Desktop.
Save edspencer/97023 to your computer and use it in GitHub Desktop.
//taken from a recent project - tells ExtMVC.Model to use a ScriptTagProxy and a remote host
Ext.apply(ExtMVC.Model.Adapter.REST.classMethods, {
urlExtension: '.json',
// port: 3000,
// host: 'http://localhost',
host: 'http://widgets.jungle-media.com',
proxyType: Ext.data.ScriptTagProxy,
parseSingleLoadResponse: function(response, options, callbacks) {
var m = this.getReader().readRecords(eval("(" + response.responseText + ")"));
if (m && m.records[0]) {
m.records[0].newRecord = false;
callbacks.successFn.call(options.scope, m.records[0]);
} else {
callbacks.failureFn.call(options.scope, response);
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment