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