Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / output / Ext.data.writer.Json.js
1 Ext.data.JsonP.Ext_data_writer_Json({
2   "tagname": "class",
3   "name": "Ext.data.writer.Json",
4   "doc": "<p>This class is used to write <a href=\"#/api/Ext.data.Model\" rel=\"Ext.data.Model\" class=\"docClass\">Ext.data.Model</a> data to the server in a JSON format.\nThe <a href=\"#/api/Ext.data.writer.Json-cfg-allowSingle\" rel=\"Ext.data.writer.Json-cfg-allowSingle\" class=\"docClass\">allowSingle</a> configuration can be set to false to force the records to always be\nencoded in an array, even if there is only a single record being sent.</p>\n",
5   "extends": "Ext.data.writer.Writer",
6   "mixins": [
7
8   ],
9   "alternateClassNames": [
10     "Ext.data.JsonWriter"
11   ],
12   "xtype": null,
13   "author": null,
14   "docauthor": null,
15   "singleton": false,
16   "private": false,
17   "cfg": [
18     {
19       "tagname": "cfg",
20       "name": "allowSingle",
21       "member": "Ext.data.writer.Json",
22       "type": "Boolean",
23       "doc": "<p>False to ensure that records are always wrapped in an array, even if there is only\none record being sent. When there is more than one record, they will always be encoded into an array.\nDefaults to <tt>true</tt>. Example:</p>\n\n<pre><code>// with allowSingle: true\n\"root\": {\n    \"first\": \"Mark\",\n    \"last\": \"Corrigan\"\n}\n\n// with allowSingle: false\n\"root\": [{\n    \"first\": \"Mark\",\n    \"last\": \"Corrigan\"\n}]\n</code></pre>\n\n",
24       "private": false,
25       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Json.js",
26       "linenr": 33,
27       "html_filename": "Json2.html",
28       "href": "Json2.html#Ext-data-writer-Json-cfg-allowSingle",
29       "shortDoc": "False to ensure that records are always wrapped in an array, even if there is only\none record being sent. When there ..."
30     },
31     {
32       "tagname": "cfg",
33       "name": "encode",
34       "member": "Ext.data.writer.Json",
35       "type": "Boolean",
36       "doc": "<p>True to use Ext.encode() on the data before sending. Defaults to <tt>false</tt>.\nThe encode option should only be set to true when a <a href=\"#/api/Ext.data.writer.Json-cfg-root\" rel=\"Ext.data.writer.Json-cfg-root\" class=\"docClass\">root</a> is defined, because the values will be\nsent as part of the request parameters as opposed to a raw post. The root will be the name of the parameter\nsent to the server.</p>\n",
37       "private": false,
38       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Json.js",
39       "linenr": 25,
40       "html_filename": "Json2.html",
41       "href": "Json2.html#Ext-data-writer-Json-cfg-encode",
42       "shortDoc": "True to use Ext.encode() on the data before sending. Defaults to false.\nThe encode option should only be set to true ..."
43     },
44     {
45       "tagname": "cfg",
46       "name": "nameProperty",
47       "member": "Ext.data.writer.Writer",
48       "type": "String",
49       "doc": "<p>This property is used to read the key for each value that will be sent to the server.\nFor example:</p>\n\n<pre><code>Ext.define('Person', {\n    extend: 'Ext.data.Model',\n    fields: [{\n        name: 'first',\n        mapping: 'firstName'\n    }, {\n        name: 'last',\n        mapping: 'lastName'\n    }, {\n        name: 'age'\n    }]\n});\nnew Ext.data.writer.Writer({\n    writeAllFields: true,\n    nameProperty: 'mapping'\n});\n\n// This will be sent to the server\n{\n    firstName: 'first name value',\n    lastName: 'last name value',\n    age: 1\n}\n\n</code></pre>\n\n\n<p>Defaults to <tt>name</tt>. If the value is not present, the field name will always be used.</p>\n",
50       "private": false,
51       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Writer.js",
52       "linenr": 32,
53       "html_filename": "Writer.html",
54       "href": "Writer.html#Ext-data-writer-Writer-cfg-nameProperty",
55       "shortDoc": "This property is used to read the key for each value that will be sent to the server.\nFor example:\n\nExt.define('Perso..."
56     },
57     {
58       "tagname": "cfg",
59       "name": "root",
60       "member": "Ext.data.writer.Json",
61       "type": "String",
62       "doc": "<p>The key under which the records in this Writer will be placed. Defaults to <tt>undefined</tt>.\nExample generated request, using root: 'records':</p>\n\n<pre><code>{'records': [{name: 'my record'}, {name: 'another record'}]}\n</code></pre>\n\n",
63       "private": false,
64       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Json.js",
65       "linenr": 16,
66       "html_filename": "Json2.html",
67       "href": "Json2.html#Ext-data-writer-Json-cfg-root",
68       "shortDoc": "The key under which the records in this Writer will be placed. Defaults to undefined.\nExample generated request, usin..."
69     },
70     {
71       "tagname": "cfg",
72       "name": "writeAllFields",
73       "member": "Ext.data.writer.Writer",
74       "type": "Boolean",
75       "doc": "<p>True to write all fields from the record to the server. If set to false it\nwill only send the fields that were modified. Defaults to <tt>true</tt>. Note that any fields that have\n<a href=\"#/api/Ext.data.Field-cfg-persist\" rel=\"Ext.data.Field-cfg-persist\" class=\"docClass\">Ext.data.Field.persist</a> set to false will still be ignored.</p>\n",
76       "private": false,
77       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Writer.js",
78       "linenr": 25,
79       "html_filename": "Writer.html",
80       "href": "Writer.html#Ext-data-writer-Writer-cfg-writeAllFields",
81       "shortDoc": "True to write all fields from the record to the server. If set to false it\nwill only send the fields that were modifi..."
82     }
83   ],
84   "method": [
85     {
86       "tagname": "method",
87       "name": "Json",
88       "member": "Ext.data.writer.Writer",
89       "doc": "\n",
90       "params": [
91         {
92           "type": "Object",
93           "name": "config",
94           "doc": "<p>Optional config object</p>\n",
95           "optional": false
96         }
97       ],
98       "return": {
99         "type": "void",
100         "doc": "\n"
101       },
102       "private": false,
103       "static": false,
104       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Writer.js",
105       "linenr": 1,
106       "html_filename": "Writer.html",
107       "href": "Writer.html#Ext-data-writer-Writer-method-constructor",
108       "shortDoc": "\n"
109     },
110     {
111       "tagname": "method",
112       "name": "getRecordData",
113       "member": "Ext.data.writer.Writer",
114       "doc": "<p>Formats the data for each record before sending it to the server. This\nmethod should be overridden to format the data in a way that differs from the default.</p>\n",
115       "params": [
116         {
117           "type": "Object",
118           "name": "record",
119           "doc": "<p>The record that we are writing to the server.</p>\n",
120           "optional": false
121         }
122       ],
123       "return": {
124         "type": "Object",
125         "doc": "<p>An object literal of name/value keys to be written to the server.\nBy default this method returns the data property on the record.</p>\n"
126       },
127       "private": false,
128       "static": false,
129       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Writer.js",
130       "linenr": 87,
131       "html_filename": "Writer.html",
132       "href": "Writer.html#Ext-data-writer-Writer-method-getRecordData",
133       "shortDoc": "Formats the data for each record before sending it to the server. This\nmethod should be overridden to format the data..."
134     },
135     {
136       "tagname": "method",
137       "name": "write",
138       "member": "Ext.data.writer.Writer",
139       "doc": "<p>Prepares a Proxy's <a href=\"#/api/Ext.data.Request\" rel=\"Ext.data.Request\" class=\"docClass\">Ext.data.Request</a> object</p>\n",
140       "params": [
141         {
142           "type": "Ext.data.Request",
143           "name": "request",
144           "doc": "<p>The request object</p>\n",
145           "optional": false
146         }
147       ],
148       "return": {
149         "type": "Ext.data.Request",
150         "doc": "<p>The modified request object</p>\n"
151       },
152       "private": false,
153       "static": false,
154       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Writer.js",
155       "linenr": 69,
156       "html_filename": "Writer.html",
157       "href": "Writer.html#Ext-data-writer-Writer-method-write",
158       "shortDoc": "<p>Prepares a Proxy's <a href=\"#/api/Ext.data.Request\" rel=\"Ext.data.Request\" class=\"docClass\">Ext.data.Request</a> object</p>\n"
159     }
160   ],
161   "property": [
162
163   ],
164   "event": [
165
166   ],
167   "filename": "/Users/nick/Projects/sencha/SDK/platform/src/data/writer/Json.js",
168   "linenr": 1,
169   "html_filename": "Json2.html",
170   "href": "Json2.html#Ext-data-writer-Json",
171   "cssVar": [
172
173   ],
174   "cssMixin": [
175
176   ],
177   "component": false,
178   "superclasses": [
179     "Ext.data.writer.Writer"
180   ],
181   "subclasses": [
182
183   ],
184   "mixedInto": [
185
186   ],
187   "allMixins": [
188
189   ]
190 });