sync
[roojs1] / docs / symbols / Roo.MasterTemplate.json
1 {
2   "name" : "Roo.MasterTemplate",
3   "augments" : [
4     "Roo.Template"
5   ],
6   "childClasses" : {  },
7   "tree_children" : [],
8   "tree_parent" : [],
9   "desc" : "Provides a template that can have child templates. The syntax is:\n<pre><code>\nvar t = new Roo.MasterTemplate(\n\t'&lt;select name=\"{name}\"&gt;',\n\t\t'&lt;tpl name=\"options\"&gt;&lt;option value=\"{value:trim}\"&gt;{text:ellipsis(10)}&lt;/option&gt;&lt;/tpl&gt;',\n\t'&lt;/select&gt;'\n);\nt.add('options', {value: 'foo', text: 'bar'});\n// or you can add multiple child elements in one shot\nt.addAll('options', [\n    {value: 'foo', text: 'bar'},\n    {value: 'foo2', text: 'bar2'},\n    {value: 'foo3', text: 'bar3'}\n]);\n// then append, applying the master template values\nt.append('my-form', {name: 'my-select'});\n</code></pre>\nA name attribute for the child template is not required if you have only one child\ntemplate or you want to refer to them by index.",
10   "isSingleton" : false,
11   "isStatic" : true,
12   "isBuiltin" : false,
13   "isAbstract" : false,
14   "isBuilderTop" : false,
15   "memberOf" : "MasterTemplate",
16   "example" : "",
17   "deprecated" : "",
18   "since" : "",
19   "see" : "",
20   "params" : [],
21   "returns" : [],
22   "throws" : "",
23   "requires" : "",
24   "config" : [
25     {
26       "name" : "onLoad",
27       "type" : "Function",
28       "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
29       "memberOf" : "Roo.Template"
30     },
31     {
32       "name" : "html",
33       "type" : "String",
34       "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
35       "memberOf" : "Roo.Template"
36     },
37     {
38       "name" : "url",
39       "type" : "String",
40       "desc" : "The Url to load the template from. beware if you are loading from a url, the data may not be ready if you use it instantly..\n                   it should be fixed so that template is observable...",
41       "memberOf" : "Roo.Template"
42     }
43   ],
44   "methods" : [
45     {
46       "name" : "fill",
47       "type" : "function",
48       "desc" : "Applies all the passed values to a child template.",
49       "sig" : "(name, values, reset)",
50       "static" : false,
51       "memberOf" : "",
52       "isStatic" : false,
53       "isConstructor" : false,
54       "isPrivate" : false,
55       "example" : "",
56       "deprecated" : "",
57       "since" : "",
58       "see" : "",
59       "exceptions" : "",
60       "requires" : "",
61       "params" : [
62         {
63           "name" : "name",
64           "type" : "String/Number",
65           "desc" : "(optional) The name or index of the child template",
66           "isOptional" : false
67         },
68         {
69           "name" : "values",
70           "type" : "Array",
71           "desc" : "The values to be applied to the template, this should be an array of objects.",
72           "isOptional" : false
73         },
74         {
75           "name" : "reset",
76           "type" : "Boolean",
77           "desc" : "(optional) True to reset the template first",
78           "isOptional" : false
79         }
80       ],
81       "returns" : [
82         {
83           "name" : "",
84           "type" : "MasterTemplate",
85           "desc" : "this"
86         }
87       ]
88     },
89     {
90       "name" : "add",
91       "type" : "function",
92       "desc" : "Applies the passed values to a child template.",
93       "sig" : "(name, values)",
94       "static" : false,
95       "memberOf" : "",
96       "isStatic" : false,
97       "isConstructor" : false,
98       "isPrivate" : false,
99       "example" : "",
100       "deprecated" : "",
101       "since" : "",
102       "see" : "",
103       "exceptions" : "",
104       "requires" : "",
105       "params" : [
106         {
107           "name" : "name",
108           "type" : "String/Number",
109           "desc" : "(optional) The name or index of the child template",
110           "isOptional" : false
111         },
112         {
113           "name" : "values",
114           "type" : "Array/Object",
115           "desc" : "The values to be applied to the template",
116           "isOptional" : false
117         }
118       ],
119       "returns" : [
120         {
121           "name" : "",
122           "type" : "MasterTemplate",
123           "desc" : "this"
124         }
125       ]
126     },
127     {
128       "name" : "from",
129       "type" : "function",
130       "desc" : "Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. e.g.\nvar tpl = Roo.MasterTemplate.from('element-id');",
131       "sig" : "(el, config)",
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         {
145           "name" : "el",
146           "type" : "String/HTMLElement",
147           "desc" : "",
148           "isOptional" : false
149         },
150         {
151           "name" : "config",
152           "type" : "Object",
153           "desc" : "",
154           "isOptional" : false
155         }
156       ],
157       "returns" : []
158     },
159     {
160       "name" : "reset",
161       "type" : "function",
162       "desc" : "Resets the template for reuse",
163       "sig" : "()\n{\n\n}",
164       "static" : false,
165       "memberOf" : "",
166       "isStatic" : false,
167       "isConstructor" : false,
168       "isPrivate" : false,
169       "example" : "",
170       "deprecated" : "",
171       "since" : "",
172       "see" : "",
173       "exceptions" : "",
174       "requires" : "",
175       "params" : [],
176       "returns" : [
177         {
178           "name" : "",
179           "type" : "MasterTemplate",
180           "desc" : "this"
181         }
182       ]
183     },
184     {
185       "name" : "addAll",
186       "type" : "function",
187       "desc" : "Alias for fill().",
188       "sig" : "()\n{\n\n}",
189       "static" : false,
190       "memberOf" : "",
191       "isStatic" : false,
192       "isConstructor" : false,
193       "isPrivate" : false,
194       "example" : "",
195       "deprecated" : "",
196       "since" : "",
197       "see" : "",
198       "exceptions" : "",
199       "requires" : "",
200       "params" : [],
201       "returns" : []
202     },
203     {
204       "name" : "insertFirst",
205       "type" : "function",
206       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
207       "sig" : "(el, values, returnElement)",
208       "static" : false,
209       "memberOf" : "Roo.Template",
210       "isStatic" : false,
211       "isConstructor" : false,
212       "isPrivate" : false,
213       "example" : "",
214       "deprecated" : "",
215       "since" : "",
216       "see" : "",
217       "exceptions" : "",
218       "requires" : "",
219       "params" : [
220         {
221           "name" : "el",
222           "type" : "String/HTMLElement/Roo.Element",
223           "desc" : "The context element",
224           "isOptional" : false
225         },
226         {
227           "name" : "values",
228           "type" : "Object",
229           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
230           "isOptional" : false
231         },
232         {
233           "name" : "returnElement",
234           "type" : "Boolean",
235           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
236           "isOptional" : false
237         }
238       ],
239       "returns" : [
240         {
241           "name" : "",
242           "type" : "HTMLElement/Roo.Element",
243           "desc" : "The new node or Element"
244         }
245       ]
246     },
247     {
248       "name" : "overwrite",
249       "type" : "function",
250       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
251       "sig" : "(el, values, returnElement)",
252       "static" : false,
253       "memberOf" : "Roo.Template",
254       "isStatic" : false,
255       "isConstructor" : false,
256       "isPrivate" : false,
257       "example" : "",
258       "deprecated" : "",
259       "since" : "",
260       "see" : "",
261       "exceptions" : "",
262       "requires" : "",
263       "params" : [
264         {
265           "name" : "el",
266           "type" : "String/HTMLElement/Roo.Element",
267           "desc" : "The context element",
268           "isOptional" : false
269         },
270         {
271           "name" : "values",
272           "type" : "Object",
273           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
274           "isOptional" : false
275         },
276         {
277           "name" : "returnElement",
278           "type" : "Boolean",
279           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
280           "isOptional" : false
281         }
282       ],
283       "returns" : [
284         {
285           "name" : "",
286           "type" : "HTMLElement/Roo.Element",
287           "desc" : "The new node or Element"
288         }
289       ]
290     },
291     {
292       "name" : "insertBefore",
293       "type" : "function",
294       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
295       "sig" : "(el, values, returnElement)",
296       "static" : false,
297       "memberOf" : "Roo.Template",
298       "isStatic" : false,
299       "isConstructor" : false,
300       "isPrivate" : false,
301       "example" : "",
302       "deprecated" : "",
303       "since" : "",
304       "see" : "",
305       "exceptions" : "",
306       "requires" : "",
307       "params" : [
308         {
309           "name" : "el",
310           "type" : "String/HTMLElement/Roo.Element",
311           "desc" : "The context element",
312           "isOptional" : false
313         },
314         {
315           "name" : "values",
316           "type" : "Object",
317           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
318           "isOptional" : false
319         },
320         {
321           "name" : "returnElement",
322           "type" : "Boolean",
323           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
324           "isOptional" : false
325         }
326       ],
327       "returns" : [
328         {
329           "name" : "",
330           "type" : "HTMLElement/Roo.Element",
331           "desc" : "The new node or Element"
332         }
333       ]
334     },
335     {
336       "name" : "applyTemplate",
337       "type" : "function",
338       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
339       "sig" : "(values)",
340       "static" : false,
341       "memberOf" : "Roo.Template",
342       "isStatic" : false,
343       "isConstructor" : false,
344       "isPrivate" : false,
345       "example" : "",
346       "deprecated" : "",
347       "since" : "",
348       "see" : "",
349       "exceptions" : "",
350       "requires" : "",
351       "params" : [
352         {
353           "name" : "values",
354           "type" : "Object",
355           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
356           "isOptional" : false
357         }
358       ],
359       "returns" : [
360         {
361           "name" : "",
362           "type" : "String",
363           "desc" : "The HTML fragment"
364         }
365       ]
366     },
367     {
368       "name" : "compile",
369       "type" : "function",
370       "desc" : "Compiles the template into an internal function, eliminating the RegEx overhead.",
371       "sig" : "()\n{\n\n}",
372       "static" : false,
373       "memberOf" : "Roo.Template",
374       "isStatic" : false,
375       "isConstructor" : false,
376       "isPrivate" : false,
377       "example" : "",
378       "deprecated" : "",
379       "since" : "",
380       "see" : "",
381       "exceptions" : "",
382       "requires" : "",
383       "params" : [],
384       "returns" : [
385         {
386           "name" : "",
387           "type" : "Roo.Template",
388           "desc" : "this"
389         }
390       ]
391     },
392     {
393       "name" : "set",
394       "type" : "function",
395       "desc" : "Sets the HTML used as the template and optionally compiles it.",
396       "sig" : "(html, compile)",
397       "static" : false,
398       "memberOf" : "Roo.Template",
399       "isStatic" : false,
400       "isConstructor" : false,
401       "isPrivate" : false,
402       "example" : "",
403       "deprecated" : "",
404       "since" : "",
405       "see" : "",
406       "exceptions" : "",
407       "requires" : "",
408       "params" : [
409         {
410           "name" : "html",
411           "type" : "String",
412           "desc" : "",
413           "isOptional" : false
414         },
415         {
416           "name" : "compile",
417           "type" : "Boolean",
418           "desc" : "(optional) True to compile the template (defaults to undefined)",
419           "isOptional" : false
420         }
421       ],
422       "returns" : [
423         {
424           "name" : "",
425           "type" : "Roo.Template",
426           "desc" : "this"
427         }
428       ]
429     },
430     {
431       "name" : "insertAfter",
432       "type" : "function",
433       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
434       "sig" : "(el, values, returnElement)",
435       "static" : false,
436       "memberOf" : "Roo.Template",
437       "isStatic" : false,
438       "isConstructor" : false,
439       "isPrivate" : false,
440       "example" : "",
441       "deprecated" : "",
442       "since" : "",
443       "see" : "",
444       "exceptions" : "",
445       "requires" : "",
446       "params" : [
447         {
448           "name" : "el",
449           "type" : "String/HTMLElement/Roo.Element",
450           "desc" : "The context element",
451           "isOptional" : false
452         },
453         {
454           "name" : "values",
455           "type" : "Object",
456           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
457           "isOptional" : false
458         },
459         {
460           "name" : "returnElement",
461           "type" : "Boolean",
462           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
463           "isOptional" : false
464         }
465       ],
466       "returns" : [
467         {
468           "name" : "",
469           "type" : "HTMLElement/Roo.Element",
470           "desc" : "The new node or Element"
471         }
472       ]
473     },
474     {
475       "name" : "append",
476       "type" : "function",
477       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
478       "sig" : "(el, values, returnElement)",
479       "static" : false,
480       "memberOf" : "Roo.Template",
481       "isStatic" : false,
482       "isConstructor" : false,
483       "isPrivate" : false,
484       "example" : "",
485       "deprecated" : "",
486       "since" : "",
487       "see" : "",
488       "exceptions" : "",
489       "requires" : "",
490       "params" : [
491         {
492           "name" : "el",
493           "type" : "String/HTMLElement/Roo.Element",
494           "desc" : "The context element",
495           "isOptional" : false
496         },
497         {
498           "name" : "values",
499           "type" : "Object",
500           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
501           "isOptional" : false
502         },
503         {
504           "name" : "returnElement",
505           "type" : "Boolean",
506           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
507           "isOptional" : false
508         }
509       ],
510       "returns" : [
511         {
512           "name" : "",
513           "type" : "HTMLElement/Roo.Element",
514           "desc" : "The new node or Element"
515         }
516       ]
517     },
518     {
519       "name" : "apply",
520       "type" : "function",
521       "desc" : "Alias for {@link #applyTemplate}",
522       "sig" : "()\n{\n\n}",
523       "static" : false,
524       "memberOf" : "Roo.Template",
525       "isStatic" : false,
526       "isConstructor" : false,
527       "isPrivate" : false,
528       "example" : "",
529       "deprecated" : "",
530       "since" : "",
531       "see" : "",
532       "exceptions" : "",
533       "requires" : "",
534       "params" : [],
535       "returns" : []
536     }
537   ],
538   "events" : []
539 }