sync
[roojs1] / docs / symbols / Roo.DomTemplate.json
1 {
2   "name" : "Roo.DomTemplate",
3   "augments" : [
4     "Roo.Template"
5   ],
6   "desc" : "An effort at a dom based template engine..\n\nSimilar to XTemplate, except it uses dom parsing to create the template..\n\nSupported features:\n\n Tags:\n\n<pre><code>\n      {a_variable} - output encoded.\n      {a_variable.format:(\"Y-m-d\")} - call a method on the variable\n      {a_variable:raw} - unencoded output\n      {a_variable:toFixed(1,2)} - Roo.util.Format.\"toFixed\"\n      {a_variable:this.method_on_template(...)} - call a method on the template object.\n \n</code></pre>\n The tpl tag:\n<pre><code>\n        &lt;div roo-for=\"a_variable or condition..\"&gt;&lt;/div&gt;\n        &lt;div roo-if=\"a_variable or condition\"&gt;&lt;/div&gt;\n        &lt;div roo-exec=\"some javascript\"&gt;&lt;/div&gt;\n        &lt;div roo-name=\"named_template\"&gt;&lt;/div&gt; \n  \n</code></pre>",
7   "isSingleton" : false,
8   "isStatic" : false,
9   "isBuiltin" : false,
10   "memberOf" : "DomTemplate",
11   "example" : "",
12   "deprecated" : "",
13   "since" : "",
14   "see" : "",
15   "params" : [],
16   "returns" : [],
17   "throws" : "",
18   "requires" : "",
19   "config" : [
20     {
21       "name" : "onLoad",
22       "type" : "Function",
23       "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
24       "memberOf" : "Roo.Template"
25     },
26     {
27       "name" : "html",
28       "type" : "String",
29       "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
30       "memberOf" : "Roo.Template"
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     }
38   ],
39   "methods" : [
40     {
41       "name" : "applySubTemplate",
42       "type" : "function",
43       "desc" : "same as applyTemplate, except it's done to one of the subTemplates\nwhen using named templates, you can do:\n\nvar str = pl.applySubTemplate('your-name', values);",
44       "sig" : "(id, values, parent)",
45       "static" : false,
46       "memberOf" : "",
47       "isStatic" : false,
48       "isConstructor" : false,
49       "isPrivate" : false,
50       "example" : "",
51       "deprecated" : "",
52       "since" : "",
53       "see" : "",
54       "exceptions" : "",
55       "requires" : "",
56       "params" : [
57         {
58           "name" : "id",
59           "type" : "Number",
60           "desc" : "of the template",
61           "isOptional" : false
62         },
63         {
64           "name" : "values",
65           "type" : "Object",
66           "desc" : "to apply to template",
67           "isOptional" : false
68         },
69         {
70           "name" : "parent",
71           "type" : "Object",
72           "desc" : "(normaly the instance of this object)",
73           "isOptional" : false
74         }
75       ],
76       "returns" : []
77     },
78     {
79       "name" : "compile",
80       "type" : "function",
81       "desc" : "compile the template\n\nThis is not recursive, so I'm not sure how nested templates are really going to be handled..",
82       "sig" : "()\n{\n\n}",
83       "static" : false,
84       "memberOf" : "",
85       "isStatic" : false,
86       "isConstructor" : false,
87       "isPrivate" : false,
88       "example" : "",
89       "deprecated" : "",
90       "since" : "",
91       "see" : "",
92       "exceptions" : "",
93       "requires" : "",
94       "params" : [],
95       "returns" : []
96     },
97     {
98       "name" : "compileTpl",
99       "type" : "function",
100       "desc" : "Compile a segment of the template into a 'sub-template'",
101       "sig" : "()\n{\n\n}",
102       "static" : false,
103       "memberOf" : "",
104       "isStatic" : false,
105       "isConstructor" : false,
106       "isPrivate" : false,
107       "example" : "",
108       "deprecated" : "",
109       "since" : "",
110       "see" : "",
111       "exceptions" : "",
112       "requires" : "",
113       "params" : [],
114       "returns" : []
115     },
116     {
117       "name" : "insertFirst",
118       "type" : "function",
119       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
120       "sig" : "(el, values, returnElement)",
121       "static" : false,
122       "memberOf" : "Roo.Template",
123       "isStatic" : false,
124       "isConstructor" : false,
125       "isPrivate" : false,
126       "example" : "",
127       "deprecated" : "",
128       "since" : "",
129       "see" : "",
130       "exceptions" : "",
131       "requires" : "",
132       "params" : [
133         {
134           "name" : "el",
135           "type" : "String/HTMLElement/Roo.Element",
136           "desc" : "The context element",
137           "isOptional" : false
138         },
139         {
140           "name" : "values",
141           "type" : "Object",
142           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
143           "isOptional" : false
144         },
145         {
146           "name" : "returnElement",
147           "type" : "Boolean",
148           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
149           "isOptional" : false
150         }
151       ],
152       "returns" : [
153         {
154           "name" : "",
155           "type" : "HTMLElement/Roo.Element",
156           "desc" : "The new node or Element"
157         }
158       ]
159     },
160     {
161       "name" : "overwrite",
162       "type" : "function",
163       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
164       "sig" : "(el, values, returnElement)",
165       "static" : false,
166       "memberOf" : "Roo.Template",
167       "isStatic" : false,
168       "isConstructor" : false,
169       "isPrivate" : false,
170       "example" : "",
171       "deprecated" : "",
172       "since" : "",
173       "see" : "",
174       "exceptions" : "",
175       "requires" : "",
176       "params" : [
177         {
178           "name" : "el",
179           "type" : "String/HTMLElement/Roo.Element",
180           "desc" : "The context element",
181           "isOptional" : false
182         },
183         {
184           "name" : "values",
185           "type" : "Object",
186           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
187           "isOptional" : false
188         },
189         {
190           "name" : "returnElement",
191           "type" : "Boolean",
192           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
193           "isOptional" : false
194         }
195       ],
196       "returns" : [
197         {
198           "name" : "",
199           "type" : "HTMLElement/Roo.Element",
200           "desc" : "The new node or Element"
201         }
202       ]
203     },
204     {
205       "name" : "insertBefore",
206       "type" : "function",
207       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
208       "sig" : "(el, values, returnElement)",
209       "static" : false,
210       "memberOf" : "Roo.Template",
211       "isStatic" : false,
212       "isConstructor" : false,
213       "isPrivate" : false,
214       "example" : "",
215       "deprecated" : "",
216       "since" : "",
217       "see" : "",
218       "exceptions" : "",
219       "requires" : "",
220       "params" : [
221         {
222           "name" : "el",
223           "type" : "String/HTMLElement/Roo.Element",
224           "desc" : "The context element",
225           "isOptional" : false
226         },
227         {
228           "name" : "values",
229           "type" : "Object",
230           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
231           "isOptional" : false
232         },
233         {
234           "name" : "returnElement",
235           "type" : "Boolean",
236           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
237           "isOptional" : false
238         }
239       ],
240       "returns" : [
241         {
242           "name" : "",
243           "type" : "HTMLElement/Roo.Element",
244           "desc" : "The new node or Element"
245         }
246       ]
247     },
248     {
249       "name" : "applyTemplate",
250       "type" : "function",
251       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
252       "sig" : "(values)",
253       "static" : false,
254       "memberOf" : "Roo.Template",
255       "isStatic" : false,
256       "isConstructor" : false,
257       "isPrivate" : false,
258       "example" : "",
259       "deprecated" : "",
260       "since" : "",
261       "see" : "",
262       "exceptions" : "",
263       "requires" : "",
264       "params" : [
265         {
266           "name" : "values",
267           "type" : "Object",
268           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
269           "isOptional" : false
270         }
271       ],
272       "returns" : [
273         {
274           "name" : "",
275           "type" : "String",
276           "desc" : "The HTML fragment"
277         }
278       ]
279     },
280     {
281       "name" : "set",
282       "type" : "function",
283       "desc" : "Sets the HTML used as the template and optionally compiles it.",
284       "sig" : "(html, compile)",
285       "static" : false,
286       "memberOf" : "Roo.Template",
287       "isStatic" : false,
288       "isConstructor" : false,
289       "isPrivate" : false,
290       "example" : "",
291       "deprecated" : "",
292       "since" : "",
293       "see" : "",
294       "exceptions" : "",
295       "requires" : "",
296       "params" : [
297         {
298           "name" : "html",
299           "type" : "String",
300           "desc" : "",
301           "isOptional" : false
302         },
303         {
304           "name" : "compile",
305           "type" : "Boolean",
306           "desc" : "(optional) True to compile the template (defaults to undefined)",
307           "isOptional" : false
308         }
309       ],
310       "returns" : [
311         {
312           "name" : "",
313           "type" : "Roo.Template",
314           "desc" : "this"
315         }
316       ]
317     },
318     {
319       "name" : "from",
320       "type" : "function",
321       "desc" : "Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.",
322       "sig" : "(el)",
323       "static" : true,
324       "memberOf" : "Roo.Template",
325       "isStatic" : true,
326       "isConstructor" : false,
327       "isPrivate" : false,
328       "example" : "",
329       "deprecated" : "",
330       "since" : "",
331       "see" : "",
332       "exceptions" : "",
333       "requires" : "",
334       "params" : [
335         {
336           "name" : "el",
337           "type" : "String/HTMLElement",
338           "desc" : "A DOM element or its id",
339           "isOptional" : false
340         }
341       ],
342       "returns" : []
343     },
344     {
345       "name" : "insertAfter",
346       "type" : "function",
347       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
348       "sig" : "(el, values, returnElement)",
349       "static" : false,
350       "memberOf" : "Roo.Template",
351       "isStatic" : false,
352       "isConstructor" : false,
353       "isPrivate" : false,
354       "example" : "",
355       "deprecated" : "",
356       "since" : "",
357       "see" : "",
358       "exceptions" : "",
359       "requires" : "",
360       "params" : [
361         {
362           "name" : "el",
363           "type" : "String/HTMLElement/Roo.Element",
364           "desc" : "The context element",
365           "isOptional" : false
366         },
367         {
368           "name" : "values",
369           "type" : "Object",
370           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
371           "isOptional" : false
372         },
373         {
374           "name" : "returnElement",
375           "type" : "Boolean",
376           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
377           "isOptional" : false
378         }
379       ],
380       "returns" : [
381         {
382           "name" : "",
383           "type" : "HTMLElement/Roo.Element",
384           "desc" : "The new node or Element"
385         }
386       ]
387     },
388     {
389       "name" : "append",
390       "type" : "function",
391       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
392       "sig" : "(el, values, returnElement)",
393       "static" : false,
394       "memberOf" : "Roo.Template",
395       "isStatic" : false,
396       "isConstructor" : false,
397       "isPrivate" : false,
398       "example" : "",
399       "deprecated" : "",
400       "since" : "",
401       "see" : "",
402       "exceptions" : "",
403       "requires" : "",
404       "params" : [
405         {
406           "name" : "el",
407           "type" : "String/HTMLElement/Roo.Element",
408           "desc" : "The context element",
409           "isOptional" : false
410         },
411         {
412           "name" : "values",
413           "type" : "Object",
414           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
415           "isOptional" : false
416         },
417         {
418           "name" : "returnElement",
419           "type" : "Boolean",
420           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
421           "isOptional" : false
422         }
423       ],
424       "returns" : [
425         {
426           "name" : "",
427           "type" : "HTMLElement/Roo.Element",
428           "desc" : "The new node or Element"
429         }
430       ]
431     },
432     {
433       "name" : "apply",
434       "type" : "function",
435       "desc" : "Alias for {@link #applyTemplate}",
436       "sig" : "()\n{\n\n}",
437       "static" : false,
438       "memberOf" : "Roo.Template",
439       "isStatic" : false,
440       "isConstructor" : false,
441       "isPrivate" : false,
442       "example" : "",
443       "deprecated" : "",
444       "since" : "",
445       "see" : "",
446       "exceptions" : "",
447       "requires" : "",
448       "params" : [],
449       "returns" : []
450     }
451   ],
452   "events" : []
453 }