X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/docs/api/Ext.data.reader.Array.html diff --git a/docs/api/Ext.data.reader.Array.html b/docs/api/Ext.data.reader.Array.html new file mode 100644 index 00000000..eb5ad2f9 --- /dev/null +++ b/docs/api/Ext.data.reader.Array.html @@ -0,0 +1,146 @@ +Ext.data.reader.Array | Ext JS 4.0 Documentation +
For up to date documentation and features, visit +http://docs.sencha.com/ext-js/4-0

Sencha Documentation

+ + + + + +

Hierarchy

Data reader class to create an Array of Ext.data.Model objects from an Array. +Each element of that Array represents a row of data fields. The +fields are pulled into a Record object using as a subscript, the mapping property +of the field definition if it exists, or the field's ordinal position in the definition.

+ + + + +

Example code:

+ + + + +
Employee = Ext.define('Employee', {
+    extend: 'Ext.data.Model',
+    fields: [
+        'id',
+        {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
+        {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.        
+    ]
+});
+
+var myReader = new Ext.data.reader.Array({
+    model: 'Employee'
+}, Employee);
+
+ + + + +

This would consume an Array like this:

+ + + + +
[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
+
+ +
Defined By

Config Options

Other Configs

 
Name of the property within a row object +that contains a record identifier value. Defaults to The id of the model. +I...

Name of the property within a row object +that contains a record identifier value. Defaults to The id of the model. +If an idProperty is explicitly specified it will override that of the one specified +on the model

+
 
True to automatically parse models nested within other models in a response +object. See the Ext.data.reader.Reader in...

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.

+
 

The name of the property which contains a response message. +This property is optional.

+

The name of the property which contains a response message. +This property is optional.

+
 
The optional location within the JSON response that the record data itself can be found at. +See the JsonReader intro ...

The optional location within the JSON response that the record data itself can be found at. +See the JsonReader intro docs for more details. This is not often needed and defaults to undefined.

+
 
Required. The name of the property +which contains the Array of row objects. Defaults to undefined. +An exception wil...

Required. The name of the property +which contains the Array of row objects. Defaults to undefined. +An exception will be thrown if the root property is undefined. The data +packet value for this property should be an empty array to clear the data +or show no data.

+
 
Name of the property from which to +retrieve the success attribute. Defaults to success. See +Ext.data.proxy.Proxy.exc...

Name of the property from which to +retrieve the success attribute. Defaults to success. See +Ext.data.proxy.Proxy.exception +for additional information.

+
 
Name of the property from which to +retrieve the total number of records in the dataset. This is only needed +if the wh...

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 +the remote server. Defaults to total.

+
 
True to ensure that field names/mappings are treated as literals when +reading values. Defalts to false. +For example, ...

True to ensure that field names/mappings are treated as literals when +reading values. Defalts to false. +For example, by default, using the mapping "foo.bar.baz" will try and read a property foo from the root, then a property bar +from foo, then a property baz from bar. Setting the simple accessors to true will read the property with the name +"foo.bar.baz" direct from the root object.

+
Defined By

Properties

 

DEPRECATED - will be removed in Ext JS 5.0. This is just a copy of this.rawData - use that instead

+

DEPRECATED - will be removed in Ext JS 5.0. This is just a copy of this.rawData - use that instead

+
 

The raw data object that was last passed to readRecords. Stored for further processing if needed

+

The raw data object that was last passed to readRecords. Stored for further processing if needed

+
Defined By

Methods

 

Create a new ArrayReader

+

Create a new ArrayReader

+

Parameters

  • meta : Object

    Metadata configuration options.

    +

Returns

  • void    +
 
Takes a raw response object (as passed to this.read) and returns the useful data segment of it. This must be implemen...

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

+

Parameters

  • response : Object

    The responce object

    +

Returns

  • Object   

    The useful data from the response

    +
 
read( +Object response) + : Ext.data.ResultSet
Reads the given response object. This method normalizes the different types of response object that may be passed +to ...

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 readRecords function.

+

Parameters

  • response : Object

    The response object. This may be either an XMLHttpRequest object or a plain JS object

    +

Returns

  • Ext.data.ResultSet   

    The parsed ResultSet object

    +
 
readRecords( +Object data) + : Ext.data.ResultSet
Reads a JSON object and returns a ResultSet. Uses the internal getTotal and getSuccess extractors to +retrieve meta da...

Reads a JSON object and returns a ResultSet. Uses the internal getTotal and getSuccess extractors to +retrieve meta data from the response, and extractData to turn the JSON data into model instances.

+

Parameters

  • data : Object

    The raw JSON data

    +

Returns

  • Ext.data.ResultSet   

    A ResultSet containing model instances and meta data about the results

    +
\ No newline at end of file