Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / output / Ext.Object.js
1 Ext.data.JsonP.Ext_Object({
2   "allMixins": [
3
4   ],
5   "deprecated": null,
6   "docauthor": "Jacky Nguyen <jacky@sencha.com>",
7   "members": {
8     "cfg": [
9
10     ],
11     "method": [
12       {
13         "deprecated": null,
14         "alias": null,
15         "protected": false,
16         "tagname": "method",
17         "href": "Object.html#Ext-Object-method-each",
18         "shortDoc": "Iterate through an object and invoke the given callback function for each iteration. ...",
19         "static": false,
20         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
21         "private": false,
22         "params": [
23           {
24             "type": "Object",
25             "optional": false,
26             "doc": "<p>The object to iterate</p>\n",
27             "name": "object"
28           },
29           {
30             "type": "Function",
31             "optional": false,
32             "doc": "<p>The callback function. Passed arguments for each iteration are:</p>\n\n<ul>\n<li>{String} <code>key</code></li>\n<li>{Mixed} <code>value</code></li>\n<li>{Object} <code>object</code> The object itself</li>\n</ul>\n\n",
33             "name": "fn"
34           },
35           {
36             "type": "Object",
37             "optional": false,
38             "doc": "<p>(Optional) The execution scope (<code>this</code>) of the callback function</p>\n",
39             "name": "scope"
40           }
41         ],
42         "name": "each",
43         "owner": "Ext.Object",
44         "doc": "<p>Iterate through an object and invoke the given callback function for each iteration. The iteration can be stop\nby returning <code>false</code> in the callback function. For example:</p>\n\n<pre><code>var person = {\n    name: 'Jacky'\n    hairColor: 'black'\n    loves: ['food', 'sleeping', 'wife']\n};\n\nExt.Object.each(person, function(key, value, myself) {\n    console.log(key + \":\" + value);\n\n    if (key === 'hairColor') {\n        return false; // stop the iteration\n    }\n});\n</code></pre>\n",
45         "linenr": 275,
46         "return": {
47           "type": "void",
48           "doc": "\n"
49         },
50         "html_filename": "Object.html"
51       },
52       {
53         "deprecated": null,
54         "alias": null,
55         "protected": false,
56         "tagname": "method",
57         "href": "Object.html#Ext-Object-method-fromQueryString",
58         "shortDoc": "Converts a query string back into an object. ...",
59         "static": false,
60         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
61         "private": false,
62         "params": [
63           {
64             "type": "String",
65             "optional": false,
66             "doc": "<p>The query string to decode</p>\n",
67             "name": "queryString"
68           },
69           {
70             "type": "Boolean",
71             "optional": false,
72             "doc": "<p>(Optional) Whether or not to recursively decode the string. This format is supported by\nPHP / Ruby on Rails servers and similar. Defaults to false</p>\n",
73             "name": "recursive"
74           }
75         ],
76         "name": "fromQueryString",
77         "owner": "Ext.Object",
78         "doc": "<p>Converts a query string back into an object.</p>\n\n<ul>\n<li><p>Non-recursive:</p>\n\n<p>  Ext.Object.fromQueryString(foo=1&amp;bar=2); // returns {foo: 1, bar: 2}\n  Ext.Object.fromQueryString(foo=&amp;bar=2); // returns {foo: null, bar: 2}\n  Ext.Object.fromQueryString(some%20price=%24300); // returns {'some price': '$300'}\n  Ext.Object.fromQueryString(colors=red&amp;colors=green&amp;colors=blue); // returns {colors: ['red', 'green', 'blue']}</p></li>\n<li><p>Recursive:</p>\n\n<p>  Ext.Object.fromQueryString(\"username=Jacky&amp;dateOfBirth[day]=1&amp;dateOfBirth[month]=2&amp;dateOfBirth[year]=1911&amp;hobbies[0]=coding&amp;hobbies[1]=eating&amp;hobbies[2]=sleeping&amp;hobbies[3][0]=nested&amp;hobbies[3][1]=stuff\", true);</p>\n\n<p>  // returns\n  {</p>\n\n<pre><code>  username: 'Jacky',\n  dateOfBirth: {\n      day: '1',\n      month: '2',\n      year: '1911'\n  },\n  hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]\n</code></pre>\n\n<p>  }</p></li>\n</ul>\n\n",
79         "linenr": 156,
80         "return": {
81           "type": "Object",
82           "doc": "\n"
83         },
84         "html_filename": "Object.html"
85       },
86       {
87         "deprecated": null,
88         "alias": null,
89         "protected": false,
90         "tagname": "method",
91         "href": "Object.html#Ext-Object-method-getKey",
92         "shortDoc": "Returns the first matching key corresponding to the given value. ...",
93         "static": false,
94         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
95         "private": false,
96         "params": [
97           {
98             "type": "Object",
99             "optional": false,
100             "doc": "\n",
101             "name": "object"
102           },
103           {
104             "type": "Object",
105             "optional": false,
106             "doc": "<p>The value to find</p>\n",
107             "name": "value"
108           }
109         ],
110         "name": "getKey",
111         "owner": "Ext.Object",
112         "doc": "<p>Returns the first matching key corresponding to the given value.\nIf no matching value is found, null is returned.</p>\n\n<pre><code>var person = {\n    name: 'Jacky',\n    loves: 'food'\n};\n\nalert(Ext.Object.getKey(sencha, 'loves')); // alerts 'food'\n</code></pre>\n",
113         "linenr": 388,
114         "return": {
115           "type": "void",
116           "doc": "\n"
117         },
118         "html_filename": "Object.html"
119       },
120       {
121         "deprecated": null,
122         "alias": null,
123         "protected": false,
124         "tagname": "method",
125         "href": "Object.html#Ext-Object-method-getKeys",
126         "shortDoc": "Gets all keys of the given object as an array. ...",
127         "static": false,
128         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
129         "private": false,
130         "params": [
131           {
132             "type": "Object",
133             "optional": false,
134             "doc": "\n",
135             "name": "object"
136           }
137         ],
138         "name": "getKeys",
139         "owner": "Ext.Object",
140         "doc": "<p>Gets all keys of the given object as an array.</p>\n\n<pre><code>var values = Ext.Object.getKeys({\n    name: 'Jacky',\n    loves: 'food'\n}); // ['name', 'loves']\n</code></pre>\n",
141         "linenr": 438,
142         "return": {
143           "type": "Array",
144           "doc": "<p>An array of keys from the object</p>\n"
145         },
146         "html_filename": "Object.html"
147       },
148       {
149         "deprecated": null,
150         "alias": null,
151         "protected": false,
152         "tagname": "method",
153         "href": "Object.html#Ext-Object-method-getSize",
154         "shortDoc": "Gets the total number of this object's own properties\n\nvar size = Ext.Object.getSize({\n    name: 'Jacky',\n    loves: ...",
155         "static": false,
156         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
157         "private": false,
158         "params": [
159           {
160             "type": "Object",
161             "optional": false,
162             "doc": "\n",
163             "name": "object"
164           }
165         ],
166         "name": "getSize",
167         "owner": "Ext.Object",
168         "doc": "<p>Gets the total number of this object's own properties</p>\n\n<pre><code>var size = Ext.Object.getSize({\n    name: 'Jacky',\n    loves: 'food'\n}); // size equals 2\n</code></pre>\n",
169         "linenr": 463,
170         "return": {
171           "type": "Number",
172           "doc": "<p>size</p>\n"
173         },
174         "html_filename": "Object.html"
175       },
176       {
177         "deprecated": null,
178         "alias": null,
179         "protected": false,
180         "tagname": "method",
181         "href": "Object.html#Ext-Object-method-getValues",
182         "shortDoc": "Gets all values of the given object as an array. ...",
183         "static": false,
184         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
185         "private": false,
186         "params": [
187           {
188             "type": "Object",
189             "optional": false,
190             "doc": "\n",
191             "name": "object"
192           }
193         ],
194         "name": "getValues",
195         "owner": "Ext.Object",
196         "doc": "<p>Gets all values of the given object as an array.</p>\n\n<pre><code>var values = Ext.Object.getValues({\n    name: 'Jacky',\n    loves: 'food'\n}); // ['Jacky', 'food']\n</code></pre>\n",
197         "linenr": 413,
198         "return": {
199           "type": "Array",
200           "doc": "<p>An array of values from the object</p>\n"
201         },
202         "html_filename": "Object.html"
203       },
204       {
205         "deprecated": null,
206         "alias": null,
207         "protected": false,
208         "tagname": "method",
209         "href": "Object.html#Ext-Object-method-merge",
210         "shortDoc": "Merges any number of objects recursively without referencing them or their children. ...",
211         "static": false,
212         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
213         "private": false,
214         "params": [
215           {
216             "type": "Object",
217             "optional": false,
218             "doc": "<p>,...</p>\n",
219             "name": "object"
220           },
221           {
222             "type": "Object",
223             "optional": false,
224             "doc": "\n",
225             "name": "key"
226           },
227           {
228             "type": "Object",
229             "optional": false,
230             "doc": "\n",
231             "name": "value"
232           }
233         ],
234         "name": "merge",
235         "owner": "Ext.Object",
236         "doc": "<p>Merges any number of objects recursively without referencing them or their children.</p>\n\n<pre><code>var extjs = {\n    companyName: 'Ext JS',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer'],\n    isSuperCool: true\n    office: {\n        size: 2000,\n        location: 'Palo Alto',\n        isFun: true\n    }\n};\n\nvar newStuff = {\n    companyName: 'Sencha Inc.',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],\n    office: {\n        size: 40000,\n        location: 'Redwood City'\n    }\n};\n\nvar sencha = Ext.Object.merge(extjs, newStuff);\n\n// extjs and sencha then equals to\n{\n    companyName: 'Sencha Inc.',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],\n    isSuperCool: true\n    office: {\n        size: 30000,\n        location: 'Redwood City'\n        isFun: true\n    }\n}\n</code></pre>\n",
237         "linenr": 313,
238         "return": {
239           "type": "Object",
240           "doc": "<p>merged The object that is created as a result of merging all the objects passed in.</p>\n"
241         },
242         "html_filename": "Object.html"
243       },
244       {
245         "deprecated": null,
246         "alias": null,
247         "protected": false,
248         "tagname": "method",
249         "href": "Object.html#Ext-Object-method-toQueryObjects",
250         "shortDoc": "Convert a name - value pair to an array of objects with support for nested structures; useful to construct\nquery stri...",
251         "static": false,
252         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
253         "private": false,
254         "params": [
255           {
256             "type": "String",
257             "optional": false,
258             "doc": "\n",
259             "name": "name"
260           },
261           {
262             "type": "Mixed",
263             "optional": false,
264             "doc": "\n",
265             "name": "value"
266           },
267           {
268             "type": "Boolean",
269             "optional": false,
270             "doc": "\n",
271             "name": "recursive"
272           }
273         ],
274         "name": "toQueryObjects",
275         "owner": "Ext.Object",
276         "doc": "<p>Convert a <code>name</code> - <code>value</code> pair to an array of objects with support for nested structures; useful to construct\nquery strings. For example:</p>\n\n<pre><code>var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);\n\n// objects then equals:\n[\n    { name: 'hobbies', value: 'reading' },\n    { name: 'hobbies', value: 'cooking' },\n    { name: 'hobbies', value: 'swimming' },\n];\n\nvar objects = Ext.Object.toQueryObjects('dateOfBirth', {\n    day: 3,\n    month: 8,\n    year: 1987,\n    extra: {\n        hour: 4\n        minute: 30\n    }\n}, true); // Recursive\n\n// objects then equals:\n[\n    { name: 'dateOfBirth[day]', value: 3 },\n    { name: 'dateOfBirth[month]', value: 8 },\n    { name: 'dateOfBirth[year]', value: 1987 },\n    { name: 'dateOfBirth[extra][hour]', value: 4 },\n    { name: 'dateOfBirth[extra][minute]', value: 30 },\n];\n</code></pre>\n",
277         "linenr": 15,
278         "return": {
279           "type": "void",
280           "doc": "\n"
281         },
282         "html_filename": "Object.html"
283       },
284       {
285         "deprecated": null,
286         "alias": null,
287         "protected": false,
288         "tagname": "method",
289         "href": "Object.html#Ext-Object-method-toQueryString",
290         "shortDoc": "Takes an object and converts it to an encoded query string\n\n\nNon-recursive:\n\n  Ext.Object.toQueryString({foo: 1, bar:...",
291         "static": false,
292         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
293         "private": false,
294         "params": [
295           {
296             "type": "Object",
297             "optional": false,
298             "doc": "<p>The object to encode</p>\n",
299             "name": "object"
300           },
301           {
302             "type": "Boolean",
303             "optional": true,
304             "doc": "<p>(optional) Whether or not to interpret the object in recursive format.\n(PHP / Ruby on Rails servers and similar). Defaults to false</p>\n",
305             "name": "recursive"
306           }
307         ],
308         "name": "toQueryString",
309         "owner": "Ext.Object",
310         "doc": "<p>Takes an object and converts it to an encoded query string</p>\n\n<ul>\n<li><p>Non-recursive:</p>\n\n<p>  Ext.Object.toQueryString({foo: 1, bar: 2}); // returns \"foo=1&amp;bar=2\"\n  Ext.Object.toQueryString({foo: null, bar: 2}); // returns \"foo=&amp;bar=2\"\n  Ext.Object.toQueryString({'some price': '$300'}); // returns \"some%20price=%24300\"\n  Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns \"date=%222011-01-01T00%3A00%3A00%22\"\n  Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns \"colors=red&amp;colors=green&amp;colors=blue\"</p></li>\n<li><p>Recursive:</p>\n\n<p>  Ext.Object.toQueryString({</p>\n\n<pre><code>  username: 'Jacky',\n  dateOfBirth: {\n      day: 1,\n      month: 2,\n      year: 1911\n  },\n  hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]\n</code></pre>\n\n  }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):\n\n<pre><code>        // username=Jacky\n        //    &amp;dateOfBirth[day]=1&amp;dateOfBirth[month]=2&amp;dateOfBirth[year]=1911\n        //    &amp;hobbies[0]=coding&amp;hobbies[1]=eating&amp;hobbies[2]=sleeping&amp;hobbies[3][0]=nested&amp;hobbies[3][1]=stuff\n</code></pre></li>\n</ul>\n\n",
311         "linenr": 95,
312         "return": {
313           "type": "String",
314           "doc": "<p>queryString</p>\n"
315         },
316         "html_filename": "Object.html"
317       }
318     ],
319     "property": [
320
321     ],
322     "cssVar": [
323
324     ],
325     "cssMixin": [
326
327     ],
328     "event": [
329
330     ]
331   },
332   "singleton": true,
333   "alias": null,
334   "superclasses": [
335
336   ],
337   "protected": false,
338   "tagname": "class",
339   "mixins": [
340
341   ],
342   "href": "Object.html#Ext-Object",
343   "subclasses": [
344
345   ],
346   "static": false,
347   "author": "Jacky Nguyen <jacky@sencha.com>",
348   "component": false,
349   "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/lang/Object.js",
350   "private": false,
351   "alternateClassNames": [
352
353   ],
354   "name": "Ext.Object",
355   "doc": "<p>A collection of useful static methods to deal with objects</p>\n",
356   "mixedInto": [
357
358   ],
359   "linenr": 1,
360   "xtypes": [
361
362   ],
363   "html_filename": "Object.html",
364   "extends": null
365 });