X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Reader.html diff --git a/docs/source/Reader.html b/docs/source/Reader.html index 570200a2..5ebd2636 100644 --- a/docs/source/Reader.html +++ b/docs/source/Reader.html @@ -1,5 +1,22 @@ -
+ +/** - * @author Ed Spencer + + + + +\ No newline at end of file +});The source code + + + + + + +/** + * @author Ed Spencer * @class Ext.data.reader.Reader * @extends Object * @@ -143,21 +160,19 @@ Order ID: 50, which contains items: 3 orders of iPhone </code></pre> * - * @constructor - * @param {Object} config Optional config object */ Ext.define('Ext.data.reader.Reader', { requires: ['Ext.data.ResultSet'], alternateClassName: ['Ext.data.Reader', 'Ext.data.DataReader'], - /** + /** * @cfg {String} idProperty Name of the property within a row object * that contains a record identifier value. Defaults to <tt>The id of the model</tt>. * If an idProperty is explicitly specified it will override that of the one specified * on the model */ - /** + /** * @cfg {String} totalProperty Name of the property from which to * retrieve the total number of records in the dataset. This is only needed * if the whole dataset is not passed in one go, but is being paged from @@ -165,7 +180,7 @@ Ext.define('Ext.data.reader.Reader', { */ totalProperty: 'total', - /** + /** * @cfg {String} successProperty Name of the property from which to * retrieve the success attribute. Defaults to <tt>success</tt>. See * {@link Ext.data.proxy.Proxy}.{@link Ext.data.proxy.Proxy#exception exception} @@ -173,7 +188,7 @@ Ext.define('Ext.data.reader.Reader', { */ successProperty: 'success', - /** + /** * @cfg {String} root <b>Required</b>. The name of the property * which contains the Array of row objects. Defaults to <tt>undefined</tt>. * An exception will be thrown if the root property is undefined. The data @@ -182,12 +197,12 @@ Ext.define('Ext.data.reader.Reader', { */ root: '', - /** + /** * @cfg {String} messageProperty The name of the property which contains a response message. * This property is optional. */ - /** + /** * @cfg {Boolean} implicitIncludes True to automatically parse models nested within other models in a response * object. See the Ext.data.reader.Reader intro docs for full explanation. Defaults to true. */ @@ -195,6 +210,10 @@ Ext.define('Ext.data.reader.Reader', { isReader: true, + /** + * Creates new Reader. + * @param {Object} config (optional) Config object. + */ constructor: function(config) { var me = this; @@ -206,7 +225,7 @@ Ext.define('Ext.data.reader.Reader', { } }, - /** + /** * Sets a new model for the reader. * @private * @param {Object} model The model to set. @@ -223,7 +242,7 @@ Ext.define('Ext.data.reader.Reader', { } }, - /** + /** * Reads the given response object. This method normalizes the different types of response object that may be passed * to it, before handing off the reading of records to the {@link #readRecords} function. * @param {Object} response The response object. This may be either an XMLHttpRequest object or a plain JS object @@ -243,7 +262,7 @@ Ext.define('Ext.data.reader.Reader', { } }, - /** + /** * Abstracts common functionality used by all Reader subclasses. Each subclass is expected to call * this function before running its own logic and returning the Ext.data.ResultSet instance. For most * Readers additional processing should not be needed. @@ -263,7 +282,7 @@ Ext.define('Ext.data.reader.Reader', { me.buildExtractors(true); } - /** + /** * The raw data object that was last passed to readRecords. Stored for further processing if needed * @property rawData * @type Mixed @@ -318,7 +337,7 @@ Ext.define('Ext.data.reader.Reader', { }); }, - /** + /** * Returns extracted, type-cast rows of data. Iterates to call #extractValues for each row * @param {Object[]/Object} data-root from server response * @private @@ -344,8 +363,7 @@ Ext.define('Ext.data.reader.Reader', { id = me.getId(node); - record = new Model(values, id); - record.raw = node; + record = new Model(values, id, node); records.push(record); if (me.implicitIncludes) { @@ -356,7 +374,7 @@ Ext.define('Ext.data.reader.Reader', { return records; }, - /** + /** * @private * Loads a record's associations from the data object. This prepopulates hasMany and belongsTo associations * on the record provided. @@ -392,7 +410,7 @@ Ext.define('Ext.data.reader.Reader', { } }, - /** + /** * @private * Used internally by {@link #readAssociated}. Given a data object (which could be json, xml etc) for a specific * record, this should return the relevant part of that data for the given association name. This is only really @@ -409,7 +427,7 @@ Ext.define('Ext.data.reader.Reader', { return this.model.prototype.fields.items; }, - /** + /** * @private * Given an object representing a single model instance's data, iterates over the model's fields and * builds an object with the value for each field. @@ -433,7 +451,7 @@ Ext.define('Ext.data.reader.Reader', { return output; }, - /** + /** * @private * By default this function just returns what is passed to it. It can be overridden in a subclass * to return something else. See XmlReader for an example. @@ -444,7 +462,7 @@ Ext.define('Ext.data.reader.Reader', { return data; }, - /** + /** * @private * This will usually need to be implemented in a subclass. Given a generic data object (the type depends on the type * of data we are reading), this function should return the object as configured by the Reader's 'root' meta data config. @@ -456,7 +474,7 @@ Ext.define('Ext.data.reader.Reader', { return data; }, - /** + /** * Takes a raw response object (as passed to this.read) and returns the useful data segment of it. This must be implemented by each subclass * @param {Object} response The responce object * @return {Object} The useful data from the response @@ -467,7 +485,7 @@ Ext.define('Ext.data.reader.Reader', { //</debug> }, - /** + /** * @private * Reconfigures the meta data tied to this Reader */ @@ -488,7 +506,7 @@ Ext.define('Ext.data.reader.Reader', { } }, - /** + /** * Get the idProperty to use for extracting data * @private * @return {String} The id property @@ -501,7 +519,7 @@ Ext.define('Ext.data.reader.Reader', { return prop; }, - /** + /** * @private * This builds optimized functions for retrieving record data and meta data from an object. * Subclasses may need to implement their own getRoot function. @@ -551,7 +569,7 @@ Ext.define('Ext.data.reader.Reader', { me.buildFieldExtractors(); }, - /** + /** * @private */ buildFieldExtractors: function() { @@ -583,4 +601,6 @@ Ext.define('Ext.data.reader.Reader', { success: true }) }); -});