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