Data reader class to create an Array of Ext.data.Record 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.
@@ -11,47 +11,51 @@ of the field definition if it exists, or the field's ordinal position in the def
idIndex: 0
}, Employee);
This would consume an Array like this:
-
[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
Config Options
|
| fields : Array/ObjectEither an Array of Field definition objects (which
-will be passed to Ext.data.Record.create, or a Record
+ [ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
Config Options|
| fields : Array/ObjectEither an Array of Field definition objects (which
+will be passed to Ext.data.Record.create, or a Record
constructo... | DataReader | | id : NumberThe subscript within row Array that provides an ID for the Record.
-Deprecated. Use idIndex instead. | ArrayReader | | idIndex : Number The subscript within row Array that provides an ID for the Record. | ArrayReader | | idProperty : String [id] Name of the property within a row object that contains a record identifier value. Defaults to id | JsonReader | | root : String[undefined] Required. The name of the property
-which contains the Array of row objects. Defaults to undefined.
+Deprecated. Use idIndex instead. | ArrayReader | | idIndex : Number The subscript within row Array that provides an ID for the Record. | ArrayReader | | idProperty : String [id] Name of the property within a row object
+that contains a record identifier value. Defaults to id | JsonReader | | messageProperty : String [undefined] Optional name of a property within a server-response that represents a user-feedback message. | DataReader | | root : String[undefined] Required. The name of the property
+which contains the Array of row objects. Defaults to undefined.
An e... [undefined] 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. | JsonReader | | totalProperty : String[total] Name of the property from which to retrieve the total number of records
-in the dataset. This is only needed i... [total] 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. | JsonReader |
Public Properties|
| buildExtractors : Object | DataReader | | jsonData : ObjectAfter any data loads, the raw JSON data is available for further custom processing. If no data is
+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. | JsonReader | | totalProperty : String[total] Name of the property from which to
+retrieve the total number of records in the dataset. This is only needed
+i... [total] 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. | JsonReader |
Public Properties|
| buildExtractors : Object | DataReader | | extractData : Object | DataReader | | extractValues : Object | DataReader | | getId : Object Abstract method created in extension's buildExtractors impl. | DataReader | | getMessage : Object Abstract method created in extension's buildExtractors impl. | DataReader | | getRoot : Object Abstract method created in extension's buildExtractors impl. | DataReader | | getSuccess : Object Abstract method created in extension's buildExtractors impl. | DataReader | | getTotal : Object Abstract method created in extension's buildExtractors impl. | DataReader | | jsonData : ObjectAfter any data loads, the raw JSON data is available for further custom processing. If no data is
loaded or there is... After any data loads, the raw JSON data is available for further custom processing. If no data is
loaded or there is a load exception this property will be undefined. | JsonReader | | meta : Mixed This JsonReader's metadata as passed to the constructor, or as passed in
-the last data packet's metaData property. | JsonReader |
Public MethodsPublic Methods|
| ArrayReader( Object meta , Array/Object recordType )
| ArrayReader | | isData( Object data )
- :
- BooleanReturns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key
+constructor created from Ext.data.Record.create. Returns: | ArrayReader | | isData( Object data )
+ :
+ BooleanReturns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key
corresponding to i... Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key
-corresponding to idProperty defined in your DataReader config containing non-empty pk. | DataReader | | read( Object response )
- :
- ObjectThis method is only used by a DataProxy which has retrieved data from a remote server. This method is only used by a DataProxy which has retrieved data from a remote server. | JsonReader | | readRecords( Object o )
- :
- ObjectCreate a data block containing Ext.data.Records from an Array. Create a data block containing Ext.data.Records from an Array. | ArrayReader | | readResponse( String action , Object response )
- :
- voidDecode a json response from server. Decode a json response from server. | JsonReader | | realize( Record/Record[] record , Object/Object[] data )
- :
+corresponding to idProperty defined in your DataReader config containing non-empty pk. | DataReader | | read( Object response )
+ :
+ ObjectThis method is only used by a DataProxy which has retrieved data from a remote server. This method is only used by a DataProxy which has retrieved data from a remote server. | JsonReader | | readRecords( Object o )
+ :
+ ObjectCreate a data block containing Ext.data.Records from an Array. Create a data block containing Ext.data.Records from an Array. | ArrayReader | | readResponse( String action , Object response )
+ :
+ voidDecode a json response from server. Decode a json response from server. Parameters:action : String[Ext.data.Api.actions.create|read|update|destroy] response : ObjectTODO: 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. Returns: | JsonReader | | realize( Record/Record[] record , Object/Object[] data )
+ :
voidUsed for un-phantoming a record after a successful database insert. Sets the records pk along with new data from ser... Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server.
You must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming
data from server will be merged with the data in the local record.
In addition, you must return record-data from the server in the same order received.
-Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be suppressed. | DataReader | | update( Record/Record[] rs , Object/Object[] data )
- :
- voidUsed for updating a non-phantom or "real" record's data with fresh data from server after remote-save.
+Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be suppressed. | DataReader | | update( Record/Record[] rs , Object/Object[] data )
+ :
+ voidUsed for updating a non-phantom or "real" record's data with fresh data from server after remote-save.
If returning ... Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save.
If returning data from multiple-records after a batch-update, you must return record-data from the server in
the same order received. Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be
|
|