c263b327fe1d4848953ae94c50a1fbce3df3bbcf
[roojs1] / docs / symbols / Roo.data.XmlReader.json
1 {
2   "name" : "Roo.data.XmlReader",
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 {@link Roo.data.Record} objects from an XML document\nbased on mappings in a provided Roo.data.Record constructor.<br><br>\n<p>\n<em>Note that in order for the browser to parse a returned XML document, the Content-Type\nheader in the HTTP response must be set to \"text/xml\".</em>\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.XmlReader({\n   totalRecords: \"results\", // The element which contains the total dataset size (optional)\n   record: \"row\",           // The repeated element which contains row information\n   id: \"id\"                 // The element within the row that provides an ID for the record (optional)\n}, RecordDef);\n</code></pre>\n<p>\nThis would consume an XML file like this:\n<pre><code>\n&lt;?xml?>\n&lt;dataset>\n &lt;results>2&lt;/results>\n &lt;row>\n   &lt;id>1&lt;/id>\n   &lt;name>Bill&lt;/name>\n   &lt;occupation>Gardener&lt;/occupation>\n &lt;/row>\n &lt;row>\n   &lt;id>2&lt;/id>\n   &lt;name>Ben&lt;/name>\n   &lt;occupation>Horticulturalist&lt;/occupation>\n &lt;/row>\n&lt;/dataset>\n</code></pre>",
10   "isSingleton" : false,
11   "isStatic" : false,
12   "isBuiltin" : false,
13   "isAbstract" : false,
14   "isBuilderTop" : false,
15   "memberOf" : "XmlReader",
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" : "Mixed",
30       "desc" : "The definition of the data record type to produce.  This can be either a valid\nRecord subclass created with {@link Roo.data.Record#create}, or an array of objects with which to call\nRoo.data.Record.create.  See the {@link Roo.data.Record} class for more details.",
31       "isOptional" : false
32     }
33   ],
34   "returns" : [],
35   "throws" : "",
36   "requires" : "",
37   "config" : [
38     {
39       "name" : "id",
40       "type" : "String",
41       "desc" : "The DomQuery path relative from the record element to the element that contains\na record identifier value.",
42       "memberOf" : "Roo.data.XmlReader"
43     },
44     {
45       "name" : "success",
46       "type" : "String",
47       "desc" : "The DomQuery path to the success attribute used by forms.",
48       "memberOf" : "Roo.data.XmlReader"
49     },
50     {
51       "name" : "record",
52       "type" : "String",
53       "desc" : "The DomQuery path to the repeated element which contains record information.",
54       "memberOf" : "Roo.data.XmlReader"
55     },
56     {
57       "name" : "totalRecords",
58       "type" : "String",
59       "desc" : "The DomQuery path 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.",
60       "memberOf" : "Roo.data.XmlReader"
61     }
62   ],
63   "methods" : [
64     {
65       "name" : "read",
66       "type" : "function",
67       "desc" : "This method is only used by a DataProxy which has retrieved data from a remote server.",
68       "sig" : "(response)",
69       "static" : false,
70       "memberOf" : "",
71       "isStatic" : false,
72       "isConstructor" : false,
73       "isPrivate" : false,
74       "example" : "",
75       "deprecated" : "",
76       "since" : "",
77       "see" : "",
78       "exceptions" : "",
79       "requires" : "",
80       "params" : [
81         {
82           "name" : "response",
83           "type" : "Object",
84           "desc" : "The XHR object which contains the parsed XML document.  The response is expected\nto contain a method called 'responseXML' that returns an XML document object.",
85           "isOptional" : false
86         }
87       ],
88       "returns" : [
89         {
90           "name" : "",
91           "type" : "Object",
92           "desc" : "records A data block which is used by an {@link Roo.data.Store} as\na cache of Roo.data.Records."
93         }
94       ]
95     },
96     {
97       "name" : "readRecords",
98       "type" : "function",
99       "desc" : "Create a data block containing Roo.data.Records from an XML document.",
100       "sig" : "(doc)",
101       "static" : false,
102       "memberOf" : "",
103       "isStatic" : false,
104       "isConstructor" : false,
105       "isPrivate" : false,
106       "example" : "",
107       "deprecated" : "",
108       "since" : "",
109       "see" : "",
110       "exceptions" : "",
111       "requires" : "",
112       "params" : [
113         {
114           "name" : "doc",
115           "type" : "Object",
116           "desc" : "A parsed XML document.",
117           "isOptional" : false
118         }
119       ],
120       "returns" : [
121         {
122           "name" : "",
123           "type" : "Object",
124           "desc" : "records A data block which is used by an {@link Roo.data.Store} as\na cache of Roo.data.Records."
125         }
126       ]
127     },
128     {
129       "name" : "newRow",
130       "type" : "function",
131       "desc" : "Create an empty record",
132       "sig" : "(data)",
133       "static" : false,
134       "memberOf" : "Roo.data.DataReader",
135       "isStatic" : false,
136       "isConstructor" : false,
137       "isPrivate" : false,
138       "example" : "",
139       "deprecated" : "",
140       "since" : "",
141       "see" : "",
142       "exceptions" : "",
143       "requires" : "",
144       "params" : [
145         {
146           "name" : "data",
147           "type" : "Object",
148           "desc" : "(optional) - overlay some values",
149           "isOptional" : false
150         }
151       ],
152       "returns" : [
153         {
154           "name" : "",
155           "type" : "Roo.data.Record",
156           "desc" : "record created."
157         }
158       ]
159     }
160   ],
161   "events" : []
162 }