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