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.
The code below lists all configuration options.
var RecordDef = Ext.data.Record.create([
{name: 'name', mapping: 1},
{name: 'occupation', mapping: 2},
]);
var myReader = new Ext.data.ArrayReader({
id: 0 // The subscript within row Array that provides an ID for the Record (可选)
}, RecordDef);
This would consume an Array like this:
[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
属性
-
方法
-
事件
-
设置选项
公共属性
此类没有公共属性。
公共方法
|
ArrayReader(Object meta , Array/Ext.data.Record constructor} ) |
ArrayReader |
Create a new JsonReader |
|
readRecords(Object o ) : Object |
ArrayReader |
Create a data block containing Ext.data.Records from an XML document. |
公共事件
此类没有公共事件。
设置选项
|
id : String |
ArrayReader |
(可选) The subscript within row Array that provides an ID for the Record |
|
totalProperty : String |
ArrayReader |
Name of the property from which to retrieve the total number of records in the dataset. This is only needed if the wh... |
构造函数
ArrayReader
public function ArrayReader(Object meta
, Array/Ext.data.Record constructor}
)
方法详情
readRecords
public function readRecords(Object o
)
Create a data block containing Ext.data.Records from an XML document.
参数:
o
: ObjectAn object which contains an Array of row objects in the property specified in the config as 'root, and optionally a property, specified in the config as 'totalProperty' which contains the total size of the dataset.
返回:
This method is defined by ArrayReader.
设置详情
id
id : String
(可选) The subscript within row Array that provides an ID for the Record
This config option is defined by ArrayReader.
totalProperty
totalProperty : String
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.
This config option is defined by ArrayReader.