Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / output / Ext.Action.js
1 Ext.data.JsonP.Ext_Action({
2   "tagname": "class",
3   "name": "Ext.Action",
4   "doc": "<p>An Action is a piece of reusable functionality that can be abstracted out of any particular component so that it\ncan be usefully shared among multiple components.  Actions let you share handlers, configuration options and UI\nupdates across any components that support the Action interface (primarily <a href=\"#/api/Ext.toolbar.Toolbar\" rel=\"Ext.toolbar.Toolbar\" class=\"docClass\">Ext.toolbar.Toolbar</a>, <a href=\"#/api/Ext.button.Button\" rel=\"Ext.button.Button\" class=\"docClass\">Ext.button.Button</a>\nand <a href=\"#/api/Ext.menu.Menu\" rel=\"Ext.menu.Menu\" class=\"docClass\">Ext.menu.Menu</a> components).</p>\n\n\n<p>Use a single Action instance as the config object for any number of UI Components which share the same configuration. The\nAction not only supplies the configuration, but allows all Components based upon it to have a common set of methods\ncalled at once through a single call to the Action.</p>\n\n\n<p>Any Component that is to be configured with an Action must also support\nthe following methods:<ul>\n<li><code>setText(string)</code></li>\n<li><code>setIconCls(string)</code></li>\n<li><code>setDisabled(boolean)</code></li>\n<li><code>setVisible(boolean)</code></li>\n<li><code>setHandler(function)</code></li></ul>.</p>\n\n\n<p>This allows the Action to control its associated Components.</p>\n\n\n<p>Example usage:<br></p>\n\n<pre><code>// Define the shared Action.  Each Component below will have the same\n// display text and icon, and will display the same message on click.\nvar action = new Ext.Action({\n    <a href=\"#/api/Ext.Action-cfg-text\" rel=\"Ext.Action-cfg-text\" class=\"docClass\">text</a>: 'Do something',\n    <a href=\"#/api/Ext.Action-cfg-handler\" rel=\"Ext.Action-cfg-handler\" class=\"docClass\">handler</a>: function(){\n        Ext.Msg.alert('Click', 'You did something.');\n    },\n    <a href=\"#/api/Ext.Action-cfg-iconCls\" rel=\"Ext.Action-cfg-iconCls\" class=\"docClass\">iconCls</a>: 'do-something',\n    <a href=\"#/api/Ext.Action-cfg-itemId\" rel=\"Ext.Action-cfg-itemId\" class=\"docClass\">itemId</a>: 'myAction'\n});\n\nvar panel = new Ext.panel.Panel({\n    title: 'Actions',\n    width: 500,\n    height: 300,\n    tbar: [\n        // Add the Action directly to a toolbar as a menu button\n        action,\n        {\n            text: 'Action Menu',\n            // Add the Action to a menu as a text item\n            menu: [action]\n        }\n    ],\n    items: [\n        // Add the Action to the panel body as a standard button\n        new Ext.button.Button(action)\n    ],\n    renderTo: Ext.getBody()\n});\n\n// Change the text for all components using the Action\naction.setText('Something else');\n\n// Reference an Action through a container using the itemId\nvar btn = panel.getComponent('myAction');\nvar aRef = btn.baseAction;\naRef.setText('New text');\n</code></pre>\n\n",
5   "extends": null,
6   "mixins": [
7
8   ],
9   "alternateClassNames": [
10
11   ],
12   "xtype": null,
13   "author": null,
14   "docauthor": null,
15   "singleton": false,
16   "private": false,
17   "cfg": [
18     {
19       "tagname": "cfg",
20       "name": "disabled",
21       "member": "Ext.Action",
22       "type": "Boolean",
23       "doc": "<p>True to disable all components configured by this Action, false to enable them (defaults to false).</p>\n",
24       "private": false,
25       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
26       "linenr": 85,
27       "html_filename": "Action.html",
28       "href": "Action.html#Ext-Action-cfg-disabled"
29     },
30     {
31       "tagname": "cfg",
32       "name": "handler",
33       "member": "Ext.Action",
34       "type": "Function",
35       "doc": "<p>The function that will be invoked by each component tied to this Action\nwhen the component's primary event is triggered (defaults to undefined).</p>\n",
36       "private": false,
37       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
38       "linenr": 91,
39       "html_filename": "Action.html",
40       "href": "Action.html#Ext-Action-cfg-handler",
41       "shortDoc": "The function that will be invoked by each component tied to this Action\nwhen the component's primary event is trigger..."
42     },
43     {
44       "tagname": "cfg",
45       "name": "hidden",
46       "member": "Ext.Action",
47       "type": "Boolean",
48       "doc": "<p>True to hide all components configured by this Action, false to show them (defaults to false).</p>\n",
49       "private": false,
50       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
51       "linenr": 88,
52       "html_filename": "Action.html",
53       "href": "Action.html#Ext-Action-cfg-hidden"
54     },
55     {
56       "tagname": "cfg",
57       "name": "iconCls",
58       "member": "Ext.Action",
59       "type": "String",
60       "doc": "<p>The CSS class selector that specifies a background image to be used as the header icon for\nall components configured by this Action (defaults to '').</p>\n\n<p>An example of specifying a custom icon class would be something like:\n</p>\n\n\n<pre><code>// specify the property in the config for the class:\n     ...\n     iconCls: 'do-something'\n\n// css class that specifies background image to be used as the icon image:\n.do-something { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }\n</code></pre>\n\n",
61       "private": false,
62       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
63       "linenr": 71,
64       "html_filename": "Action.html",
65       "href": "Action.html#Ext-Action-cfg-iconCls",
66       "shortDoc": "The CSS class selector that specifies a background image to be used as the header icon for\nall components configured ..."
67     },
68     {
69       "tagname": "cfg",
70       "name": "itemId",
71       "member": "Ext.Action",
72       "type": "String",
73       "doc": "<p>See <a href=\"#/api/Ext.Component\" rel=\"Ext.Component\" class=\"docClass\">Ext.Component</a>.<a href=\"#/api/Ext.Component-cfg-itemId\" rel=\"Ext.Component-cfg-itemId\" class=\"docClass\">itemId</a>.</p>\n",
74       "private": false,
75       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
76       "linenr": 95,
77       "html_filename": "Action.html",
78       "href": "Action.html#Ext-Action-cfg-itemId"
79     },
80     {
81       "tagname": "cfg",
82       "name": "scope",
83       "member": "Ext.Action",
84       "type": "Object",
85       "doc": "<p>The scope (<code><b>this</b></code> reference) in which the\n<code><a href=\"#/api/Ext.Action-cfg-handler\" rel=\"Ext.Action-cfg-handler\" class=\"docClass\">handler</a></code> is executed. Defaults to the browser window.</p>\n",
86       "private": false,
87       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
88       "linenr": 99,
89       "html_filename": "Action.html",
90       "href": "Action.html#Ext-Action-cfg-scope"
91     },
92     {
93       "tagname": "cfg",
94       "name": "text",
95       "member": "Ext.Action",
96       "type": "String",
97       "doc": "<p>The text to set for all components configured by this Action (defaults to '').</p>\n",
98       "private": false,
99       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
100       "linenr": 68,
101       "html_filename": "Action.html",
102       "href": "Action.html#Ext-Action-cfg-text"
103     }
104   ],
105   "method": [
106     {
107       "tagname": "method",
108       "name": "Action",
109       "member": "Ext.Action",
110       "doc": "\n",
111       "params": [
112         {
113           "type": "Object",
114           "name": "config",
115           "doc": "<p>The configuration options</p>\n",
116           "optional": false
117         }
118       ],
119       "return": {
120         "type": "void",
121         "doc": "\n"
122       },
123       "private": false,
124       "static": false,
125       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
126       "linenr": 1,
127       "html_filename": "Action.html",
128       "href": "Action.html#Ext-Action-method-constructor",
129       "shortDoc": "\n"
130     },
131     {
132       "tagname": "method",
133       "name": "disable",
134       "member": "Ext.Action",
135       "doc": "<p>Disables all components configured by this Action.</p>\n",
136       "params": [
137
138       ],
139       "return": {
140         "type": "void",
141         "doc": "\n"
142       },
143       "private": false,
144       "static": false,
145       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
146       "linenr": 163,
147       "html_filename": "Action.html",
148       "href": "Action.html#Ext-Action-method-disable",
149       "shortDoc": "<p>Disables all components configured by this Action.</p>\n"
150     },
151     {
152       "tagname": "method",
153       "name": "each",
154       "member": "Ext.Action",
155       "doc": "<p>Executes the specified function once for each Component currently tied to this Action.  The function passed\nin should accept a single argument that will be an object that supports the basic Action config/method interface.</p>\n",
156       "params": [
157         {
158           "type": "Function",
159           "name": "fn",
160           "doc": "<p>The function to execute for each component</p>\n",
161           "optional": false
162         },
163         {
164           "type": "Object",
165           "name": "scope",
166           "doc": "<p>The scope (<code>this</code> reference) in which the function is executed.  Defaults to the Component.</p>\n",
167           "optional": false
168         }
169       ],
170       "return": {
171         "type": "void",
172         "doc": "\n"
173       },
174       "private": false,
175       "static": false,
176       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
177       "linenr": 220,
178       "html_filename": "Action.html",
179       "href": "Action.html#Ext-Action-method-each",
180       "shortDoc": "Executes the specified function once for each Component currently tied to this Action.  The function passed\nin should..."
181     },
182     {
183       "tagname": "method",
184       "name": "enable",
185       "member": "Ext.Action",
186       "doc": "<p>Enables all components configured by this Action.</p>\n",
187       "params": [
188
189       ],
190       "return": {
191         "type": "void",
192         "doc": "\n"
193       },
194       "private": false,
195       "static": false,
196       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
197       "linenr": 156,
198       "html_filename": "Action.html",
199       "href": "Action.html#Ext-Action-method-enable",
200       "shortDoc": "<p>Enables all components configured by this Action.</p>\n"
201     },
202     {
203       "tagname": "method",
204       "name": "execute",
205       "member": "Ext.Action",
206       "doc": "<p>Executes this Action manually using the handler function specified in the original config object\nor the handler function set with <code><a href=\"#/api/Ext.Action-method-setHandler\" rel=\"Ext.Action-method-setHandler\" class=\"docClass\">setHandler</a></code>.  Any arguments passed to this\nfunction will be passed on to the handler function.</p>\n",
207       "params": [
208         {
209           "type": "Mixed",
210           "name": "arg1",
211           "doc": "<p>(optional) Variable number of arguments passed to the handler function</p>\n",
212           "optional": true
213         },
214         {
215           "type": "Mixed",
216           "name": "arg2",
217           "doc": "<p>(optional)</p>\n",
218           "optional": true
219         },
220         {
221           "type": "Mixed",
222           "name": "etc",
223           "doc": "<p>... (optional)</p>\n",
224           "optional": true
225         }
226       ],
227       "return": {
228         "type": "void",
229         "doc": "\n"
230       },
231       "private": false,
232       "static": false,
233       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
234       "linenr": 252,
235       "html_filename": "Action.html",
236       "href": "Action.html#Ext-Action-method-execute",
237       "shortDoc": "Executes this Action manually using the handler function specified in the original config object\nor the handler funct..."
238     },
239     {
240       "tagname": "method",
241       "name": "getIconCls",
242       "member": "Ext.Action",
243       "doc": "<p>Gets the icon CSS class currently used by all components configured by this Action.</p>\n",
244       "params": [
245
246       ],
247       "return": {
248         "type": "void",
249         "doc": "\n"
250       },
251       "private": false,
252       "static": false,
253       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
254       "linenr": 139,
255       "html_filename": "Action.html",
256       "href": "Action.html#Ext-Action-method-getIconCls",
257       "shortDoc": "<p>Gets the icon CSS class currently used by all components configured by this Action.</p>\n"
258     },
259     {
260       "tagname": "method",
261       "name": "getText",
262       "member": "Ext.Action",
263       "doc": "<p>Gets the text currently displayed by all components configured by this Action.</p>\n",
264       "params": [
265
266       ],
267       "return": {
268         "type": "void",
269         "doc": "\n"
270       },
271       "private": false,
272       "static": false,
273       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
274       "linenr": 122,
275       "html_filename": "Action.html",
276       "href": "Action.html#Ext-Action-method-getText",
277       "shortDoc": "<p>Gets the text currently displayed by all components configured by this Action.</p>\n"
278     },
279     {
280       "tagname": "method",
281       "name": "hide",
282       "member": "Ext.Action",
283       "doc": "<p>Hides all components configured by this Action.</p>\n",
284       "params": [
285
286       ],
287       "return": {
288         "type": "void",
289         "doc": "\n"
290       },
291       "private": false,
292       "static": false,
293       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
294       "linenr": 194,
295       "html_filename": "Action.html",
296       "href": "Action.html#Ext-Action-method-hide",
297       "shortDoc": "<p>Hides all components configured by this Action.</p>\n"
298     },
299     {
300       "tagname": "method",
301       "name": "isDisabled",
302       "member": "Ext.Action",
303       "doc": "<p>Returns true if the components using this Action are currently disabled, else returns false.</p>\n",
304       "params": [
305
306       ],
307       "return": {
308         "type": "void",
309         "doc": "\n"
310       },
311       "private": false,
312       "static": false,
313       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
314       "linenr": 170,
315       "html_filename": "Action.html",
316       "href": "Action.html#Ext-Action-method-isDisabled",
317       "shortDoc": "<p>Returns true if the components using this Action are currently disabled, else returns false.</p>\n"
318     },
319     {
320       "tagname": "method",
321       "name": "isHidden",
322       "member": "Ext.Action",
323       "doc": "<p>Returns true if the components configured by this Action are currently hidden, else returns false.</p>\n",
324       "params": [
325
326       ],
327       "return": {
328         "type": "void",
329         "doc": "\n"
330       },
331       "private": false,
332       "static": false,
333       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
334       "linenr": 201,
335       "html_filename": "Action.html",
336       "href": "Action.html#Ext-Action-method-isHidden",
337       "shortDoc": "<p>Returns true if the components configured by this Action are currently hidden, else returns false.</p>\n"
338     },
339     {
340       "tagname": "method",
341       "name": "setDisabled",
342       "member": "Ext.Action",
343       "doc": "<p>Sets the disabled state of all components configured by this Action.  Shortcut method\nfor <a href=\"#/api/Ext.Action-method-enable\" rel=\"Ext.Action-method-enable\" class=\"docClass\">enable</a> and <a href=\"#/api/Ext.Action-method-disable\" rel=\"Ext.Action-method-disable\" class=\"docClass\">disable</a>.</p>\n",
344       "params": [
345         {
346           "type": "Boolean",
347           "name": "disabled",
348           "doc": "<p>True to disable the component, false to enable it</p>\n",
349           "optional": false
350         }
351       ],
352       "return": {
353         "type": "void",
354         "doc": "\n"
355       },
356       "private": false,
357       "static": false,
358       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
359       "linenr": 146,
360       "html_filename": "Action.html",
361       "href": "Action.html#Ext-Action-method-setDisabled",
362       "shortDoc": "<p>Sets the disabled state of all components configured by this Action.  Shortcut method\nfor <a href=\"#/api/Ext.Action-method-enable\" rel=\"Ext.Action-method-enable\" class=\"docClass\">enable</a> and <a href=\"#/api/Ext.Action-method-disable\" rel=\"Ext.Action-method-disable\" class=\"docClass\">disable</a>.</p>\n"
363     },
364     {
365       "tagname": "method",
366       "name": "setHandler",
367       "member": "Ext.Action",
368       "doc": "<p>Sets the function that will be called by each Component using this action when its primary event is triggered.</p>\n",
369       "params": [
370         {
371           "type": "Function",
372           "name": "fn",
373           "doc": "<p>The function that will be invoked by the action's components.  The function\nwill be called with no arguments.</p>\n",
374           "optional": false
375         },
376         {
377           "type": "Object",
378           "name": "scope",
379           "doc": "<p>The scope (<code>this</code> reference) in which the function is executed. Defaults to the Component firing the event.</p>\n",
380           "optional": false
381         }
382       ],
383       "return": {
384         "type": "void",
385         "doc": "\n"
386       },
387       "private": false,
388       "static": false,
389       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
390       "linenr": 208,
391       "html_filename": "Action.html",
392       "href": "Action.html#Ext-Action-method-setHandler",
393       "shortDoc": "<p>Sets the function that will be called by each Component using this action when its primary event is triggered.</p>\n"
394     },
395     {
396       "tagname": "method",
397       "name": "setHidden",
398       "member": "Ext.Action",
399       "doc": "<p>Sets the hidden state of all components configured by this Action.  Shortcut method\nfor <code><a href=\"#/api/Ext.Action-method-hide\" rel=\"Ext.Action-method-hide\" class=\"docClass\">hide</a></code> and <code><a href=\"#/api/Ext.Action-method-show\" rel=\"Ext.Action-method-show\" class=\"docClass\">show</a></code>.</p>\n",
400       "params": [
401         {
402           "type": "Boolean",
403           "name": "hidden",
404           "doc": "<p>True to hide the component, false to show it</p>\n",
405           "optional": false
406         }
407       ],
408       "return": {
409         "type": "void",
410         "doc": "\n"
411       },
412       "private": false,
413       "static": false,
414       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
415       "linenr": 177,
416       "html_filename": "Action.html",
417       "href": "Action.html#Ext-Action-method-setHidden",
418       "shortDoc": "<p>Sets the hidden state of all components configured by this Action.  Shortcut method\nfor <code><a href=\"#/api/Ext.Action-method-hide\" rel=\"Ext.Action-method-hide\" class=\"docClass\">hide</a></code> and <code><a href=\"#/api/Ext.Action-method-show\" rel=\"Ext.Action-method-show\" class=\"docClass\">show</a></code>.</p>\n"
419     },
420     {
421       "tagname": "method",
422       "name": "setIconCls",
423       "member": "Ext.Action",
424       "doc": "<p>Sets the icon CSS class for all components configured by this Action.  The class should supply\na background image that will be used as the icon image.</p>\n",
425       "params": [
426         {
427           "type": "String",
428           "name": "cls",
429           "doc": "<p>The CSS class supplying the icon image</p>\n",
430           "optional": false
431         }
432       ],
433       "return": {
434         "type": "void",
435         "doc": "\n"
436       },
437       "private": false,
438       "static": false,
439       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
440       "linenr": 129,
441       "html_filename": "Action.html",
442       "href": "Action.html#Ext-Action-method-setIconCls",
443       "shortDoc": "Sets the icon CSS class for all components configured by this Action.  The class should supply\na background image tha..."
444     },
445     {
446       "tagname": "method",
447       "name": "setText",
448       "member": "Ext.Action",
449       "doc": "<p>Sets the text to be displayed by all components configured by this Action.</p>\n",
450       "params": [
451         {
452           "type": "String",
453           "name": "text",
454           "doc": "<p>The text to display</p>\n",
455           "optional": false
456         }
457       ],
458       "return": {
459         "type": "void",
460         "doc": "\n"
461       },
462       "private": false,
463       "static": false,
464       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
465       "linenr": 113,
466       "html_filename": "Action.html",
467       "href": "Action.html#Ext-Action-method-setText",
468       "shortDoc": "<p>Sets the text to be displayed by all components configured by this Action.</p>\n"
469     },
470     {
471       "tagname": "method",
472       "name": "show",
473       "member": "Ext.Action",
474       "doc": "<p>Shows all components configured by this Action.</p>\n",
475       "params": [
476
477       ],
478       "return": {
479         "type": "void",
480         "doc": "\n"
481       },
482       "private": false,
483       "static": false,
484       "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
485       "linenr": 187,
486       "html_filename": "Action.html",
487       "href": "Action.html#Ext-Action-method-show",
488       "shortDoc": "<p>Shows all components configured by this Action.</p>\n"
489     }
490   ],
491   "property": [
492
493   ],
494   "event": [
495
496   ],
497   "filename": "/Users/nick/Projects/sencha/SDK/extjs/src/Action.js",
498   "linenr": 1,
499   "html_filename": "Action.html",
500   "href": "Action.html#Ext-Action",
501   "cssVar": [
502
503   ],
504   "cssMixin": [
505
506   ],
507   "component": false,
508   "superclasses": [
509
510   ],
511   "subclasses": [
512
513   ],
514   "mixedInto": [
515
516   ],
517   "allMixins": [
518
519   ]
520 });