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