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