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