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