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