sync
[roojs1] / docs / symbols / Roo.Template.json
1 {
2   "name" : "Roo.Template",
3   "augments" : [],
4   "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>.",
5   "isSingleton" : false,
6   "isStatic" : false,
7   "isBuiltin" : false,
8   "memberOf" : "Template",
9   "example" : "",
10   "deprecated" : "",
11   "since" : "",
12   "see" : "",
13   "params" : [
14     {
15       "name" : "cfg",
16       "type" : "Object",
17       "desc" : "- Configuration object.",
18       "isOptional" : false
19     }
20   ],
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" : ""
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" : ""
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" : ""
42     }
43   ],
44   "methods" : [
45     {
46       "name" : "insertFirst",
47       "type" : "function",
48       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
49       "sig" : "(el, values, returnElement)",
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" : "el",
64           "type" : "String/HTMLElement/Roo.Element",
65           "desc" : "The context element",
66           "isOptional" : false
67         },
68         {
69           "name" : "values",
70           "type" : "Object",
71           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
72           "isOptional" : false
73         },
74         {
75           "name" : "returnElement",
76           "type" : "Boolean",
77           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
78           "isOptional" : false
79         }
80       ],
81       "returns" : [
82         {
83           "name" : "",
84           "type" : "HTMLElement/Roo.Element",
85           "desc" : "The new node or Element"
86         }
87       ]
88     },
89     {
90       "name" : "overwrite",
91       "type" : "function",
92       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
93       "sig" : "(el, values, returnElement)",
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         {
107           "name" : "el",
108           "type" : "String/HTMLElement/Roo.Element",
109           "desc" : "The context element",
110           "isOptional" : false
111         },
112         {
113           "name" : "values",
114           "type" : "Object",
115           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
116           "isOptional" : false
117         },
118         {
119           "name" : "returnElement",
120           "type" : "Boolean",
121           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
122           "isOptional" : false
123         }
124       ],
125       "returns" : [
126         {
127           "name" : "",
128           "type" : "HTMLElement/Roo.Element",
129           "desc" : "The new node or Element"
130         }
131       ]
132     },
133     {
134       "name" : "insertBefore",
135       "type" : "function",
136       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
137       "sig" : "(el, values, returnElement)",
138       "static" : false,
139       "memberOf" : "",
140       "isStatic" : false,
141       "isConstructor" : false,
142       "isPrivate" : false,
143       "example" : "",
144       "deprecated" : "",
145       "since" : "",
146       "see" : "",
147       "exceptions" : "",
148       "requires" : "",
149       "params" : [
150         {
151           "name" : "el",
152           "type" : "String/HTMLElement/Roo.Element",
153           "desc" : "The context element",
154           "isOptional" : false
155         },
156         {
157           "name" : "values",
158           "type" : "Object",
159           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
160           "isOptional" : false
161         },
162         {
163           "name" : "returnElement",
164           "type" : "Boolean",
165           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
166           "isOptional" : false
167         }
168       ],
169       "returns" : [
170         {
171           "name" : "",
172           "type" : "HTMLElement/Roo.Element",
173           "desc" : "The new node or Element"
174         }
175       ]
176     },
177     {
178       "name" : "applyTemplate",
179       "type" : "function",
180       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
181       "sig" : "(values)",
182       "static" : false,
183       "memberOf" : "",
184       "isStatic" : false,
185       "isConstructor" : false,
186       "isPrivate" : false,
187       "example" : "",
188       "deprecated" : "",
189       "since" : "",
190       "see" : "",
191       "exceptions" : "",
192       "requires" : "",
193       "params" : [
194         {
195           "name" : "values",
196           "type" : "Object",
197           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
198           "isOptional" : false
199         }
200       ],
201       "returns" : [
202         {
203           "name" : "",
204           "type" : "String",
205           "desc" : "The HTML fragment"
206         }
207       ]
208     },
209     {
210       "name" : "compile",
211       "type" : "function",
212       "desc" : "Compiles the template into an internal function, eliminating the RegEx overhead.",
213       "sig" : "()\n{\n\n}",
214       "static" : false,
215       "memberOf" : "",
216       "isStatic" : false,
217       "isConstructor" : false,
218       "isPrivate" : false,
219       "example" : "",
220       "deprecated" : "",
221       "since" : "",
222       "see" : "",
223       "exceptions" : "",
224       "requires" : "",
225       "params" : [],
226       "returns" : [
227         {
228           "name" : "",
229           "type" : "Roo.Template",
230           "desc" : "this"
231         }
232       ]
233     },
234     {
235       "name" : "set",
236       "type" : "function",
237       "desc" : "Sets the HTML used as the template and optionally compiles it.",
238       "sig" : "(html, compile)",
239       "static" : false,
240       "memberOf" : "",
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" : "html",
253           "type" : "String",
254           "desc" : "",
255           "isOptional" : false
256         },
257         {
258           "name" : "compile",
259           "type" : "Boolean",
260           "desc" : "(optional) True to compile the template (defaults to undefined)",
261           "isOptional" : false
262         }
263       ],
264       "returns" : [
265         {
266           "name" : "",
267           "type" : "Roo.Template",
268           "desc" : "this"
269         }
270       ]
271     },
272     {
273       "name" : "from",
274       "type" : "function",
275       "desc" : "Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.",
276       "sig" : "(el)",
277       "static" : true,
278       "memberOf" : "",
279       "isStatic" : true,
280       "isConstructor" : false,
281       "isPrivate" : false,
282       "example" : "",
283       "deprecated" : "",
284       "since" : "",
285       "see" : "",
286       "exceptions" : "",
287       "requires" : "",
288       "params" : [
289         {
290           "name" : "el",
291           "type" : "String/HTMLElement",
292           "desc" : "A DOM element or its id",
293           "isOptional" : false
294         }
295       ],
296       "returns" : []
297     },
298     {
299       "name" : "insertAfter",
300       "type" : "function",
301       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
302       "sig" : "(el, values, returnElement)",
303       "static" : false,
304       "memberOf" : "",
305       "isStatic" : false,
306       "isConstructor" : false,
307       "isPrivate" : false,
308       "example" : "",
309       "deprecated" : "",
310       "since" : "",
311       "see" : "",
312       "exceptions" : "",
313       "requires" : "",
314       "params" : [
315         {
316           "name" : "el",
317           "type" : "String/HTMLElement/Roo.Element",
318           "desc" : "The context element",
319           "isOptional" : false
320         },
321         {
322           "name" : "values",
323           "type" : "Object",
324           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
325           "isOptional" : false
326         },
327         {
328           "name" : "returnElement",
329           "type" : "Boolean",
330           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
331           "isOptional" : false
332         }
333       ],
334       "returns" : [
335         {
336           "name" : "",
337           "type" : "HTMLElement/Roo.Element",
338           "desc" : "The new node or Element"
339         }
340       ]
341     },
342     {
343       "name" : "append",
344       "type" : "function",
345       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
346       "sig" : "(el, values, returnElement)",
347       "static" : false,
348       "memberOf" : "",
349       "isStatic" : false,
350       "isConstructor" : false,
351       "isPrivate" : false,
352       "example" : "",
353       "deprecated" : "",
354       "since" : "",
355       "see" : "",
356       "exceptions" : "",
357       "requires" : "",
358       "params" : [
359         {
360           "name" : "el",
361           "type" : "String/HTMLElement/Roo.Element",
362           "desc" : "The context element",
363           "isOptional" : false
364         },
365         {
366           "name" : "values",
367           "type" : "Object",
368           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
369           "isOptional" : false
370         },
371         {
372           "name" : "returnElement",
373           "type" : "Boolean",
374           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
375           "isOptional" : false
376         }
377       ],
378       "returns" : [
379         {
380           "name" : "",
381           "type" : "HTMLElement/Roo.Element",
382           "desc" : "The new node or Element"
383         }
384       ]
385     },
386     {
387       "name" : "apply",
388       "type" : "function",
389       "desc" : "Alias for {@link #applyTemplate}",
390       "sig" : "()\n{\n\n}",
391       "static" : false,
392       "memberOf" : "",
393       "isStatic" : false,
394       "isConstructor" : false,
395       "isPrivate" : false,
396       "example" : "",
397       "deprecated" : "",
398       "since" : "",
399       "see" : "",
400       "exceptions" : "",
401       "requires" : "",
402       "params" : [],
403       "returns" : []
404     }
405   ],
406   "events" : []
407 }