Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / output / Ext.ModelManager.js
1 Ext.data.JsonP.Ext_ModelManager({
2   "allMixins": [
3
4   ],
5   "deprecated": null,
6   "docauthor": null,
7   "members": {
8     "cfg": [
9
10     ],
11     "method": [
12       {
13         "deprecated": null,
14         "alias": null,
15         "protected": false,
16         "tagname": "method",
17         "href": "ModelManager.html#Ext-ModelManager-method-create",
18         "shortDoc": "Creates a new instance of a Model using the given data. ...",
19         "static": false,
20         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/ModelManager.js",
21         "private": false,
22         "params": [
23           {
24             "type": "Object",
25             "optional": false,
26             "doc": "<p>Data to initialize the Model's fields with</p>\n",
27             "name": "data"
28           },
29           {
30             "type": "String",
31             "optional": false,
32             "doc": "<p>The name of the model to create</p>\n",
33             "name": "name"
34           },
35           {
36             "type": "Number",
37             "optional": false,
38             "doc": "<p>Optional unique id of the Model instance (see <a href=\"#/api/Ext.data.Model\" rel=\"Ext.data.Model\" class=\"docClass\">Ext.data.Model</a>)</p>\n",
39             "name": "id"
40           }
41         ],
42         "name": "create",
43         "owner": "Ext.ModelManager",
44         "doc": "<p>Creates a new instance of a Model using the given data.</p>\n",
45         "linenr": 135,
46         "return": {
47           "type": "void",
48           "doc": "\n"
49         },
50         "html_filename": "ModelManager.html"
51       },
52       {
53         "deprecated": null,
54         "alias": null,
55         "protected": false,
56         "tagname": "method",
57         "href": "AbstractManager.html#Ext-AbstractManager-method-each",
58         "shortDoc": "Executes the specified function once for each item in the collection. ...",
59         "static": false,
60         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
61         "private": false,
62         "params": [
63           {
64             "type": "Object",
65             "optional": false,
66             "doc": "<p>The function to execute.</p>\n",
67             "name": "fn"
68           },
69           {
70             "type": "Object",
71             "optional": false,
72             "doc": "<p>The scope to execute in. Defaults to <tt>this</tt>.</p>\n",
73             "name": "scope"
74           }
75         ],
76         "name": "each",
77         "owner": "Ext.AbstractManager",
78         "doc": "<p>Executes the specified function once for each item in the collection.\nReturning false from the function will cease iteration.</p>\n\n<p>The paramaters passed to the function are:</p>\n\n<div class=\"mdetail-params\"><ul>\n<li><b>key</b> : String<p class=\"sub-desc\">The key of the item</p></li>\n<li><b>value</b> : Number<p class=\"sub-desc\">The value of the item</p></li>\n<li><b>length</b> : Number<p class=\"sub-desc\">The total number of items in the collection</p></li>\n</ul></div>\n\n",
79         "linenr": 116,
80         "return": {
81           "type": "void",
82           "doc": "\n"
83         },
84         "html_filename": "AbstractManager.html"
85       },
86       {
87         "deprecated": null,
88         "alias": null,
89         "protected": false,
90         "tagname": "method",
91         "href": "AbstractManager.html#Ext-AbstractManager-method-get",
92         "shortDoc": "Returns an item by id. ...",
93         "static": false,
94         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
95         "private": false,
96         "params": [
97           {
98             "type": "String",
99             "optional": false,
100             "doc": "<p>The id of the item</p>\n",
101             "name": "id"
102           }
103         ],
104         "name": "get",
105         "owner": "Ext.AbstractManager",
106         "doc": "<p>Returns an item by id.\nFor additional details see <a href=\"#/api/Ext.util.HashMap-method-get\" rel=\"Ext.util.HashMap-method-get\" class=\"docClass\">Ext.util.HashMap.get</a>.</p>\n",
107         "linenr": 29,
108         "return": {
109           "type": "Mixed",
110           "doc": "<p>The item, <code>undefined</code> if not found.</p>\n"
111         },
112         "html_filename": "AbstractManager.html"
113       },
114       {
115         "deprecated": null,
116         "alias": null,
117         "protected": false,
118         "tagname": "method",
119         "href": "AbstractManager.html#Ext-AbstractManager-method-getCount",
120         "shortDoc": "Gets the number of items in the collection. ...",
121         "static": false,
122         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
123         "private": false,
124         "params": [
125
126         ],
127         "name": "getCount",
128         "owner": "Ext.AbstractManager",
129         "doc": "<p>Gets the number of items in the collection.</p>\n",
130         "linenr": 133,
131         "return": {
132           "type": "Number",
133           "doc": "<p>The number of items in the collection.</p>\n"
134         },
135         "html_filename": "AbstractManager.html"
136       },
137       {
138         "deprecated": null,
139         "alias": null,
140         "protected": false,
141         "tagname": "method",
142         "href": "ModelManager.html#Ext-ModelManager-method-getModel",
143         "shortDoc": "Returns the Ext.data.Model for a given model name ...",
144         "static": false,
145         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/ModelManager.js",
146         "private": false,
147         "params": [
148           {
149             "type": "String/Object",
150             "optional": false,
151             "doc": "<p>The id of the model or the model instance.</p>\n",
152             "name": "id"
153           }
154         ],
155         "name": "getModel",
156         "owner": "Ext.ModelManager",
157         "doc": "<p>Returns the <a href=\"#/api/Ext.data.Model\" rel=\"Ext.data.Model\" class=\"docClass\">Ext.data.Model</a> for a given model name</p>\n",
158         "linenr": 123,
159         "return": {
160           "type": "void",
161           "doc": "\n"
162         },
163         "html_filename": "ModelManager.html"
164       },
165       {
166         "deprecated": null,
167         "alias": null,
168         "protected": false,
169         "tagname": "method",
170         "href": "AbstractManager.html#Ext-AbstractManager-method-isRegistered",
171         "shortDoc": "Checks if an item type is registered. ...",
172         "static": false,
173         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
174         "private": false,
175         "params": [
176           {
177             "type": "String",
178             "optional": false,
179             "doc": "<p>The mnemonic string by which the class may be looked up</p>\n",
180             "name": "type"
181           }
182         ],
183         "name": "isRegistered",
184         "owner": "Ext.AbstractManager",
185         "doc": "<p>Checks if an item type is registered.</p>\n",
186         "linenr": 65,
187         "return": {
188           "type": "Boolean",
189           "doc": "<p>Whether the type is registered.</p>\n"
190         },
191         "html_filename": "AbstractManager.html"
192       },
193       {
194         "deprecated": null,
195         "alias": null,
196         "protected": false,
197         "tagname": "method",
198         "href": "AbstractManager.html#Ext-AbstractManager-method-onAvailable",
199         "shortDoc": "Registers a function that will be called when an item with the specified id is added to the manager. ...",
200         "static": false,
201         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
202         "private": false,
203         "params": [
204           {
205             "type": "String",
206             "optional": false,
207             "doc": "<p>The item id</p>\n",
208             "name": "id"
209           },
210           {
211             "type": "Function",
212             "optional": false,
213             "doc": "<p>The callback function. Called with a single parameter, the item.</p>\n",
214             "name": "fn"
215           },
216           {
217             "type": "Object",
218             "optional": false,
219             "doc": "<p>The scope (<code>this</code> reference) in which the callback is executed. Defaults to the item.</p>\n",
220             "name": "scope"
221           }
222         ],
223         "name": "onAvailable",
224         "owner": "Ext.AbstractManager",
225         "doc": "<p>Registers a function that will be called when an item with the specified id is added to the manager. This will happen on instantiation.</p>\n",
226         "linenr": 93,
227         "return": {
228           "type": "void",
229           "doc": "\n"
230         },
231         "html_filename": "AbstractManager.html"
232       },
233       {
234         "deprecated": null,
235         "alias": null,
236         "protected": false,
237         "tagname": "method",
238         "href": "AbstractManager.html#Ext-AbstractManager-method-register",
239         "shortDoc": "Registers an item to be managed ...",
240         "static": false,
241         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
242         "private": false,
243         "params": [
244           {
245             "type": "Mixed",
246             "optional": false,
247             "doc": "<p>The item to register</p>\n",
248             "name": "item"
249           }
250         ],
251         "name": "register",
252         "owner": "Ext.AbstractManager",
253         "doc": "<p>Registers an item to be managed</p>\n",
254         "linenr": 39,
255         "return": {
256           "type": "void",
257           "doc": "\n"
258         },
259         "html_filename": "AbstractManager.html"
260       },
261       {
262         "deprecated": null,
263         "alias": null,
264         "protected": false,
265         "tagname": "method",
266         "href": "AbstractManager.html#Ext-AbstractManager-method-registerType",
267         "shortDoc": "Registers a new item constructor, keyed by a type key. ...",
268         "static": false,
269         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
270         "private": false,
271         "params": [
272           {
273             "type": "String",
274             "optional": false,
275             "doc": "<p>The mnemonic string by which the class may be looked up.</p>\n",
276             "name": "type"
277           },
278           {
279             "type": "Constructor",
280             "optional": false,
281             "doc": "<p>The new instance class.</p>\n",
282             "name": "cls"
283           }
284         ],
285         "name": "registerType",
286         "owner": "Ext.AbstractManager",
287         "doc": "<p>Registers a new item constructor, keyed by a type key.\n\n",
288         "linenr": 55,
289         "return": {
290           "type": "void",
291           "doc": "\n"
292         },
293         "html_filename": "AbstractManager.html"
294       },
295       {
296         "deprecated": null,
297         "alias": null,
298         "protected": false,
299         "tagname": "method",
300         "href": "AbstractManager.html#Ext-AbstractManager-method-unregister",
301         "shortDoc": "Unregisters an item by removing it from this manager ...",
302         "static": false,
303         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
304         "private": false,
305         "params": [
306           {
307             "type": "Mixed",
308             "optional": false,
309             "doc": "<p>The item to unregister</p>\n",
310             "name": "item"
311           }
312         ],
313         "name": "unregister",
314         "owner": "Ext.AbstractManager",
315         "doc": "<p>Unregisters an item by removing it from this manager</p>\n",
316         "linenr": 47,
317         "return": {
318           "type": "void",
319           "doc": "\n"
320         },
321         "html_filename": "AbstractManager.html"
322       }
323     ],
324     "property": [
325       {
326         "type": "Ext.util.MixedCollection",
327         "deprecated": null,
328         "alias": null,
329         "protected": false,
330         "tagname": "property",
331         "href": "AbstractManager.html#Ext-AbstractManager-property-all",
332         "static": false,
333         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/AbstractManager.js",
334         "private": false,
335         "name": "all",
336         "owner": "Ext.AbstractManager",
337         "doc": "<p>Contains all of the items currently managed</p>\n",
338         "linenr": 19,
339         "html_filename": "AbstractManager.html"
340       },
341       {
342         "type": "Array",
343         "deprecated": null,
344         "alias": null,
345         "protected": false,
346         "tagname": "property",
347         "href": "ModelManager.html#Ext-ModelManager-property-associationStack",
348         "static": false,
349         "filename": "/mnt/ebs/nightly/git/SDK/platform/src/ModelManager.js",
350         "private": false,
351         "name": "associationStack",
352         "owner": "Ext.ModelManager",
353         "doc": "<p>Private stack of associations that must be created once their associated model has been defined</p>\n",
354         "linenr": 56,
355         "html_filename": "ModelManager.html"
356       }
357     ],
358     "cssVar": [
359
360     ],
361     "cssMixin": [
362
363     ],
364     "event": [
365
366     ]
367   },
368   "singleton": true,
369   "alias": null,
370   "superclasses": [
371     "Ext.AbstractManager"
372   ],
373   "protected": false,
374   "tagname": "class",
375   "mixins": [
376
377   ],
378   "href": "ModelManager.html#Ext-ModelManager",
379   "subclasses": [
380
381   ],
382   "static": false,
383   "author": "Ed Spencer",
384   "component": false,
385   "filename": "/mnt/ebs/nightly/git/SDK/platform/src/ModelManager.js",
386   "private": false,
387   "alternateClassNames": [
388     "Ext.ModelMgr"
389   ],
390   "name": "Ext.ModelManager",
391   "doc": "<p>The ModelManager keeps track of all <a href=\"#/api/Ext.data.Model\" rel=\"Ext.data.Model\" class=\"docClass\">Ext.data.Model</a> types defined in your application.</p>\n\n<p><strong>Creating Model Instances</strong>\nModel instances can be created by using the <a href=\"#/api/Ext.ModelManager-method-create\" rel=\"Ext.ModelManager-method-create\" class=\"docClass\">create</a> function. It is also possible to do\nthis by using the Model type directly. The following snippets are equivalent:</p>\n\n<pre><code>Ext.define('User', {\n    extend: 'Ext.data.Model',\n    fields: ['first', 'last']\n});\n\n// method 1, create through the manager\nExt.ModelManager.create({\n    first: 'Ed',\n    last: 'Spencer'\n}, 'User');\n\n// method 2, create on the type directly\nnew User({\n    first: 'Ed',\n    last: 'Spencer'\n});\n</code></pre>\n\n<p><strong>Accessing Model Types</strong>\nA reference to a Model type can be obtained by using the <a href=\"#/api/Ext.ModelManager-method-getModel\" rel=\"Ext.ModelManager-method-getModel\" class=\"docClass\">getModel</a> function. Since models types\nare normal classes, you can access the type directly. The following snippets are equivalent:</p>\n\n<pre><code>Ext.define('User', {\n    extend: 'Ext.data.Model',\n    fields: ['first', 'last']\n});\n\n// method 1, access model type through the manager\nvar UserType = Ext.ModelManager.getModel('User');\n\n// method 2, reference the type directly\nvar UserType = User;\n</code></pre>\n",
392   "mixedInto": [
393
394   ],
395   "linenr": 1,
396   "xtypes": [
397
398   ],
399   "html_filename": "ModelManager.html",
400   "extends": "Ext.AbstractManager"
401 });