Properties Methods Events Config Options Direct Link
DataReader
  JsonReader
    ArrayReader

Class CQ.Ext.data.ArrayReader

Package:CQ.Ext.data
Class:ArrayReader
Extends:CQ.Ext.data.JsonReader
Clientlib:cq.widgets

Data reader class to create an Array of CQ.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 Employee = CQ.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 CQ.Ext.data.ArrayReader({
    idIndex: 0
}, Employee);

This would consume an Array like this:

[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]

Config Options

Config Options Defined By
  idIndex : Number
(optional) The subscript within row Array that provides an ID for the Record.
ArrayReader
  messageProperty : String
[undefined] Optional name of a property within a server-response that represents a user-feedback message.
DataReader

Public Properties

Property Defined By
  buildExtractors : Object
Abstract method, overridden in DataReader extensions such as CQ.Ext.data.JsonReader and CQ.Ext.data.XmlReader
DataReader
  extractValues : Object
Abstract method overridden in DataReader extensions such as CQ.Ext.data.JsonReader and CQ.Ext.data.XmlReader
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
  meta : Mixed
This DataReader's configured metadata as passed to the constructor.
DataReader

Public Methods

Method Defined By

Public Events

This class has no public events.