4cd9aaba6e385b446f6f251c8aae03c946d37ffb
[roojs1] / docs / symbols / Roo.XComponent.json
1 {
2   "name" : "Roo.XComponent",
3   "augments" : [
4     "Roo.util.Observable"
5   ],
6   "childClasses" : {  },
7   "tree_children" : [],
8   "tree_parent" : [],
9   "desc" : "A delayed Element creator...\nOr a way to group chunks of interface together.\ntechnically this is a wrapper around a tree of Roo elements (which defines a 'module'),\n used in conjunction with XComponent.build() it will create an instance of each element,\n then call addxtype() to build the User interface.\n\nMypart.xyx = new Roo.XComponent({\n\n    parent : 'Mypart.xyz', // empty == document.element.!!\n    order : '001',\n    name : 'xxxx'\n    region : 'xxxx'\n    disabled : function() {} \n     \n    tree : function() { // return an tree of xtype declared components\n        var MODULE = this;\n        return \n        {\n            xtype : 'NestedLayoutPanel',\n            // technicall\n        }\n     ]\n})\n\n\nIt can be used to build a big heiracy, with parent etc.\nor you can just use this to render a single compoent to a dom element\nMYPART.render(Roo.Element | String(id) | dom_element )\n\n\nUsage patterns.\n\nClassic Roo\n\nRoo is designed primarily as a single page application, so the UI build for a standard interface will\nexpect a single 'TOP' level module normally indicated by the 'parent' of the XComponent definition being defined as false.\n\nEach sub module is expected to have a parent pointing to the class name of it's parent module.\n\nWhen the top level is false, a 'Roo.BorderLayout' is created and the element is flagged as 'topModule'\n- if mulitple topModules exist, the last one is defined as the top module.\n\nEmbeded Roo\n\nWhen the top level or multiple modules are to embedded into a existing HTML page,\nthe parent element can container '#id' of the element where the module will be drawn.\n\nBootstrap Roo\n\nUnlike classic Roo, the bootstrap tends not to be used as a single page.\nit relies more on a include mechanism, where sub modules are included into an outer page.\nThis is normally managed by the builder tools using Roo.apply( options, Included.Sub.Module )\n\nBootstrap Roo Included elements\n\nOur builder application needs the ability to preview these sub compoennts. They will normally have parent=false set,\nhence confusing the component builder as it thinks there are multiple top level elements. \n\nString Over-ride & Translations\n\nOur builder application writes all the strings as _strings and _named_strings. This is to enable the translation of elements,\nand also the 'overlaying of string values - needed when different versions of the same application with different text content\nare needed. @see Roo.XComponent.overlayString",
10   "isSingleton" : false,
11   "isStatic" : false,
12   "isBuiltin" : false,
13   "isAbstract" : false,
14   "isBuilderTop" : false,
15   "memberOf" : "XComponent",
16   "example" : "",
17   "deprecated" : "",
18   "since" : "",
19   "see" : "",
20   "params" : [
21     {
22       "name" : "cfg",
23       "type" : "",
24       "desc" : "{Object} configuration of component",
25       "isOptional" : false
26     }
27   ],
28   "returns" : [],
29   "throws" : "",
30   "requires" : "",
31   "config" : [
32     {
33       "name" : "listeners",
34       "type" : "Object",
35       "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>",
36       "memberOf" : "Roo.util.Observable"
37     },
38     {
39       "name" : "region",
40       "type" : "String",
41       "desc" : "Region to render component to (defaults to center)",
42       "memberOf" : "Roo.XComponent"
43     },
44     {
45       "name" : "disabled",
46       "type" : "Function|boolean",
47       "desc" : "If this module is disabled by some rule, return true from the funtion",
48       "memberOf" : "Roo.XComponent"
49     },
50     {
51       "name" : "order",
52       "type" : "String",
53       "desc" : "Used to set the order in which elements are created (usefull for multiple tabs)",
54       "memberOf" : "Roo.XComponent"
55     },
56     {
57       "name" : "items",
58       "type" : "Array",
59       "desc" : "A single item array - the first element is the root of the tree..\nIt's done this way to stay compatible with the Xtype system...",
60       "memberOf" : "Roo.XComponent"
61     },
62     {
63       "name" : "parent",
64       "type" : "String",
65       "desc" : "Name of parent element which it get xtype added to..",
66       "memberOf" : "Roo.XComponent"
67     },
68     {
69       "name" : "name",
70       "type" : "String",
71       "desc" : "String to display while loading.",
72       "memberOf" : "Roo.XComponent"
73     }
74   ],
75   "methods" : [
76     {
77       "name" : "overlayStrings",
78       "type" : "function",
79       "desc" : "Overlay a set of modified strings onto a component\nThis is dependant on our builder exporting the strings and 'named strings' elements.",
80       "sig" : "(element, associative)",
81       "static" : true,
82       "memberOf" : "",
83       "isStatic" : true,
84       "isConstructor" : false,
85       "isPrivate" : false,
86       "example" : "",
87       "deprecated" : "",
88       "since" : "",
89       "see" : "",
90       "exceptions" : "",
91       "requires" : "",
92       "params" : [
93         {
94           "name" : "element",
95           "type" : "Object",
96           "desc" : "to overlay on - eg. Pman.Dialog.Login",
97           "isOptional" : false
98         },
99         {
100           "name" : "associative",
101           "type" : "Object",
102           "desc" : "array of 'named' string and it's new value.",
103           "isOptional" : false
104         }
105       ],
106       "returns" : []
107     },
108     {
109       "name" : "preBuild",
110       "type" : "function",
111       "desc" : "move modules into their correct place in the tree..",
112       "sig" : "()\n{\n\n}",
113       "static" : true,
114       "memberOf" : "",
115       "isStatic" : true,
116       "isConstructor" : false,
117       "isPrivate" : false,
118       "example" : "",
119       "deprecated" : "",
120       "since" : "",
121       "see" : "",
122       "exceptions" : "",
123       "requires" : "",
124       "params" : [],
125       "returns" : []
126     },
127     {
128       "name" : "toObject",
129       "type" : "function",
130       "desc" : "convert a string to an object..\neg. 'AAA.BBB' -> finds AAA.BBB",
131       "sig" : "()\n{\n\n}",
132       "static" : true,
133       "memberOf" : "",
134       "isStatic" : true,
135       "isConstructor" : false,
136       "isPrivate" : false,
137       "example" : "",
138       "deprecated" : "",
139       "since" : "",
140       "see" : "",
141       "exceptions" : "",
142       "requires" : "",
143       "params" : [],
144       "returns" : []
145     },
146     {
147       "name" : "render",
148       "type" : "function",
149       "desc" : "render\nrender element to dom or tree",
150       "sig" : "(optional)",
151       "static" : false,
152       "memberOf" : "",
153       "isStatic" : false,
154       "isConstructor" : false,
155       "isPrivate" : false,
156       "example" : "",
157       "deprecated" : "",
158       "since" : "",
159       "see" : "",
160       "exceptions" : "",
161       "requires" : "",
162       "params" : [
163         {
164           "name" : "optional",
165           "type" : "Roo.Element|String|DomElement",
166           "desc" : "render to if parent is not set.",
167           "isOptional" : false
168         }
169       ],
170       "returns" : []
171     },
172     {
173       "name" : "buildOrder",
174       "type" : "function",
175       "desc" : "make a list of modules to build.",
176       "sig" : "()\n{\n\n}",
177       "static" : true,
178       "memberOf" : "",
179       "isStatic" : true,
180       "isConstructor" : false,
181       "isPrivate" : false,
182       "example" : "",
183       "deprecated" : "",
184       "since" : "",
185       "see" : "",
186       "exceptions" : "",
187       "requires" : "",
188       "params" : [],
189       "returns" : [
190         {
191           "name" : "",
192           "type" : "Array",
193           "desc" : "list of modules."
194         }
195       ]
196     },
197     {
198       "name" : "register",
199       "type" : "function",
200       "desc" : "Register components to be built later.\n\nThis solves the following issues\n- Building is not done on page load, but after an authentication process has occured.\n- Interface elements are registered on page load\n- Parent Interface elements may not be loaded before child, so this handles that..\n\n\nexample:\n\nMyApp.register({\n          order : '000001',\n          module : 'Pman.Tab.projectMgr',\n          region : 'center',\n          parent : 'Pman.layout',\n          disabled : false,  // or use a function..\n        })\n* @param {Object} details about module",
201       "sig" : "()\n{\n\n}",
202       "static" : true,
203       "memberOf" : "",
204       "isStatic" : true,
205       "isConstructor" : false,
206       "isPrivate" : false,
207       "example" : "",
208       "deprecated" : "",
209       "since" : "",
210       "see" : "",
211       "exceptions" : "",
212       "requires" : "",
213       "params" : [],
214       "returns" : []
215     },
216     {
217       "name" : "build",
218       "type" : "function",
219       "desc" : "Build the registered modules.",
220       "sig" : "(parent, optional)",
221       "static" : true,
222       "memberOf" : "",
223       "isStatic" : true,
224       "isConstructor" : false,
225       "isPrivate" : false,
226       "example" : "",
227       "deprecated" : "",
228       "since" : "",
229       "see" : "",
230       "exceptions" : "",
231       "requires" : "",
232       "params" : [
233         {
234           "name" : "parent",
235           "type" : "Object",
236           "desc" : "element.",
237           "isOptional" : false
238         },
239         {
240           "name" : "optional",
241           "type" : "Function",
242           "desc" : "method to call after module has been added.",
243           "isOptional" : false
244         }
245       ],
246       "returns" : []
247     },
248     {
249       "name" : "purgeListeners",
250       "type" : "function",
251       "desc" : "Removes all listeners for this object",
252       "sig" : "()\n{\n\n}",
253       "static" : false,
254       "memberOf" : "Roo.util.Observable",
255       "isStatic" : false,
256       "isConstructor" : false,
257       "isPrivate" : false,
258       "example" : "",
259       "deprecated" : "",
260       "since" : "",
261       "see" : "",
262       "exceptions" : "",
263       "requires" : "",
264       "params" : [],
265       "returns" : []
266     },
267     {
268       "name" : "un",
269       "type" : "function",
270       "desc" : "Removes a listener (shorthand for removeListener)",
271       "sig" : "(eventName, handler, scope)",
272       "static" : false,
273       "memberOf" : "Roo.util.Observable",
274       "isStatic" : false,
275       "isConstructor" : false,
276       "isPrivate" : false,
277       "example" : "",
278       "deprecated" : "",
279       "since" : "",
280       "see" : "",
281       "exceptions" : "",
282       "requires" : "",
283       "params" : [
284         {
285           "name" : "eventName",
286           "type" : "String",
287           "desc" : "The type of event to listen for",
288           "isOptional" : false
289         },
290         {
291           "name" : "handler",
292           "type" : "Function",
293           "desc" : "The handler to remove",
294           "isOptional" : false
295         },
296         {
297           "name" : "scope",
298           "type" : "Object",
299           "desc" : "(optional) The scope (this object) for the handler",
300           "isOptional" : false
301         }
302       ],
303       "returns" : []
304     },
305     {
306       "name" : "addEvents",
307       "type" : "function",
308       "desc" : "Used to define events on this Observable",
309       "sig" : "(object)",
310       "static" : false,
311       "memberOf" : "Roo.util.Observable",
312       "isStatic" : false,
313       "isConstructor" : false,
314       "isPrivate" : false,
315       "example" : "",
316       "deprecated" : "",
317       "since" : "",
318       "see" : "",
319       "exceptions" : "",
320       "requires" : "",
321       "params" : [
322         {
323           "name" : "object",
324           "type" : "Object",
325           "desc" : "The object with the events defined",
326           "isOptional" : false
327         }
328       ],
329       "returns" : []
330     },
331     {
332       "name" : "releaseCapture",
333       "type" : "function",
334       "desc" : "Removes <b>all</b> added captures from the Observable.",
335       "sig" : "(o)",
336       "static" : true,
337       "memberOf" : "Roo.util.Observable",
338       "isStatic" : true,
339       "isConstructor" : false,
340       "isPrivate" : false,
341       "example" : "",
342       "deprecated" : "",
343       "since" : "",
344       "see" : "",
345       "exceptions" : "",
346       "requires" : "",
347       "params" : [
348         {
349           "name" : "o",
350           "type" : "Observable",
351           "desc" : "The Observable to release",
352           "isOptional" : false
353         }
354       ],
355       "returns" : []
356     },
357     {
358       "name" : "removeListener",
359       "type" : "function",
360       "desc" : "Removes a listener",
361       "sig" : "(eventName, handler, scope)",
362       "static" : false,
363       "memberOf" : "Roo.util.Observable",
364       "isStatic" : false,
365       "isConstructor" : false,
366       "isPrivate" : false,
367       "example" : "",
368       "deprecated" : "",
369       "since" : "",
370       "see" : "",
371       "exceptions" : "",
372       "requires" : "",
373       "params" : [
374         {
375           "name" : "eventName",
376           "type" : "String",
377           "desc" : "The type of event to listen for",
378           "isOptional" : false
379         },
380         {
381           "name" : "handler",
382           "type" : "Function",
383           "desc" : "The handler to remove",
384           "isOptional" : false
385         },
386         {
387           "name" : "scope",
388           "type" : "Object",
389           "desc" : "(optional) The scope (this object) for the handler",
390           "isOptional" : false
391         }
392       ],
393       "returns" : []
394     },
395     {
396       "name" : "fireEvent",
397       "type" : "function",
398       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
399       "sig" : "(eventName, args)",
400       "static" : false,
401       "memberOf" : "Roo.util.Observable",
402       "isStatic" : false,
403       "isConstructor" : false,
404       "isPrivate" : false,
405       "example" : "",
406       "deprecated" : "",
407       "since" : "",
408       "see" : "",
409       "exceptions" : "",
410       "requires" : "",
411       "params" : [
412         {
413           "name" : "eventName",
414           "type" : "String",
415           "desc" : "",
416           "isOptional" : false
417         },
418         {
419           "name" : "args",
420           "type" : "Object...",
421           "desc" : "Variable number of parameters are passed to handlers",
422           "isOptional" : false
423         }
424       ],
425       "returns" : [
426         {
427           "name" : "",
428           "type" : "Boolean",
429           "desc" : "returns false if any of the handlers return false otherwise it returns true"
430         }
431       ]
432     },
433     {
434       "name" : "hasListener",
435       "type" : "function",
436       "desc" : "Checks to see if this object has any listeners for a specified event",
437       "sig" : "(eventName)",
438       "static" : false,
439       "memberOf" : "Roo.util.Observable",
440       "isStatic" : false,
441       "isConstructor" : false,
442       "isPrivate" : false,
443       "example" : "",
444       "deprecated" : "",
445       "since" : "",
446       "see" : "",
447       "exceptions" : "",
448       "requires" : "",
449       "params" : [
450         {
451           "name" : "eventName",
452           "type" : "String",
453           "desc" : "The name of the event to check for",
454           "isOptional" : false
455         }
456       ],
457       "returns" : [
458         {
459           "name" : "",
460           "type" : "Boolean",
461           "desc" : "True if the event is being listened for, else false"
462         }
463       ]
464     },
465     {
466       "name" : "capture",
467       "type" : "function",
468       "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.",
469       "sig" : "(o, fn, scope)",
470       "static" : true,
471       "memberOf" : "Roo.util.Observable",
472       "isStatic" : true,
473       "isConstructor" : false,
474       "isPrivate" : false,
475       "example" : "",
476       "deprecated" : "",
477       "since" : "",
478       "see" : "",
479       "exceptions" : "",
480       "requires" : "",
481       "params" : [
482         {
483           "name" : "o",
484           "type" : "Observable",
485           "desc" : "The Observable to capture",
486           "isOptional" : false
487         },
488         {
489           "name" : "fn",
490           "type" : "Function",
491           "desc" : "The function to call",
492           "isOptional" : false
493         },
494         {
495           "name" : "scope",
496           "type" : "Object",
497           "desc" : "(optional) The scope (this object) for the fn",
498           "isOptional" : false
499         }
500       ],
501       "returns" : []
502     },
503     {
504       "name" : "addListener",
505       "type" : "function",
506       "desc" : "Appends an event handler to this component",
507       "sig" : "(eventName, handler, scope, options)",
508       "static" : false,
509       "memberOf" : "Roo.util.Observable",
510       "isStatic" : false,
511       "isConstructor" : false,
512       "isPrivate" : false,
513       "example" : "",
514       "deprecated" : "",
515       "since" : "",
516       "see" : "",
517       "exceptions" : "",
518       "requires" : "",
519       "params" : [
520         {
521           "name" : "eventName",
522           "type" : "String",
523           "desc" : "The type of event to listen for",
524           "isOptional" : false
525         },
526         {
527           "name" : "handler",
528           "type" : "Function",
529           "desc" : "The method the event invokes",
530           "isOptional" : false
531         },
532         {
533           "name" : "scope",
534           "type" : "Object",
535           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
536           "isOptional" : false
537         },
538         {
539           "name" : "options",
540           "type" : "Object",
541           "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>",
542           "isOptional" : false
543         }
544       ],
545       "returns" : []
546     }
547   ],
548   "events" : [
549     {
550       "name" : "built",
551       "type" : "function",
552       "desc" : "Fires when this the componnt is built",
553       "sig" : "function (c)\n{\n\n}",
554       "memberOf" : "",
555       "example" : "",
556       "deprecated" : "",
557       "since" : "",
558       "see" : "",
559       "params" : [
560         {
561           "name" : "c",
562           "type" : "Roo.XComponent",
563           "desc" : "the component",
564           "isOptional" : false
565         }
566       ],
567       "returns" : []
568     }
569   ]
570 }