/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_data_ArrayReader({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.data.JsonReader","uses":[],"html":"

Hierarchy

Files

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

\n\n\n

Example code:

\n\n\n
var Employee = Ext.data.Record.create([\n    {name: 'name', mapping: 1},         // \"mapping\" only needed if an \"id\" field is present which\n    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.\n]);\nvar myReader = new Ext.data.ArrayReader({\n    idIndex: 0\n}, Employee);\n
\n\n\n

This would consume an Array like this:

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

Config options

Either an Array of Field definition objects (which\nwill be passed to Ext.data.Record.create, or a Record\nconstructor ...

Either an Array of Field definition objects (which\nwill be passed to Ext.data.Record.create, or a Record\nconstructor created from Ext.data.Record.create.

\n\n
Ext.data.ArrayReader
view source
: Number
(optional) The subscript within row Array that provides an ID for the Record. ...

(optional) The subscript within row Array that provides an ID for the Record.\nDeprecated. Use idIndex instead.

\n
Ext.data.ArrayReader
view source
idIndex : Number

(optional) The subscript within row Array that provides an ID for the Record.

\n

(optional) The subscript within row Array that provides an ID for the Record.

\n
[id] Name of the property within a row object\nthat contains a record identifier value. ...

[id] Name of the property within a row object\nthat contains a record identifier value. Defaults to id

\n

[undefined] Optional name of a property within a server-response that represents a user-feedback message.

\n

[undefined] Optional name of a property within a server-response that represents a user-feedback message.

\n
[undefined] Required. ...

[undefined] Required. The name of the property\nwhich contains the Array of row objects. Defaults to undefined.\nAn exception will be thrown if the root property is undefined. The data\npacket value for this property should be an empty array to clear the data\nor show no data.

\n
[total] Name of the property from which to\nretrieve the total number of records in the dataset. ...

[total] Name of the property from which to\nretrieve the total number of records in the dataset. This is only needed\nif the whole dataset is not passed in one go, but is being paged from\nthe remote server. Defaults to total.

\n
Defined By

Properties

After any data loads, the raw JSON data is available for further custom processing. ...

After any data loads, the raw JSON data is available for further custom processing. If no data is\nloaded or there is a load exception this property will be undefined.

\n

This JsonReader's metadata as passed to the constructor, or as passed in\nthe last data packet's metaData property.

\n

This JsonReader's metadata as passed to the constructor, or as passed in\nthe last data packet's metaData property.

\n

Overrides: Ext.data.DataReader.meta

Defined By

Methods

Ext.data.ArrayReader
view source
new( meta, recordType ) : Ext.data.ArrayReader
Create a new ArrayReader ...

Create a new ArrayReader

\n

Parameters

Returns

Overrides: Ext.data.JsonReader.constructor

Abstract method, overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader ...

Abstract method, overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader

\n
( data-root, returnRecords )private
returns extracted, type-cast rows of data. ...

returns extracted, type-cast rows of data. Iterates to call extractValues for each row

\n

Parameters

  • data-root : Object[]/Object

    from server response

    \n
  • returnRecords : Boolean

    [false] Set true to return instances of Ext.data.Record

    \n
type-casts a single row of raw-data from server ...

type-casts a single row of raw-data from server

\n

Parameters

  • data : Object
    \n
  • items : Array
    \n
  • len : Integer
    \n

Overrides: Ext.data.DataReader.extractValues

Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Returns true if the supplied data-hash looks and quacks like data. ...

Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key\ncorresponding to idProperty defined in your DataReader config containing non-empty pk.

\n

Parameters

  • data : Object
    \n

Returns

  • Boolean
    \n
This 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.

\n

Parameters

  • response : Object

    The XHR object which contains the JSON data in its responseText.

    \n

Returns

  • Object

    data A data block which is used by an Ext.data.Store object as\na cache of Ext.data.Records.

    \n
Ext.data.ArrayReader
view source
( o ) : Object
Create a data block containing Ext.data.Records from an Array. ...

Create a data block containing Ext.data.Records from an Array.

\n

Parameters

  • o : Object

    An Array of row objects which represents the dataset.

    \n

Returns

  • Object

    data A data block which is used by an Ext.data.Store object as\na cache of Ext.data.Records.

    \n

Overrides: Ext.data.JsonReader.readRecords

( action, response ) : Response
Decode a JSON response from server. ...

Decode a JSON response from server.

\n

Parameters

  • action : String

    [Ext.data.Api.actions.create|read|update|destroy]

    \n
  • response : Object

    The XHR object returned through an Ajax server request.

    \n

Returns

  • Response

    A Response object containing the data response, and also status information.

    \n
Used for un-phantoming a record after a successful database insert. ...

Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server.\nYou must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming\ndata from server will be merged with the data in the local record.\nIn addition, you must return record-data from the server in the same order received.\nWill perform a commit as well, un-marking dirty-fields. Store's \"update\" event will be suppressed.

\n

Parameters

  • record : Record/Record[]

    The phantom record to be realized.

    \n
  • data : Object/Object[]

    The new record data to apply. Must include the primary-key from database defined in idProperty field.

    \n
Used for updating a non-phantom or \"real\" record's data with fresh data from server after remote-save. ...

Used for updating a non-phantom or \"real\" record's data with fresh data from server after remote-save.\nIf returning data from multiple-records after a batch-update, you must return record-data from the server in\nthe same order received. Will perform a commit as well, un-marking dirty-fields. Store's \"update\" event will be\nsuppressed as the record receives fresh new data-hash

\n

Parameters

  • rs : Record/Record[]
    \n
  • data : Object/Object[]
    \n
","superclasses":["Ext.data.DataReader","Ext.data.JsonReader"],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"ArrayReader.html#Ext-data-ArrayReader","filename":"ArrayReader.js"}],"linenr":1,"members":{"property":[{"tagname":"property","owner":"Ext.data.JsonReader","meta":{},"name":"jsonData","id":"property-jsonData"},{"tagname":"property","owner":"Ext.data.JsonReader","meta":{},"name":"meta","id":"property-meta"}],"cfg":[{"tagname":"cfg","owner":"Ext.data.DataReader","meta":{},"name":"fields","id":"cfg-fields"},{"tagname":"cfg","owner":"Ext.data.ArrayReader","meta":{},"name":"id","id":"cfg-id"},{"tagname":"cfg","owner":"Ext.data.ArrayReader","meta":{},"name":"idIndex","id":"cfg-idIndex"},{"tagname":"cfg","owner":"Ext.data.JsonReader","meta":{},"name":"idProperty","id":"cfg-idProperty"},{"tagname":"cfg","owner":"Ext.data.DataReader","meta":{},"name":"messageProperty","id":"cfg-messageProperty"},{"tagname":"cfg","owner":"Ext.data.JsonReader","meta":{},"name":"root","id":"cfg-root"},{"tagname":"cfg","owner":"Ext.data.JsonReader","meta":{},"name":"totalProperty","id":"cfg-totalProperty"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.data.ArrayReader","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"buildExtractors","id":"method-buildExtractors"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{"private":true},"name":"extractData","id":"method-extractData"},{"tagname":"method","owner":"Ext.data.JsonReader","meta":{"private":true},"name":"extractValues","id":"method-extractValues"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getId","id":"method-getId"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getMessage","id":"method-getMessage"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getRoot","id":"method-getRoot"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getSuccess","id":"method-getSuccess"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getTotal","id":"method-getTotal"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"isData","id":"method-isData"},{"tagname":"method","owner":"Ext.data.JsonReader","meta":{},"name":"read","id":"method-read"},{"tagname":"method","owner":"Ext.data.ArrayReader","meta":{},"name":"readRecords","id":"method-readRecords"},{"tagname":"method","owner":"Ext.data.JsonReader","meta":{},"name":"readResponse","id":"method-readResponse"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"realize","id":"method-realize"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"update","id":"method-update"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.data.ArrayReader","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.data.ArrayReader","mixins":[],"mixedInto":[]});