5bff0fa67fcb76d9502c00faa536f3f524188cc9
[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   "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" : "applySubTemplate",
36       "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);",
37       "isStatic" : false,
38       "isConstructor" : false,
39       "isPrivate" : false,
40       "memberOf" : "Roo.DomTemplate",
41       "example" : "",
42       "deprecated" : "",
43       "since" : "",
44       "see" : "",
45       "params" : [
46         {
47           "name" : "id",
48           "type" : "Number",
49           "desc" : "of the template",
50           "isOptional" : false
51         },
52         {
53           "name" : "values",
54           "type" : "Object",
55           "desc" : "to apply to template",
56           "isOptional" : false
57         },
58         {
59           "name" : "parent",
60           "type" : "Object",
61           "desc" : "(normaly the instance of this object)",
62           "isOptional" : false
63         }
64       ],
65       "returns" : []
66     },
67     {
68       "name" : "compile",
69       "desc" : "compile the template\n\nThis is not recursive, so I'm not sure how nested templates are really going to be handled..",
70       "isStatic" : false,
71       "isConstructor" : false,
72       "isPrivate" : false,
73       "memberOf" : "Roo.DomTemplate",
74       "example" : "",
75       "deprecated" : "",
76       "since" : "",
77       "see" : "",
78       "params" : [],
79       "returns" : []
80     },
81     {
82       "name" : "compileTpl",
83       "desc" : "Compile a segment of the template into a 'sub-template'",
84       "isStatic" : false,
85       "isConstructor" : false,
86       "isPrivate" : false,
87       "memberOf" : "Roo.DomTemplate",
88       "example" : "",
89       "deprecated" : "",
90       "since" : "",
91       "see" : "",
92       "params" : [],
93       "returns" : []
94     },
95     {
96       "name" : "insertFirst",
97       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
98       "isStatic" : false,
99       "isConstructor" : false,
100       "isPrivate" : false,
101       "memberOf" : "Roo.Template",
102       "example" : "",
103       "deprecated" : "",
104       "since" : "",
105       "see" : "",
106       "params" : [
107         {
108           "name" : "el",
109           "type" : "String/HTMLElement/Roo.Element",
110           "desc" : "The context element",
111           "isOptional" : false
112         },
113         {
114           "name" : "values",
115           "type" : "Object",
116           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
117           "isOptional" : false
118         },
119         {
120           "name" : "returnElement",
121           "type" : "Boolean",
122           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
123           "isOptional" : false
124         }
125       ],
126       "returns" : [
127         {
128           "name" : "",
129           "type" : "HTMLElement/Roo.Element",
130           "desc" : "The new node or Element"
131         }
132       ]
133     },
134     {
135       "name" : "overwrite",
136       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
137       "isStatic" : false,
138       "isConstructor" : false,
139       "isPrivate" : false,
140       "memberOf" : "Roo.Template",
141       "example" : "",
142       "deprecated" : "",
143       "since" : "",
144       "see" : "",
145       "params" : [
146         {
147           "name" : "el",
148           "type" : "String/HTMLElement/Roo.Element",
149           "desc" : "The context element",
150           "isOptional" : false
151         },
152         {
153           "name" : "values",
154           "type" : "Object",
155           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
156           "isOptional" : false
157         },
158         {
159           "name" : "returnElement",
160           "type" : "Boolean",
161           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
162           "isOptional" : false
163         }
164       ],
165       "returns" : [
166         {
167           "name" : "",
168           "type" : "HTMLElement/Roo.Element",
169           "desc" : "The new node or Element"
170         }
171       ]
172     },
173     {
174       "name" : "insertBefore",
175       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
176       "isStatic" : false,
177       "isConstructor" : false,
178       "isPrivate" : false,
179       "memberOf" : "Roo.Template",
180       "example" : "",
181       "deprecated" : "",
182       "since" : "",
183       "see" : "",
184       "params" : [
185         {
186           "name" : "el",
187           "type" : "String/HTMLElement/Roo.Element",
188           "desc" : "The context element",
189           "isOptional" : false
190         },
191         {
192           "name" : "values",
193           "type" : "Object",
194           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
195           "isOptional" : false
196         },
197         {
198           "name" : "returnElement",
199           "type" : "Boolean",
200           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
201           "isOptional" : false
202         }
203       ],
204       "returns" : [
205         {
206           "name" : "",
207           "type" : "HTMLElement/Roo.Element",
208           "desc" : "The new node or Element"
209         }
210       ]
211     },
212     {
213       "name" : "applyTemplate",
214       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
215       "isStatic" : false,
216       "isConstructor" : false,
217       "isPrivate" : false,
218       "memberOf" : "Roo.Template",
219       "example" : "",
220       "deprecated" : "",
221       "since" : "",
222       "see" : "",
223       "params" : [
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       "returns" : [
232         {
233           "name" : "",
234           "type" : "String",
235           "desc" : "The HTML fragment"
236         }
237       ]
238     },
239     {
240       "name" : "set",
241       "desc" : "Sets the HTML used as the template and optionally compiles it.",
242       "isStatic" : false,
243       "isConstructor" : false,
244       "isPrivate" : false,
245       "memberOf" : "Roo.Template",
246       "example" : "",
247       "deprecated" : "",
248       "since" : "",
249       "see" : "",
250       "params" : [
251         {
252           "name" : "html",
253           "type" : "String",
254           "desc" : "",
255           "isOptional" : false
256         },
257         {
258           "name" : "compile",
259           "type" : "Boolean",
260           "desc" : "(optional) True to compile the template (defaults to undefined)",
261           "isOptional" : false
262         }
263       ],
264       "returns" : [
265         {
266           "name" : "",
267           "type" : "Roo.Template",
268           "desc" : "this"
269         }
270       ]
271     },
272     {
273       "name" : "from",
274       "desc" : "Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.",
275       "isStatic" : true,
276       "isConstructor" : false,
277       "isPrivate" : false,
278       "memberOf" : "Roo.Template",
279       "example" : "",
280       "deprecated" : "",
281       "since" : "",
282       "see" : "",
283       "params" : [
284         {
285           "name" : "el",
286           "type" : "String/HTMLElement",
287           "desc" : "A DOM element or its id",
288           "isOptional" : false
289         }
290       ],
291       "returns" : []
292     },
293     {
294       "name" : "insertAfter",
295       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
296       "isStatic" : false,
297       "isConstructor" : false,
298       "isPrivate" : false,
299       "memberOf" : "Roo.Template",
300       "example" : "",
301       "deprecated" : "",
302       "since" : "",
303       "see" : "",
304       "params" : [
305         {
306           "name" : "el",
307           "type" : "String/HTMLElement/Roo.Element",
308           "desc" : "The context element",
309           "isOptional" : false
310         },
311         {
312           "name" : "values",
313           "type" : "Object",
314           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
315           "isOptional" : false
316         },
317         {
318           "name" : "returnElement",
319           "type" : "Boolean",
320           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
321           "isOptional" : false
322         }
323       ],
324       "returns" : [
325         {
326           "name" : "",
327           "type" : "HTMLElement/Roo.Element",
328           "desc" : "The new node or Element"
329         }
330       ]
331     },
332     {
333       "name" : "append",
334       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
335       "isStatic" : false,
336       "isConstructor" : false,
337       "isPrivate" : false,
338       "memberOf" : "Roo.Template",
339       "example" : "",
340       "deprecated" : "",
341       "since" : "",
342       "see" : "",
343       "params" : [
344         {
345           "name" : "el",
346           "type" : "String/HTMLElement/Roo.Element",
347           "desc" : "The context element",
348           "isOptional" : false
349         },
350         {
351           "name" : "values",
352           "type" : "Object",
353           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
354           "isOptional" : false
355         },
356         {
357           "name" : "returnElement",
358           "type" : "Boolean",
359           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
360           "isOptional" : false
361         }
362       ],
363       "returns" : [
364         {
365           "name" : "",
366           "type" : "HTMLElement/Roo.Element",
367           "desc" : "The new node or Element"
368         }
369       ]
370     },
371     {
372       "name" : "apply",
373       "desc" : "Alias for {@link #applyTemplate}",
374       "isStatic" : false,
375       "isConstructor" : false,
376       "isPrivate" : false,
377       "memberOf" : "Roo.Template",
378       "example" : "",
379       "deprecated" : "",
380       "since" : "",
381       "see" : "",
382       "params" : [],
383       "returns" : []
384     }
385   ],
386   "events" : []
387 }