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