Class Ext.data.ArrayReader
Package: | Ext.data |
Class: | ArrayReader |
Extends: | Ext.data.DataReader |
Defined In: | ArrayReader.js |
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.
Example code:.
var RecordDef = Ext.data.Record.create([
{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.ArrayReader({
id: 0 // The subscript within row Array that provides an ID for the Record (optional)
}, RecordDef);
This would consume an Array like this:
[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
Properties
-
Methods
-
Events
-
Config Options
Public Properties
This class has no public properties.
Public Methods
|
ArrayReader( Object meta , Object recordType ) |
ArrayReader |
Create a new JsonReader |
|
readRecords( Object o ) : Object |
ArrayReader |
Create a data block containing Ext.data.Records from an XML document. |
Public Events
This class has no public events.
Config Options
|
id : String |
ArrayReader |
(optional) The subscript within row Array that provides an ID for the Record |
Constructor Details
ArrayReader
public function ArrayReader( Object meta
, Object recordType
)
Method Details
readRecords
public function readRecords( Object o
)
Create a data block containing Ext.data.Records from an XML document.
This method is defined by ArrayReader.
Config Details
id
id : String
(optional) The subscript within row Array that provides an ID for the Record
This config option is defined by ArrayReader.