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