Partial Fix #5654 - roojspacker - get it working as a doc tool...
[roojs1] / docs2 / 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" : true,
9   "isBuiltin" : false,
10   "config" : [
11     {
12       "name" : "html",
13       "type" : "String",
14       "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
15       "memberOf" : "Roo.Template",
16       "values" : [
17       ]
18     },
19     {
20       "name" : "url",
21       "type" : "String",
22       "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...",
23       "memberOf" : "Roo.Template",
24       "values" : [
25       ]
26     }
27   ],
28   "methods" : [
29     {
30       "name" : "fill",
31       "desc" : "Applies all the passed values to a child template.",
32       "isStatic" : false,
33       "isConstructor" : false,
34       "isPrivate" : false,
35       "memberOf" : "Roo.MasterTemplate",
36       "example" : "",
37       "deprecated" : "",
38       "since" : "",
39       "see" : "",
40       "params" : [
41         {
42           "name" : "name",
43           "type" : "String/Number",
44           "desc" : "(optional) The name or index of the child template",
45           "isOptional" : false
46         },
47         {
48           "name" : "values",
49           "type" : "Array",
50           "desc" : "The values to be applied to the template, this should be an array of objects.",
51           "isOptional" : false
52         },
53         {
54           "name" : "reset",
55           "type" : "Boolean",
56           "desc" : "(optional) True to reset the template first",
57           "isOptional" : false
58         }
59       ],
60       "returns" : [
61         {
62           "name" : "",
63           "type" : "MasterTemplate",
64           "desc" : "this"
65         }
66       ]
67     },
68     {
69       "name" : "add",
70       "desc" : "Applies the passed values to a child template.",
71       "isStatic" : false,
72       "isConstructor" : false,
73       "isPrivate" : false,
74       "memberOf" : "Roo.MasterTemplate",
75       "example" : "",
76       "deprecated" : "",
77       "since" : "",
78       "see" : "",
79       "params" : [
80         {
81           "name" : "name",
82           "type" : "String/Number",
83           "desc" : "(optional) The name or index of the child template",
84           "isOptional" : false
85         },
86         {
87           "name" : "values",
88           "type" : "Array/Object",
89           "desc" : "The values to be applied to the template",
90           "isOptional" : false
91         }
92       ],
93       "returns" : [
94         {
95           "name" : "",
96           "type" : "MasterTemplate",
97           "desc" : "this"
98         }
99       ]
100     },
101     {
102       "name" : "from",
103       "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');",
104       "isStatic" : true,
105       "isConstructor" : false,
106       "isPrivate" : false,
107       "memberOf" : "Roo.MasterTemplate",
108       "example" : "",
109       "deprecated" : "",
110       "since" : "",
111       "see" : "",
112       "params" : [
113         {
114           "name" : "el",
115           "type" : "String/HTMLElement",
116           "desc" : "",
117           "isOptional" : false
118         },
119         {
120           "name" : "config",
121           "type" : "Object",
122           "desc" : "",
123           "isOptional" : false
124         }
125       ],
126       "returns" : [
127       ]
128     },
129     {
130       "name" : "reset",
131       "desc" : "Resets the template for reuse",
132       "isStatic" : false,
133       "isConstructor" : false,
134       "isPrivate" : false,
135       "memberOf" : "Roo.MasterTemplate",
136       "example" : "",
137       "deprecated" : "",
138       "since" : "",
139       "see" : "",
140       "params" : [
141       ],
142       "returns" : [
143         {
144           "name" : "",
145           "type" : "MasterTemplate",
146           "desc" : "this"
147         }
148       ]
149     },
150     {
151       "name" : "addAll",
152       "desc" : "Alias for fill().",
153       "isStatic" : false,
154       "isConstructor" : false,
155       "isPrivate" : false,
156       "memberOf" : "Roo.MasterTemplate",
157       "example" : "",
158       "deprecated" : "",
159       "since" : "",
160       "see" : "",
161       "params" : [
162       ],
163       "returns" : [
164       ]
165     },
166     {
167       "name" : "insertFirst",
168       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
169       "isStatic" : false,
170       "isConstructor" : false,
171       "isPrivate" : false,
172       "memberOf" : "Roo.Template",
173       "example" : "",
174       "deprecated" : "",
175       "since" : "",
176       "see" : "",
177       "params" : [
178         {
179           "name" : "el",
180           "type" : "String/HTMLElement/Roo.Element",
181           "desc" : "The context element",
182           "isOptional" : false
183         },
184         {
185           "name" : "values",
186           "type" : "Object",
187           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
188           "isOptional" : false
189         },
190         {
191           "name" : "returnElement",
192           "type" : "Boolean",
193           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
194           "isOptional" : false
195         }
196       ],
197       "returns" : [
198         {
199           "name" : "",
200           "type" : "HTMLElement/Roo.Element",
201           "desc" : "The new node or Element"
202         }
203       ]
204     },
205     {
206       "name" : "overwrite",
207       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
208       "isStatic" : false,
209       "isConstructor" : false,
210       "isPrivate" : false,
211       "memberOf" : "Roo.Template",
212       "example" : "",
213       "deprecated" : "",
214       "since" : "",
215       "see" : "",
216       "params" : [
217         {
218           "name" : "el",
219           "type" : "String/HTMLElement/Roo.Element",
220           "desc" : "The context element",
221           "isOptional" : false
222         },
223         {
224           "name" : "values",
225           "type" : "Object",
226           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
227           "isOptional" : false
228         },
229         {
230           "name" : "returnElement",
231           "type" : "Boolean",
232           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
233           "isOptional" : false
234         }
235       ],
236       "returns" : [
237         {
238           "name" : "",
239           "type" : "HTMLElement/Roo.Element",
240           "desc" : "The new node or Element"
241         }
242       ]
243     },
244     {
245       "name" : "insertBefore",
246       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
247       "isStatic" : false,
248       "isConstructor" : false,
249       "isPrivate" : false,
250       "memberOf" : "Roo.Template",
251       "example" : "",
252       "deprecated" : "",
253       "since" : "",
254       "see" : "",
255       "params" : [
256         {
257           "name" : "el",
258           "type" : "String/HTMLElement/Roo.Element",
259           "desc" : "The context element",
260           "isOptional" : false
261         },
262         {
263           "name" : "values",
264           "type" : "Object",
265           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
266           "isOptional" : false
267         },
268         {
269           "name" : "returnElement",
270           "type" : "Boolean",
271           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
272           "isOptional" : false
273         }
274       ],
275       "returns" : [
276         {
277           "name" : "",
278           "type" : "HTMLElement/Roo.Element",
279           "desc" : "The new node or Element"
280         }
281       ]
282     },
283     {
284       "name" : "applyTemplate",
285       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
286       "isStatic" : false,
287       "isConstructor" : false,
288       "isPrivate" : false,
289       "memberOf" : "Roo.Template",
290       "example" : "",
291       "deprecated" : "",
292       "since" : "",
293       "see" : "",
294       "params" : [
295         {
296           "name" : "values",
297           "type" : "Object",
298           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
299           "isOptional" : false
300         }
301       ],
302       "returns" : [
303         {
304           "name" : "",
305           "type" : "String",
306           "desc" : "The HTML fragment"
307         }
308       ]
309     },
310     {
311       "name" : "compile",
312       "desc" : "Compiles the template into an internal function, eliminating the RegEx overhead.",
313       "isStatic" : false,
314       "isConstructor" : false,
315       "isPrivate" : false,
316       "memberOf" : "Roo.Template",
317       "example" : "",
318       "deprecated" : "",
319       "since" : "",
320       "see" : "",
321       "params" : [
322       ],
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       ],
455       "returns" : [
456       ]
457     }
458   ],
459   "events" : [
460   ]
461 }