sync
[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" : true,
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     },
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" : "insertFirst",
104       "type" : "function",
105       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
106       "sig" : "(el, values, returnElement)",
107       "static" : false,
108       "memberOf" : "Roo.Template",
109       "isStatic" : false,
110       "isConstructor" : false,
111       "isPrivate" : false,
112       "example" : "",
113       "deprecated" : "",
114       "since" : "",
115       "see" : "",
116       "exceptions" : "",
117       "requires" : "",
118       "params" : [
119         {
120           "name" : "el",
121           "type" : "String/HTMLElement/Roo.Element",
122           "desc" : "The context element",
123           "isOptional" : false
124         },
125         {
126           "name" : "values",
127           "type" : "Object",
128           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
129           "isOptional" : false
130         },
131         {
132           "name" : "returnElement",
133           "type" : "Boolean",
134           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
135           "isOptional" : false
136         }
137       ],
138       "returns" : [
139         {
140           "name" : "",
141           "type" : "HTMLElement/Roo.Element",
142           "desc" : "The new node or Element"
143         }
144       ]
145     },
146     {
147       "name" : "overwrite",
148       "type" : "function",
149       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
150       "sig" : "(el, values, returnElement)",
151       "static" : false,
152       "memberOf" : "Roo.Template",
153       "isStatic" : false,
154       "isConstructor" : false,
155       "isPrivate" : false,
156       "example" : "",
157       "deprecated" : "",
158       "since" : "",
159       "see" : "",
160       "exceptions" : "",
161       "requires" : "",
162       "params" : [
163         {
164           "name" : "el",
165           "type" : "String/HTMLElement/Roo.Element",
166           "desc" : "The context element",
167           "isOptional" : false
168         },
169         {
170           "name" : "values",
171           "type" : "Object",
172           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
173           "isOptional" : false
174         },
175         {
176           "name" : "returnElement",
177           "type" : "Boolean",
178           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
179           "isOptional" : false
180         }
181       ],
182       "returns" : [
183         {
184           "name" : "",
185           "type" : "HTMLElement/Roo.Element",
186           "desc" : "The new node or Element"
187         }
188       ]
189     },
190     {
191       "name" : "insertBefore",
192       "type" : "function",
193       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
194       "sig" : "(el, values, returnElement)",
195       "static" : false,
196       "memberOf" : "Roo.Template",
197       "isStatic" : false,
198       "isConstructor" : false,
199       "isPrivate" : false,
200       "example" : "",
201       "deprecated" : "",
202       "since" : "",
203       "see" : "",
204       "exceptions" : "",
205       "requires" : "",
206       "params" : [
207         {
208           "name" : "el",
209           "type" : "String/HTMLElement/Roo.Element",
210           "desc" : "The context element",
211           "isOptional" : false
212         },
213         {
214           "name" : "values",
215           "type" : "Object",
216           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
217           "isOptional" : false
218         },
219         {
220           "name" : "returnElement",
221           "type" : "Boolean",
222           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
223           "isOptional" : false
224         }
225       ],
226       "returns" : [
227         {
228           "name" : "",
229           "type" : "HTMLElement/Roo.Element",
230           "desc" : "The new node or Element"
231         }
232       ]
233     },
234     {
235       "name" : "applyTemplate",
236       "type" : "function",
237       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
238       "sig" : "(values)",
239       "static" : false,
240       "memberOf" : "Roo.Template",
241       "isStatic" : false,
242       "isConstructor" : false,
243       "isPrivate" : false,
244       "example" : "",
245       "deprecated" : "",
246       "since" : "",
247       "see" : "",
248       "exceptions" : "",
249       "requires" : "",
250       "params" : [
251         {
252           "name" : "values",
253           "type" : "Object",
254           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
255           "isOptional" : false
256         }
257       ],
258       "returns" : [
259         {
260           "name" : "",
261           "type" : "String",
262           "desc" : "The HTML fragment"
263         }
264       ]
265     },
266     {
267       "name" : "set",
268       "type" : "function",
269       "desc" : "Sets the HTML used as the template and optionally compiles it.",
270       "sig" : "(html, compile)",
271       "static" : false,
272       "memberOf" : "Roo.Template",
273       "isStatic" : false,
274       "isConstructor" : false,
275       "isPrivate" : false,
276       "example" : "",
277       "deprecated" : "",
278       "since" : "",
279       "see" : "",
280       "exceptions" : "",
281       "requires" : "",
282       "params" : [
283         {
284           "name" : "html",
285           "type" : "String",
286           "desc" : "",
287           "isOptional" : false
288         },
289         {
290           "name" : "compile",
291           "type" : "Boolean",
292           "desc" : "(optional) True to compile the template (defaults to undefined)",
293           "isOptional" : false
294         }
295       ],
296       "returns" : [
297         {
298           "name" : "",
299           "type" : "Roo.Template",
300           "desc" : "this"
301         }
302       ]
303     },
304     {
305       "name" : "from",
306       "type" : "function",
307       "desc" : "Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.",
308       "sig" : "(el)",
309       "static" : true,
310       "memberOf" : "Roo.Template",
311       "isStatic" : true,
312       "isConstructor" : false,
313       "isPrivate" : false,
314       "example" : "",
315       "deprecated" : "",
316       "since" : "",
317       "see" : "",
318       "exceptions" : "",
319       "requires" : "",
320       "params" : [
321         {
322           "name" : "el",
323           "type" : "String/HTMLElement",
324           "desc" : "A DOM element or its id",
325           "isOptional" : false
326         }
327       ],
328       "returns" : []
329     },
330     {
331       "name" : "insertAfter",
332       "type" : "function",
333       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
334       "sig" : "(el, values, returnElement)",
335       "static" : false,
336       "memberOf" : "Roo.Template",
337       "isStatic" : false,
338       "isConstructor" : false,
339       "isPrivate" : false,
340       "example" : "",
341       "deprecated" : "",
342       "since" : "",
343       "see" : "",
344       "exceptions" : "",
345       "requires" : "",
346       "params" : [
347         {
348           "name" : "el",
349           "type" : "String/HTMLElement/Roo.Element",
350           "desc" : "The context element",
351           "isOptional" : false
352         },
353         {
354           "name" : "values",
355           "type" : "Object",
356           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
357           "isOptional" : false
358         },
359         {
360           "name" : "returnElement",
361           "type" : "Boolean",
362           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
363           "isOptional" : false
364         }
365       ],
366       "returns" : [
367         {
368           "name" : "",
369           "type" : "HTMLElement/Roo.Element",
370           "desc" : "The new node or Element"
371         }
372       ]
373     },
374     {
375       "name" : "append",
376       "type" : "function",
377       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
378       "sig" : "(el, values, returnElement)",
379       "static" : false,
380       "memberOf" : "Roo.Template",
381       "isStatic" : false,
382       "isConstructor" : false,
383       "isPrivate" : false,
384       "example" : "",
385       "deprecated" : "",
386       "since" : "",
387       "see" : "",
388       "exceptions" : "",
389       "requires" : "",
390       "params" : [
391         {
392           "name" : "el",
393           "type" : "String/HTMLElement/Roo.Element",
394           "desc" : "The context element",
395           "isOptional" : false
396         },
397         {
398           "name" : "values",
399           "type" : "Object",
400           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
401           "isOptional" : false
402         },
403         {
404           "name" : "returnElement",
405           "type" : "Boolean",
406           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
407           "isOptional" : false
408         }
409       ],
410       "returns" : [
411         {
412           "name" : "",
413           "type" : "HTMLElement/Roo.Element",
414           "desc" : "The new node or Element"
415         }
416       ]
417     },
418     {
419       "name" : "apply",
420       "type" : "function",
421       "desc" : "Alias for {@link #applyTemplate}",
422       "sig" : "()\n{\n\n}",
423       "static" : false,
424       "memberOf" : "Roo.Template",
425       "isStatic" : false,
426       "isConstructor" : false,
427       "isPrivate" : false,
428       "example" : "",
429       "deprecated" : "",
430       "since" : "",
431       "see" : "",
432       "exceptions" : "",
433       "requires" : "",
434       "params" : [],
435       "returns" : []
436     }
437   ],
438   "events" : []
439 }