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