82354110ec49e9333dfc238c5a943e306b4426d4
[roojs1] / docs / symbols / Roo.data.JsonReader.json
1 {
2   "name" : "Roo.data.JsonReader",
3   "augments" : [
4     "Roo.data.DataReader"
5   ],
6   "childClasses" : {  },
7   "tree_children" : [],
8   "tree_parent" : [],
9   "desc" : "Data reader class to create an Array of Roo.data.Record objects from a JSON response\nbased on mappings in a provided Roo.data.Record constructor.\n\nThe default behaviour of a store is to send ?_requestMeta=1, unless the class has recieved 'metaData' property\nin the reply previously. \n\n<p>\nExample code:\n<pre><code>\nvar RecordDef = Roo.data.Record.create([\n    {name: 'name', mapping: 'name'},     // \"mapping\" property not needed if it's the same as \"name\"\n    {name: 'occupation'}                 // This field will use \"occupation\" as the mapping.\n]);\nvar myReader = new Roo.data.JsonReader({\n    totalProperty: \"results\",    // The property which contains the total dataset size (optional)\n    root: \"rows\",                // The property which contains an Array of row objects\n    id: \"id\"                     // The property within each row object that provides an ID for the record (optional)\n}, RecordDef);\n</code></pre>\n<p>\nThis would consume a JSON file like this:\n<pre><code>\n{ 'results': 2, 'rows': [\n    { 'id': 1, 'name': 'Bill', occupation: 'Gardener' },\n    { 'id': 2, 'name': 'Ben', occupation: 'Horticulturalist' } ]\n}\n</code></pre>",
10   "isSingleton" : false,
11   "isStatic" : false,
12   "isBuiltin" : false,
13   "isAbstract" : false,
14   "isBuilderTop" : false,
15   "memberOf" : "JsonReader",
16   "example" : "",
17   "deprecated" : "",
18   "since" : "",
19   "see" : "",
20   "params" : [
21     {
22       "name" : "meta",
23       "type" : "Object",
24       "desc" : "Metadata configuration options",
25       "isOptional" : false
26     },
27     {
28       "name" : "recordType",
29       "type" : "Object",
30       "desc" : "Either an Array of field definition objects,\nor an {@link Roo.data.Record} object created using {@link Roo.data.Record#create}.",
31       "isOptional" : false
32     }
33   ],
34   "returns" : [],
35   "throws" : "",
36   "requires" : "",
37   "config" : [
38     {
39       "name" : "id",
40       "type" : "String",
41       "desc" : "Name of the property within a row object that contains a record identifier value.",
42       "memberOf" : "Roo.data.JsonReader"
43     },
44     {
45       "name" : "fields",
46       "type" : "Array",
47       "desc" : "Array of field definition objects",
48       "memberOf" : "Roo.data.JsonReader"
49     },
50     {
51       "name" : "root",
52       "type" : "String",
53       "desc" : "name of the property which contains the Array of row objects.",
54       "memberOf" : "Roo.data.JsonReader"
55     },
56     {
57       "name" : "successProperty",
58       "type" : "String",
59       "desc" : "Name of the property from which to retrieve the success attribute used by forms.",
60       "memberOf" : "Roo.data.JsonReader"
61     },
62     {
63       "name" : "totalProperty",
64       "type" : "String",
65       "desc" : "Name of the property from which to retrieve the total number of records\nin the dataset. This is only needed if the whole dataset is not passed in one go, but is being\npaged from the remote server.",
66       "memberOf" : "Roo.data.JsonReader"
67     }
68   ],
69   "methods" : [
70     {
71       "name" : "readRecords",
72       "type" : "function",
73       "desc" : "Create a data block containing Roo.data.Records from an XML document.",
74       "sig" : "(o)",
75       "static" : false,
76       "memberOf" : "",
77       "isStatic" : false,
78       "isConstructor" : false,
79       "isPrivate" : false,
80       "example" : "",
81       "deprecated" : "",
82       "since" : "",
83       "see" : "",
84       "exceptions" : "",
85       "requires" : "",
86       "params" : [
87         {
88           "name" : "o",
89           "type" : "Object",
90           "desc" : "An object which contains an Array of row objects in the property specified\nin the config as 'root, and optionally a property, specified in the config as 'totalProperty'\nwhich contains the total size of the dataset.",
91           "isOptional" : false
92         }
93       ],
94       "returns" : [
95         {
96           "name" : "",
97           "type" : "Object",
98           "desc" : "data A data block which is used by an Roo.data.Store object as\na cache of Roo.data.Records."
99         }
100       ]
101     },
102     {
103       "name" : "read",
104       "type" : "function",
105       "desc" : "This method is only used by a DataProxy which has retrieved data from a remote server.",
106       "sig" : "(response)",
107       "static" : false,
108       "memberOf" : "",
109       "isStatic" : false,
110       "isConstructor" : false,
111       "isPrivate" : false,
112       "example" : "",
113       "deprecated" : "",
114       "since" : "",
115       "see" : "",
116       "exceptions" : "",
117       "requires" : "",
118       "params" : [
119         {
120           "name" : "response",
121           "type" : "Object",
122           "desc" : "The XHR object which contains the JSON data in its responseText.",
123           "isOptional" : false
124         }
125       ],
126       "returns" : [
127         {
128           "name" : "",
129           "type" : "Object",
130           "desc" : "data A data block which is used by an Roo.data.Store object as\na cache of Roo.data.Records."
131         }
132       ]
133     },
134     {
135       "name" : "newRow",
136       "type" : "function",
137       "desc" : "Create an empty record",
138       "sig" : "(data)",
139       "static" : false,
140       "memberOf" : "Roo.data.DataReader",
141       "isStatic" : false,
142       "isConstructor" : false,
143       "isPrivate" : false,
144       "example" : "",
145       "deprecated" : "",
146       "since" : "",
147       "see" : "",
148       "exceptions" : "",
149       "requires" : "",
150       "params" : [
151         {
152           "name" : "data",
153           "type" : "Object",
154           "desc" : "(optional) - overlay some values",
155           "isOptional" : false
156         }
157       ],
158       "returns" : [
159         {
160           "name" : "",
161           "type" : "Roo.data.Record",
162           "desc" : "record created."
163         }
164       ]
165     }
166   ],
167   "events" : []
168 }