X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/src/data/JsonReader.js diff --git a/src/data/JsonReader.js b/src/data/JsonReader.js index 3da7fbb6..06c327d8 100644 --- a/src/data/JsonReader.js +++ b/src/data/JsonReader.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.data.JsonReader @@ -23,7 +23,7 @@ var myReader = new Ext.data.JsonReader({ // constructor that provides mapping for reading the record data objects {@link Ext.data.DataReader#fields fields}: [ // map Record's 'firstname' field to data object's key of same name - {name: 'name'}, + {name: 'name', mapping: 'firstname'}, // map Record's 'job' field to data object's 'occupation' key {name: 'job', mapping: 'occupation'} ] @@ -165,13 +165,16 @@ Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { return this.readRecords(o); }, - /** - * Decode a json response from server. - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} response + /* * TODO: refactor code between JsonReader#readRecords, #readResponse into 1 method. * there's ugly duplication going on due to maintaining backwards compat. with 2.0. It's time to do this. */ + /** + * Decode a JSON response from server. + * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] + * @param {Object} response The XHR object returned through an Ajax server request. + * @return {Response} A {@link Ext.data.Response Response} object containing the data response, and also status information. + */ readResponse : function(action, response) { var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response; if(!o) {