sync
[roojs1] / docs / symbols / Roo.Component.json
1 {
2   "name" : "Roo.Component",
3   "augments" : [
4     "Roo.util.Observable"
5   ],
6   "desc" : "Base class for all major Roo components.  All subclasses of Component can automatically participate in the standard\nRoo component lifecycle of creation, rendering and destruction.  They also have automatic support for basic hide/show\nand enable/disable behavior.  Component allows any subclass to be lazy-rendered into any {@link Roo.Container} and\nto be automatically registered with the {@link Roo.ComponentMgr} so that it can be referenced at any time via {@link Roo.getCmp}.\nAll visual components (widgets) that require rendering into a layout should subclass Component.",
7   "isSingleton" : false,
8   "isStatic" : false,
9   "isBuiltin" : false,
10   "memberOf" : "Component",
11   "example" : "",
12   "deprecated" : "",
13   "since" : "",
14   "see" : "",
15   "params" : [
16     {
17       "name" : "config",
18       "type" : "Roo.Element/String/Object",
19       "desc" : "The configuration options.  If an element is passed, it is set as the internal\nelement and its id used as the component id.  If a string is passed, it is assumed to be the id of an existing element\nand is used as the component id.  Otherwise, it is assumed to be a standard config object and is applied to the component.",
20       "isOptional" : false
21     }
22   ],
23   "returns" : [
24   ],
25   "config" : [
26     {
27       "name" : "listeners",
28       "type" : "Object",
29       "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  </code></pre>",
30       "memberOf" : "Roo.util.Observable",
31       "values" : [
32       ]
33     },
34     {
35       "name" : "hideMode",
36       "type" : "String",
37       "desc" : "How this component should hidden. Supported values are\n\"visibility\" (css visibility), \"offsets\" (negative offset position) and\n\"display\" (css display) - defaults to \"display\".",
38       "memberOf" : "Roo.Component",
39       "values" : [
40         "(display",
41         "visibility)"
42       ]
43     },
44     {
45       "name" : "allowDomMove",
46       "type" : "Boolean",
47       "desc" : "Whether the component can move the Dom node when rendering (defaults to true).",
48       "memberOf" : "Roo.Component",
49       "values" : [
50       ]
51     },
52     {
53       "name" : "actionMode",
54       "type" : "String",
55       "desc" : "which property holds the element that used for  hide() / show() / disable() / enable()\ndefault is 'el' for forms you probably want to set this to fieldEl",
56       "memberOf" : "Roo.Component",
57       "values" : [
58       ]
59     },
60     {
61       "name" : "disableClass",
62       "type" : "String",
63       "desc" : "CSS class added to the component when it is disabled (defaults to \"x-item-disabled\").",
64       "memberOf" : "Roo.Component",
65       "values" : [
66       ]
67     }
68   ],
69   "methods" : [
70     {
71       "name" : "getId",
72       "desc" : "Returns the id of this component.",
73       "isStatic" : false,
74       "isConstructor" : false,
75       "isPrivate" : false,
76       "memberOf" : "Roo.Component",
77       "example" : "",
78       "deprecated" : "",
79       "since" : "",
80       "see" : "",
81       "params" : [
82       ],
83       "returns" : [
84         {
85           "name" : "",
86           "type" : "String",
87           "desc" : ""
88         }
89       ]
90     },
91     {
92       "name" : "render",
93       "desc" : "If this is a lazy rendering component, render it to its container element.",
94       "isStatic" : false,
95       "isConstructor" : false,
96       "isPrivate" : false,
97       "memberOf" : "Roo.Component",
98       "example" : "",
99       "deprecated" : "",
100       "since" : "",
101       "see" : "",
102       "params" : [
103         {
104           "name" : "container",
105           "type" : "String/HTMLElement/Element",
106           "desc" : "(optional) The element this component should be rendered into. If it is being applied to existing markup, this should be left off.",
107           "isOptional" : false
108         }
109       ],
110       "returns" : [
111       ]
112     },
113     {
114       "name" : "destroy",
115       "desc" : "Destroys this component by purging any event listeners, removing the component's element from the DOM,\nremoving the component from its {@link Roo.Container} (if applicable) and unregistering it from {@link Roo.ComponentMgr}.",
116       "isStatic" : false,
117       "isConstructor" : false,
118       "isPrivate" : false,
119       "memberOf" : "Roo.Component",
120       "example" : "",
121       "deprecated" : "",
122       "since" : "",
123       "see" : "",
124       "params" : [
125       ],
126       "returns" : [
127       ]
128     },
129     {
130       "name" : "isVisible",
131       "desc" : "Returns true if this component is visible.",
132       "isStatic" : false,
133       "isConstructor" : false,
134       "isPrivate" : false,
135       "memberOf" : "Roo.Component",
136       "example" : "",
137       "deprecated" : "",
138       "since" : "",
139       "see" : "",
140       "params" : [
141       ],
142       "returns" : [
143       ]
144     },
145     {
146       "name" : "setDisabled",
147       "desc" : "Convenience function for setting disabled/enabled by boolean.",
148       "isStatic" : false,
149       "isConstructor" : false,
150       "isPrivate" : false,
151       "memberOf" : "Roo.Component",
152       "example" : "",
153       "deprecated" : "",
154       "since" : "",
155       "see" : "",
156       "params" : [
157         {
158           "name" : "disabled",
159           "type" : "Boolean",
160           "desc" : "",
161           "isOptional" : false
162         }
163       ],
164       "returns" : [
165       ]
166     },
167     {
168       "name" : "hide",
169       "desc" : "Hide this component.",
170       "isStatic" : false,
171       "isConstructor" : false,
172       "isPrivate" : false,
173       "memberOf" : "Roo.Component",
174       "example" : "",
175       "deprecated" : "",
176       "since" : "",
177       "see" : "",
178       "params" : [
179       ],
180       "returns" : [
181         {
182           "name" : "",
183           "type" : "Roo.Component",
184           "desc" : "this"
185         }
186       ]
187     },
188     {
189       "name" : "focus",
190       "desc" : "Try to focus this component.",
191       "isStatic" : false,
192       "isConstructor" : false,
193       "isPrivate" : false,
194       "memberOf" : "Roo.Component",
195       "example" : "",
196       "deprecated" : "",
197       "since" : "",
198       "see" : "",
199       "params" : [
200         {
201           "name" : "selectText",
202           "type" : "Boolean",
203           "desc" : "True to also select the text in this component (if applicable)",
204           "isOptional" : false
205         }
206       ],
207       "returns" : [
208         {
209           "name" : "",
210           "type" : "Roo.Component",
211           "desc" : "this"
212         }
213       ]
214     },
215     {
216       "name" : "show",
217       "desc" : "Show this component.",
218       "isStatic" : false,
219       "isConstructor" : false,
220       "isPrivate" : false,
221       "memberOf" : "Roo.Component",
222       "example" : "",
223       "deprecated" : "",
224       "since" : "",
225       "see" : "",
226       "params" : [
227       ],
228       "returns" : [
229         {
230           "name" : "",
231           "type" : "Roo.Component",
232           "desc" : "this"
233         }
234       ]
235     },
236     {
237       "name" : "enable",
238       "desc" : "Enable this component.",
239       "isStatic" : false,
240       "isConstructor" : false,
241       "isPrivate" : false,
242       "memberOf" : "Roo.Component",
243       "example" : "",
244       "deprecated" : "",
245       "since" : "",
246       "see" : "",
247       "params" : [
248       ],
249       "returns" : [
250         {
251           "name" : "",
252           "type" : "Roo.Component",
253           "desc" : "this"
254         }
255       ]
256     },
257     {
258       "name" : "setVisible",
259       "desc" : "Convenience function to hide or show this component by boolean.",
260       "isStatic" : false,
261       "isConstructor" : false,
262       "isPrivate" : false,
263       "memberOf" : "Roo.Component",
264       "example" : "",
265       "deprecated" : "",
266       "since" : "",
267       "see" : "",
268       "params" : [
269         {
270           "name" : "visible",
271           "type" : "Boolean",
272           "desc" : "True to show, false to hide",
273           "isOptional" : false
274         }
275       ],
276       "returns" : [
277         {
278           "name" : "",
279           "type" : "Roo.Component",
280           "desc" : "this"
281         }
282       ]
283     },
284     {
285       "name" : "disable",
286       "desc" : "Disable this component.",
287       "isStatic" : false,
288       "isConstructor" : false,
289       "isPrivate" : false,
290       "memberOf" : "Roo.Component",
291       "example" : "",
292       "deprecated" : "",
293       "since" : "",
294       "see" : "",
295       "params" : [
296       ],
297       "returns" : [
298         {
299           "name" : "",
300           "type" : "Roo.Component",
301           "desc" : "this"
302         }
303       ]
304     },
305     {
306       "name" : "getEl",
307       "desc" : "Returns the underlying {@link Roo.Element}.",
308       "isStatic" : false,
309       "isConstructor" : false,
310       "isPrivate" : false,
311       "memberOf" : "Roo.Component",
312       "example" : "",
313       "deprecated" : "",
314       "since" : "",
315       "see" : "",
316       "params" : [
317       ],
318       "returns" : [
319         {
320           "name" : "",
321           "type" : "Roo.Element",
322           "desc" : "The element"
323         }
324       ]
325     },
326     {
327       "name" : "purgeListeners",
328       "desc" : "Removes all listeners for this object",
329       "isStatic" : false,
330       "isConstructor" : false,
331       "isPrivate" : false,
332       "memberOf" : "Roo.util.Observable",
333       "example" : "",
334       "deprecated" : "",
335       "since" : "",
336       "see" : "",
337       "params" : [
338       ],
339       "returns" : [
340       ]
341     },
342     {
343       "name" : "on",
344       "desc" : "Appends an event handler to this element (shorthand for addListener)",
345       "isStatic" : false,
346       "isConstructor" : false,
347       "isPrivate" : false,
348       "memberOf" : "Roo.util.Observable",
349       "example" : "",
350       "deprecated" : "",
351       "since" : "",
352       "see" : "",
353       "params" : [
354         {
355           "name" : "eventName",
356           "type" : "String",
357           "desc" : "The type of event to listen for",
358           "isOptional" : false
359         },
360         {
361           "name" : "handler",
362           "type" : "Function",
363           "desc" : "The method the event invokes",
364           "isOptional" : false
365         },
366         {
367           "name" : "scope",
368           "type" : "Object",
369           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
370           "isOptional" : false
371         },
372         {
373           "name" : "options",
374           "type" : "Object",
375           "desc" : "(optional)",
376           "isOptional" : false
377         }
378       ],
379       "returns" : [
380       ]
381     },
382     {
383       "name" : "un",
384       "desc" : "Removes a listener (shorthand for removeListener)",
385       "isStatic" : false,
386       "isConstructor" : false,
387       "isPrivate" : false,
388       "memberOf" : "Roo.util.Observable",
389       "example" : "",
390       "deprecated" : "",
391       "since" : "",
392       "see" : "",
393       "params" : [
394         {
395           "name" : "eventName",
396           "type" : "String",
397           "desc" : "The type of event to listen for",
398           "isOptional" : false
399         },
400         {
401           "name" : "handler",
402           "type" : "Function",
403           "desc" : "The handler to remove",
404           "isOptional" : false
405         },
406         {
407           "name" : "scope",
408           "type" : "Object",
409           "desc" : "(optional) The scope (this object) for the handler",
410           "isOptional" : false
411         }
412       ],
413       "returns" : [
414       ]
415     },
416     {
417       "name" : "addEvents",
418       "desc" : "Used to define events on this Observable",
419       "isStatic" : false,
420       "isConstructor" : false,
421       "isPrivate" : false,
422       "memberOf" : "Roo.util.Observable",
423       "example" : "",
424       "deprecated" : "",
425       "since" : "",
426       "see" : "",
427       "params" : [
428         {
429           "name" : "object",
430           "type" : "Object",
431           "desc" : "The object with the events defined",
432           "isOptional" : false
433         }
434       ],
435       "returns" : [
436       ]
437     },
438     {
439       "name" : "releaseCapture",
440       "desc" : "Removes <b>all</b> added captures from the Observable.",
441       "isStatic" : true,
442       "isConstructor" : false,
443       "isPrivate" : false,
444       "memberOf" : "Roo.util.Observable",
445       "example" : "",
446       "deprecated" : "",
447       "since" : "",
448       "see" : "",
449       "params" : [
450         {
451           "name" : "o",
452           "type" : "Observable",
453           "desc" : "The Observable to release",
454           "isOptional" : false
455         }
456       ],
457       "returns" : [
458       ]
459     },
460     {
461       "name" : "removeListener",
462       "desc" : "Removes a listener",
463       "isStatic" : false,
464       "isConstructor" : false,
465       "isPrivate" : false,
466       "memberOf" : "Roo.util.Observable",
467       "example" : "",
468       "deprecated" : "",
469       "since" : "",
470       "see" : "",
471       "params" : [
472         {
473           "name" : "eventName",
474           "type" : "String",
475           "desc" : "The type of event to listen for",
476           "isOptional" : false
477         },
478         {
479           "name" : "handler",
480           "type" : "Function",
481           "desc" : "The handler to remove",
482           "isOptional" : false
483         },
484         {
485           "name" : "scope",
486           "type" : "Object",
487           "desc" : "(optional) The scope (this object) for the handler",
488           "isOptional" : false
489         }
490       ],
491       "returns" : [
492       ]
493     },
494     {
495       "name" : "fireEvent",
496       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
497       "isStatic" : false,
498       "isConstructor" : false,
499       "isPrivate" : false,
500       "memberOf" : "Roo.util.Observable",
501       "example" : "",
502       "deprecated" : "",
503       "since" : "",
504       "see" : "",
505       "params" : [
506         {
507           "name" : "eventName",
508           "type" : "String",
509           "desc" : "",
510           "isOptional" : false
511         },
512         {
513           "name" : "args",
514           "type" : "Object...",
515           "desc" : "Variable number of parameters are passed to handlers",
516           "isOptional" : false
517         }
518       ],
519       "returns" : [
520         {
521           "name" : "",
522           "type" : "Boolean",
523           "desc" : "returns false if any of the handlers return false otherwise it returns true"
524         }
525       ]
526     },
527     {
528       "name" : "hasListener",
529       "desc" : "Checks to see if this object has any listeners for a specified event",
530       "isStatic" : false,
531       "isConstructor" : false,
532       "isPrivate" : false,
533       "memberOf" : "Roo.util.Observable",
534       "example" : "",
535       "deprecated" : "",
536       "since" : "",
537       "see" : "",
538       "params" : [
539         {
540           "name" : "eventName",
541           "type" : "String",
542           "desc" : "The name of the event to check for",
543           "isOptional" : false
544         }
545       ],
546       "returns" : [
547         {
548           "name" : "",
549           "type" : "Boolean",
550           "desc" : "True if the event is being listened for, else false"
551         }
552       ]
553     },
554     {
555       "name" : "capture",
556       "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\n<b>before</b> the event is fired. If the supplied function returns false,\nthe event will not fire.",
557       "isStatic" : true,
558       "isConstructor" : false,
559       "isPrivate" : false,
560       "memberOf" : "Roo.util.Observable",
561       "example" : "",
562       "deprecated" : "",
563       "since" : "",
564       "see" : "",
565       "params" : [
566         {
567           "name" : "o",
568           "type" : "Observable",
569           "desc" : "The Observable to capture",
570           "isOptional" : false
571         },
572         {
573           "name" : "fn",
574           "type" : "Function",
575           "desc" : "The function to call",
576           "isOptional" : false
577         },
578         {
579           "name" : "scope",
580           "type" : "Object",
581           "desc" : "(optional) The scope (this object) for the fn",
582           "isOptional" : false
583         }
584       ],
585       "returns" : [
586       ]
587     },
588     {
589       "name" : "addListener",
590       "desc" : "Appends an event handler to this component",
591       "isStatic" : false,
592       "isConstructor" : false,
593       "isPrivate" : false,
594       "memberOf" : "Roo.util.Observable",
595       "example" : "",
596       "deprecated" : "",
597       "since" : "",
598       "see" : "",
599       "params" : [
600         {
601           "name" : "eventName",
602           "type" : "String",
603           "desc" : "The type of event to listen for",
604           "isOptional" : false
605         },
606         {
607           "name" : "handler",
608           "type" : "Function",
609           "desc" : "The method the event invokes",
610           "isOptional" : false
611         },
612         {
613           "name" : "scope",
614           "type" : "Object",
615           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
616           "isOptional" : false
617         },
618         {
619           "name" : "options",
620           "type" : "Object",
621           "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:<ul>\n<li>scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.</li>\n<li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>\n<li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>\n<li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>\n</ul><br>\n<p>\n<b>Combining Options</b><br>\nUsing the options argument, it is possible to combine different types of listeners:<br>\n<br>\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t<pre><code>\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t</code></pre>\n<p>\n<b>Attaching multiple handlers in 1 call</b><br>\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n<pre><code>\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t</code></pre>\n<p>\nOr a shorthand syntax which passes the same scope object to all handlers:\n     \t<pre><code>\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t</code></pre>",
622           "isOptional" : false
623         }
624       ],
625       "returns" : [
626       ]
627     }
628   ],
629   "events" : [
630     {
631       "name" : "beforerender",
632       "desc" : "Fires before the component is rendered. Return false to stop the render.",
633       "memberOf" : "Roo.Component",
634       "example" : "",
635       "deprecated" : "",
636       "since" : "",
637       "see" : "",
638       "params" : [
639         {
640           "name" : "this",
641           "type" : "Roo.Component",
642           "desc" : "",
643           "isOptional" : false
644         }
645       ],
646       "returns" : [
647       ]
648     },
649     {
650       "name" : "disable",
651       "desc" : "Fires after the component is disabled.",
652       "memberOf" : "Roo.Component",
653       "example" : "",
654       "deprecated" : "",
655       "since" : "",
656       "see" : "",
657       "params" : [
658         {
659           "name" : "this",
660           "type" : "Roo.Component",
661           "desc" : "",
662           "isOptional" : false
663         }
664       ],
665       "returns" : [
666       ]
667     },
668     {
669       "name" : "render",
670       "desc" : "Fires after the component is rendered.",
671       "memberOf" : "Roo.Component",
672       "example" : "",
673       "deprecated" : "",
674       "since" : "",
675       "see" : "",
676       "params" : [
677         {
678           "name" : "this",
679           "type" : "Roo.Component",
680           "desc" : "",
681           "isOptional" : false
682         }
683       ],
684       "returns" : [
685       ]
686     },
687     {
688       "name" : "destroy",
689       "desc" : "Fires after the component is destroyed.",
690       "memberOf" : "Roo.Component",
691       "example" : "",
692       "deprecated" : "",
693       "since" : "",
694       "see" : "",
695       "params" : [
696         {
697           "name" : "this",
698           "type" : "Roo.Component",
699           "desc" : "",
700           "isOptional" : false
701         }
702       ],
703       "returns" : [
704       ]
705     },
706     {
707       "name" : "hide",
708       "desc" : "Fires after the component is hidden.",
709       "memberOf" : "Roo.Component",
710       "example" : "",
711       "deprecated" : "",
712       "since" : "",
713       "see" : "",
714       "params" : [
715         {
716           "name" : "this",
717           "type" : "Roo.Component",
718           "desc" : "",
719           "isOptional" : false
720         }
721       ],
722       "returns" : [
723       ]
724     },
725     {
726       "name" : "beforehide",
727       "desc" : "Fires before the component is hidden. Return false to stop the hide.",
728       "memberOf" : "Roo.Component",
729       "example" : "",
730       "deprecated" : "",
731       "since" : "",
732       "see" : "",
733       "params" : [
734         {
735           "name" : "this",
736           "type" : "Roo.Component",
737           "desc" : "",
738           "isOptional" : false
739         }
740       ],
741       "returns" : [
742       ]
743     },
744     {
745       "name" : "show",
746       "desc" : "Fires after the component is shown.",
747       "memberOf" : "Roo.Component",
748       "example" : "",
749       "deprecated" : "",
750       "since" : "",
751       "see" : "",
752       "params" : [
753         {
754           "name" : "this",
755           "type" : "Roo.Component",
756           "desc" : "",
757           "isOptional" : false
758         }
759       ],
760       "returns" : [
761       ]
762     },
763     {
764       "name" : "beforeshow",
765       "desc" : "Fires before the component is shown.  Return false to stop the show.",
766       "memberOf" : "Roo.Component",
767       "example" : "",
768       "deprecated" : "",
769       "since" : "",
770       "see" : "",
771       "params" : [
772         {
773           "name" : "this",
774           "type" : "Roo.Component",
775           "desc" : "",
776           "isOptional" : false
777         }
778       ],
779       "returns" : [
780       ]
781     },
782     {
783       "name" : "enable",
784       "desc" : "Fires after the component is enabled.",
785       "memberOf" : "Roo.Component",
786       "example" : "",
787       "deprecated" : "",
788       "since" : "",
789       "see" : "",
790       "params" : [
791         {
792           "name" : "this",
793           "type" : "Roo.Component",
794           "desc" : "",
795           "isOptional" : false
796         }
797       ],
798       "returns" : [
799       ]
800     },
801     {
802       "name" : "beforedestroy",
803       "desc" : "Fires before the component is destroyed. Return false to stop the destroy.",
804       "memberOf" : "Roo.Component",
805       "example" : "",
806       "deprecated" : "",
807       "since" : "",
808       "see" : "",
809       "params" : [
810         {
811           "name" : "this",
812           "type" : "Roo.Component",
813           "desc" : "",
814           "isOptional" : false
815         }
816       ],
817       "returns" : [
818       ]
819     }
820   ]
821 }