Ext.data.ArrayReader.html
11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<div class="body-wrap">
<div class="top-tools">
<a class="inner-link" href="#Ext.data.ArrayReader-props"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-prop">Properties</a>
<a class="inner-link" href="#Ext.data.ArrayReader-methods"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-method">Methods</a>
<a class="inner-link" href="#Ext.data.ArrayReader-events"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-event">Events</a>
<a class="inner-link" href="#Ext.data.ArrayReader-configs"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-config">Config Options</a>
<a class="bookmark" href="../docs/?class=Ext.data.ArrayReader"><img src="../resources/images/default/s_wev8.gif" class="item-icon icon-fav">Direct Link</a>
</div>
<div class="inheritance res-block">
<pre class="res-block-inner"><a ext:cls="Ext.data.DataReader" ext:member="" href="output/Ext.data.DataReader.html">DataReader</a>
<img src="resources/elbow-end_wev8.gif"/><a ext:cls="Ext.data.JsonReader" ext:member="" href="output/Ext.data.JsonReader.html">JsonReader</a>
<img src="resources/elbow-end_wev8.gif"/>ArrayReader</pre></div>
<h1>Class Ext.data.ArrayReader</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr>
<tr><td class="label">Defined In:</td><td class="hd-info"><a href="../source/data/ArrayReader_wev8.js" target="_blank">ArrayReader_wev8.js</a></td></tr>
<tr><td class="label">Class:</td><td class="hd-info">ArrayReader</td></tr>
<tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.data.JsonReader" ext:member="" href="output/Ext.data.JsonReader.html">JsonReader</a></td></tr>
</table>
<div class="description">
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 <em>mapping</em> property
of the field definition if it exists, or the field's ordinal position in the definition.<br>
<p>
Example code:.
<pre><code>var Employee = Ext.data.Record.create([
{name: <em>'name'</em>, mapping: 1}, <i>// <em>"mapping"</em> only needed <b>if</b> an <em>"id"</em> field is present which</i>
{name: <em>'occupation'</em>, mapping: 2} <i>// precludes using the ordinal position as the index.</i>
]);
<b>var</b> myReader = <b>new</b> Ext.data.ArrayReader({
id: 0 <i>// The subscript within row Array that provides an ID <b>for</b> the Record (optional)</i>
}, Employee);</code></pre>
<p>
This would consume an Array like this:
<pre><code>[ [1, <em>'Bill'</em>, <em>'Gardener'</em>], [2, <em>'Ben'</em>, <em>'Horticulturalist'</em>] ]</code></pre> </div>
<div class="hr"></div>
<a id="Ext.data.ArrayReader-configs"></a>
<h2>Config Options</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Config Options</th>
<th class="msource-header">Defined By</th>
</tr>
<tr class="config-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-id"></a>
<b>id</b> : String <div class="mdesc">
(optional) The subscript within row Array that provides an ID for the Record </div>
</td>
<td class="msource">ArrayReader</td>
</tr>
<tr class="config-row inherited alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-root"></a>
<b>root</b> : String <div class="mdesc">
name of the property which contains the Array of row objects. </div>
</td>
<td class="msource"><a ext:cls="Ext.data.JsonReader" ext:member="#root" href="output/Ext.data.JsonReader.html#root">JsonReader</a></td>
</tr>
<tr class="config-row inherited">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-successProperty"></a>
<b>successProperty</b> : String <div class="mdesc">
Name of the property from which to retrieve the success attribute used by forms. </div>
</td>
<td class="msource"><a ext:cls="Ext.data.JsonReader" ext:member="#successProperty" href="output/Ext.data.JsonReader.html#successProperty">JsonReader</a></td>
</tr>
<tr class="config-row inherited alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-totalProperty"></a>
<b>totalProperty</b> : String <div class="mdesc">
<div class="short">Name of the property from which to retrieve the total number of records in the dataset. This is only needed if the wh...</div>
<div class="long">
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. </div>
</div>
</td>
<td class="msource"><a ext:cls="Ext.data.JsonReader" ext:member="#totalProperty" href="output/Ext.data.JsonReader.html#totalProperty">JsonReader</a></td>
</tr>
</table>
<a id="Ext.data.ArrayReader-props"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr class="property-row inherited expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-jsonData"></a>
<b>jsonData</b> : Object <div class="mdesc">
<div class="short">After any data loads, the raw JSON data is available for further custom processing. If no data is
loaded or there is...</div>
<div class="long">
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. </div>
</div>
</td>
<td class="msource"><a ext:cls="Ext.data.JsonReader" ext:member="#jsonData" href="output/Ext.data.JsonReader.html#jsonData">JsonReader</a></td>
</tr>
<tr class="property-row inherited alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-meta"></a>
<b>meta</b> : Mixed <div class="mdesc">
This DataReader's configured metadata as passed to the constructor. </div>
</td>
<td class="msource"><a ext:cls="Ext.data.DataReader" ext:member="#meta" href="output/Ext.data.DataReader.html#meta">DataReader</a></td>
</tr>
</table>
<a id="Ext.data.ArrayReader-methods"></a>
<h2>Public Methods</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Method</th>
<th class="msource-header">Defined By</th>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-ArrayReader"></a>
<b>ArrayReader</b>( <code>Object meta</code>, <code>Object recordType</code> ) <div class="mdesc">
<div class="short">Create a new ArrayReader</div>
<div class="long">
Create a new ArrayReader <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>meta</code> : Object<div class="sub-desc">Metadata configuration options.</div></li><li><code>recordType</code> : Object<div class="sub-desc">Either an Array of field definition objects
as specified to <a ext:cls="Ext.data.Record" ext:member="create" href="output/Ext.data.Record.html#create">Ext.data.Record.create</a>,
or a <a ext:cls="Ext.data.Record" href="output/Ext.data.Record.html">Record</a> constructor
created using <a ext:cls="Ext.data.Record" ext:member="create" href="output/Ext.data.Record.html#create">Ext.data.Record.create</a>.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code></code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">ArrayReader</td>
</tr>
<tr class="method-row inherited alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-read"></a>
<b>read</b>( <code>Object response</code> ) : Object <div class="mdesc">
<div class="short">
This method is only used by a DataProxy which has retrieved data from a remote server.</div>
<div class="long">
This method is only used by a DataProxy which has retrieved data from a remote server. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>response</code> : Object<div class="sub-desc">The XHR object which contains the JSON data in its responseText.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Object</code><div class="sub-desc">data A data block which is used by an Ext.data.Store object as a cache of Ext.data.Records.</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource"><a ext:cls="Ext.data.JsonReader" ext:member="#read" href="output/Ext.data.JsonReader.html#read">JsonReader</a></td>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.data.ArrayReader-readRecords"></a>
<b>readRecords</b>( <code>Object o</code> ) : Object <div class="mdesc">
<div class="short">Create a data block containing Ext.data.Records from an XML document.</div>
<div class="long">
Create a data block containing Ext.data.Records from an XML document. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>o</code> : Object<div class="sub-desc">An Array of row objects which represents the dataset.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Object</code><div class="sub-desc">data A data block which is used by an Ext.data.Store object as a cache of Ext.data.Records.</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">ArrayReader</td>
</tr>
</table>
<a id="Ext.data.ArrayReader-events"></a>
<h2>Public Events</h2>
<div class="no-members">This class has no public events.</div>
</div>