sync
[roojs1] / docs / symbols / Roo.data.ArrayReader.json
1 {
2   "name" : "Roo.data.ArrayReader",
3   "augments" : [
4     "Roo.data.DataReader"
5   ],
6   "desc" : "Data reader class to create an Array of Roo.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 <em>mapping</em> property\nof the field definition if it exists, or the field's ordinal position in the definition.<br>\n<p>\nExample code:.\n<pre><code>\nvar RecordDef = Roo.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 Roo.data.ArrayReader({\n    id: 0                     // The subscript within row Array that provides an ID for the Record (optional)\n}, RecordDef);\n</code></pre>\n<p>\nThis would consume an Array like this:\n<pre><code>\n[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]\n  </code></pre>",
7   "isSingleton" : false,
8   "isStatic" : false,
9   "isBuiltin" : false,
10   "memberOf" : "ArrayReader",
11   "example" : "",
12   "deprecated" : "",
13   "since" : "",
14   "see" : "",
15   "params" : [
16     {
17       "name" : "meta",
18       "type" : "Object",
19       "desc" : "Metadata configuration options.",
20       "isOptional" : false
21     },
22     {
23       "name" : "recordType",
24       "type" : "Object|Array",
25       "desc" : "Either an Array of field definition objects",
26       "isOptional" : false
27     }
28   ],
29   "returns" : [],
30   "throws" : "",
31   "requires" : "",
32   "config" : [
33     {
34       "name" : "id",
35       "type" : "String",
36       "desc" : "Name of the property within a row object that contains a record identifier value.\nas specified to {@link Roo.data.Record#create},\nor an {@link Roo.data.Record} object\n\n\ncreated using {@link Roo.data.Record#create}.",
37       "memberOf" : ""
38     },
39     {
40       "name" : "fields",
41       "type" : "Array",
42       "desc" : "Array of field definition objects",
43       "memberOf" : ""
44     }
45   ],
46   "methods" : [
47     {
48       "name" : "readRecords",
49       "type" : "function",
50       "desc" : "Create a data block containing Roo.data.Records from an XML document.",
51       "sig" : "(o)",
52       "static" : false,
53       "memberOf" : "",
54       "isStatic" : false,
55       "isConstructor" : false,
56       "isPrivate" : false,
57       "example" : "",
58       "deprecated" : "",
59       "since" : "",
60       "see" : "",
61       "exceptions" : "",
62       "requires" : "",
63       "params" : [
64         {
65           "name" : "o",
66           "type" : "Object",
67           "desc" : "An Array of row objects which represents the dataset.",
68           "isOptional" : false
69         }
70       ],
71       "returns" : [
72         {
73           "name" : "",
74           "type" : "Object",
75           "desc" : "A data block which is used by an {@link Roo.data.Store} object as\na cache of Roo.data.Records."
76         }
77       ]
78     },
79     {
80       "name" : "newRow",
81       "type" : "function",
82       "desc" : "Create an empty record",
83       "sig" : "(data)",
84       "static" : false,
85       "memberOf" : "Roo.data.DataReader",
86       "isStatic" : false,
87       "isConstructor" : false,
88       "isPrivate" : false,
89       "example" : "",
90       "deprecated" : "",
91       "since" : "",
92       "see" : "",
93       "exceptions" : "",
94       "requires" : "",
95       "params" : [
96         {
97           "name" : "data",
98           "type" : "Object",
99           "desc" : "(optional) - overlay some values",
100           "isOptional" : false
101         }
102       ],
103       "returns" : [
104         {
105           "name" : "",
106           "type" : "Roo.data.Record",
107           "desc" : "record created."
108         }
109       ]
110     }
111   ],
112   "events" : []
113 }