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