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