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