Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / output / Ext.app.Application.js
1 Ext.data.JsonP.Ext_app_Application({
2   "tagname": "class",
3   "name": "Ext.app.Application",
4   "doc": "<p>Represents an <a href=\"#/api/Ext\" rel=\"Ext\" class=\"docClass\">Ext</a> JS 4 application, which is typically a single page app using a <a href=\"#/api/Ext.container.Viewport\" rel=\"Ext.container.Viewport\" class=\"docClass\">Viewport</a>.\nA typical <a href=\"#/api/Ext.app.Application\" rel=\"Ext.app.Application\" class=\"docClass\">Ext.app.Application</a> might look like this:</p>\n\n<pre><code>Ext.application({\n    name: 'MyApp',\n    launch: function() {\n        Ext.create('Ext.container.Viewport', {\n            items: {\n                html: 'My App'\n            }\n        });\n    }\n});\n</code></pre>\n\n<p>This does several things. First it creates a global variable called 'MyApp' - all of your Application's classes (such\nas its Models, Views and Controllers) will reside under this single namespace, which drastically lowers the chances\nof colliding global variables.</p>\n\n<p>When the page is ready and all of your JavaScript has loaded, your Application's <a href=\"#/api/Ext.app.Application-property-launch\" rel=\"Ext.app.Application-property-launch\" class=\"docClass\">launch</a> function is called,\nat which time you can run the code that starts your app. Usually this consists of creating a Viewport, as we do in\nthe example above.</p>\n\n<p><u>Telling Application about the rest of the app</u></p>\n\n<p>Because an <a href=\"#/api/Ext.app.Application\" rel=\"Ext.app.Application\" class=\"docClass\">Ext.app.Application</a> represents an entire app, we should tell it about the other parts of the app - namely\nthe Models, Views and Controllers that are bundled with the application. Let's say we have a blog management app; we\nmight have Models and Controllers for Posts and Comments, and Views for listing, adding and editing Posts and Comments.\nHere's how we'd tell our Application about all these things:</p>\n\n<pre><code>Ext.application({\n    name: 'Blog',\n    models: ['Post', 'Comment'],\n    controllers: ['Posts', 'Comments'],\n\n    launch: function() {\n        ...\n    }\n});\n</code></pre>\n\n<p>Note that we didn't actually list the Views directly in the Application itself. This is because Views are managed by\nControllers, so it makes sense to keep those dependencies there. The Application will load each of the specified\nControllers using the pathing conventions laid out in the <a href=\"../guide/application_architecture\">application\narchitecture guide</a> - in this case expecting the controllers to reside in app/controller/Posts.js and\napp/controller/Comments.js. In turn, each Controller simply needs to list the Views it uses and they will be\nautomatically loaded. Here's how our Posts controller like be defined:</p>\n\n<pre><code>Ext.define('MyApp.controller.Posts', {\n    extend: 'Ext.app.Controller',\n    views: ['posts.List', 'posts.Edit'],\n\n    //the rest of the Controller here\n});\n</code></pre>\n\n<p>Because we told our Application about our Models and Controllers, and our Controllers about their Views, Ext JS will\nautomatically load all of our app files for us. This means we don't have to manually add script tags into our html\nfiles whenever we add a new class, but more importantly it enables us to create a minimized build of our entire\napplication using the <a href=\"#/api/Ext\" rel=\"Ext\" class=\"docClass\">Ext</a> JS 4 SDK Tools.</p>\n\n<p>For more information about writing <a href=\"#/api/Ext\" rel=\"Ext\" class=\"docClass\">Ext</a> JS 4 applications, please see the <a href=\"../guide/application_architecture\">\napplication architecture guide</a>.</p>\n",
5   "extends": "Ext.app.Controller",
6   "mixins": [
7
8   ],
9   "alternateClassNames": [
10
11   ],
12   "xtype": null,
13   "author": null,
14   "docauthor": "Ed Spencer",
15   "singleton": false,
16   "private": false,
17   "cfg": [
18     {
19       "tagname": "cfg",
20       "name": "appFolder",
21       "member": "Ext.app.Application",
22       "type": "String",
23       "doc": "<p>The path to the directory which contains all application's classes.\nThis path will be registered via <a href=\"#/api/Ext.Loader-method-setPath\" rel=\"Ext.Loader-method-setPath\" class=\"docClass\">Ext.Loader.setPath</a> for the namespace specified in the <a href=\"#/api/Ext.app.Application-cfg-name\" rel=\"Ext.app.Application-cfg-name\" class=\"docClass\">name</a> config.\nDefaults to 'app'</p>\n",
24       "private": false,
25       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
26       "linenr": 101,
27       "html_filename": "Application.html",
28       "href": "Application.html#Ext-app-Application-cfg-appFolder",
29       "shortDoc": "The path to the directory which contains all application's classes.\nThis path will be registered via Ext.Loader.setPa..."
30     },
31     {
32       "tagname": "cfg",
33       "name": "autoCreateViewport",
34       "member": "Ext.app.Application",
35       "type": "Boolean",
36       "doc": "<p>True to automatically load and instantiate AppName.view.Viewport\nbefore firing the launch function (defaults to false).</p>\n",
37       "private": false,
38       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
39       "linenr": 108,
40       "html_filename": "Application.html",
41       "href": "Application.html#Ext-app-Application-cfg-autoCreateViewport"
42     },
43     {
44       "tagname": "cfg",
45       "name": "defaultUrl",
46       "member": "Ext.app.Application",
47       "type": "String",
48       "doc": "<p>When the app is first loaded, this url will be redirected to. Defaults to undefined</p>\n",
49       "private": false,
50       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
51       "linenr": 97,
52       "html_filename": "Application.html",
53       "href": "Application.html#Ext-app-Application-cfg-defaultUrl"
54     },
55     {
56       "tagname": "cfg",
57       "name": "enableQuickTips",
58       "member": "Ext.app.Application",
59       "type": "Boolean",
60       "doc": "<p>True to automatically set up <a href=\"#/api/Ext.tip.QuickTip\" rel=\"Ext.tip.QuickTip\" class=\"docClass\">Ext.tip.QuickTip</a> support (defaults to true)</p>\n",
61       "private": false,
62       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
63       "linenr": 92,
64       "html_filename": "Application.html",
65       "href": "Application.html#Ext-app-Application-cfg-enableQuickTips"
66     },
67     {
68       "tagname": "cfg",
69       "name": "id",
70       "member": "Ext.app.Controller",
71       "type": "String",
72       "doc": "<p>The id of this controller. You can use this id when dispatching.</p>\n",
73       "private": false,
74       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Controller.js",
75       "linenr": 136,
76       "html_filename": "Controller.html",
77       "href": "Controller.html#Ext-app-Controller-cfg-id"
78     },
79     {
80       "tagname": "cfg",
81       "name": "name",
82       "member": "Ext.app.Application",
83       "type": "String",
84       "doc": "<p>The name of your application. This will also be the namespace for your views, controllers\nmodels and stores. Don't use spaces or special characters in the name.</p>\n",
85       "private": false,
86       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
87       "linenr": 81,
88       "html_filename": "Application.html",
89       "href": "Application.html#Ext-app-Application-cfg-name",
90       "shortDoc": "The name of your application. This will also be the namespace for your views, controllers\nmodels and stores. Don't us..."
91     },
92     {
93       "tagname": "cfg",
94       "name": "scope",
95       "member": "Ext.app.Application",
96       "type": "Object",
97       "doc": "<p>The scope to execute the <a href=\"#/api/Ext.app.Application-property-launch\" rel=\"Ext.app.Application-property-launch\" class=\"docClass\">launch</a> function in. Defaults to the Application\ninstance.</p>\n",
98       "private": false,
99       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
100       "linenr": 86,
101       "html_filename": "Application.html",
102       "href": "Application.html#Ext-app-Application-cfg-scope"
103     }
104   ],
105   "method": [
106     {
107       "tagname": "method",
108       "name": "Application",
109       "member": "Ext.app.Application",
110       "doc": "\n",
111       "params": [
112
113       ],
114       "return": {
115         "type": "void",
116         "doc": "\n"
117       },
118       "private": false,
119       "static": false,
120       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
121       "linenr": 1,
122       "html_filename": "Application.html",
123       "href": "Application.html#Ext-app-Application-method-constructor",
124       "shortDoc": "\n"
125     }
126   ],
127   "property": [
128     {
129       "tagname": "property",
130       "name": "launch",
131       "member": "Ext.app.Application",
132       "type": "Function",
133       "doc": "<p>Called automatically when the page has completely loaded. This is an empty function that should be\noverridden by each application that needs to take action on page load</p>\n",
134       "private": false,
135       "static": false,
136       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
137       "linenr": 162,
138       "html_filename": "Application.html",
139       "href": "Application.html#Ext-app-Application-property-launch",
140       "shortDoc": "Called automatically when the page has completely loaded. This is an empty function that should be\noverridden by each..."
141     }
142   ],
143   "event": [
144
145   ],
146   "filename": "/Users/nick/Projects/sencha/SDK/platform/src/app/Application.js",
147   "linenr": 1,
148   "html_filename": "Application.html",
149   "href": "Application.html#Ext-app-Application",
150   "cssVar": [
151
152   ],
153   "cssMixin": [
154
155   ],
156   "component": false,
157   "superclasses": [
158     "Ext.app.Controller"
159   ],
160   "subclasses": [
161
162   ],
163   "mixedInto": [
164
165   ],
166   "allMixins": [
167
168   ]
169 });