Fix #6893 - fix roo docs
[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   "config" : [
23     {
24       "name" : "onLoad",
25       "type" : "Function",
26       "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
27       "memberOf" : "Roo.Template",
28       "optvals" : []
29     },
30     {
31       "name" : "html",
32       "type" : "String",
33       "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
34       "memberOf" : "Roo.Template",
35       "optvals" : []
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       "optvals" : []
43     }
44   ],
45   "methods" : [
46     {
47       "name" : "insertFirst",
48       "desc" : "Applies the supplied values to the template and inserts the new node(s) as the first child of el.",
49       "isStatic" : false,
50       "isConstructor" : false,
51       "isPrivate" : false,
52       "memberOf" : "Roo.Template",
53       "example" : "",
54       "deprecated" : "",
55       "since" : "",
56       "see" : "",
57       "params" : [
58         {
59           "name" : "el",
60           "type" : "String/HTMLElement/Roo.Element",
61           "desc" : "The context element",
62           "isOptional" : false
63         },
64         {
65           "name" : "values",
66           "type" : "Object",
67           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
68           "isOptional" : false
69         },
70         {
71           "name" : "returnElement",
72           "type" : "Boolean",
73           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
74           "isOptional" : false
75         }
76       ],
77       "returns" : [
78         {
79           "name" : "",
80           "type" : "HTMLElement/Roo.Element",
81           "desc" : "The new node or Element"
82         }
83       ]
84     },
85     {
86       "name" : "overwrite",
87       "desc" : "Applies the supplied values to the template and overwrites the content of el with the new node(s).",
88       "isStatic" : false,
89       "isConstructor" : false,
90       "isPrivate" : false,
91       "memberOf" : "Roo.Template",
92       "example" : "",
93       "deprecated" : "",
94       "since" : "",
95       "see" : "",
96       "params" : [
97         {
98           "name" : "el",
99           "type" : "String/HTMLElement/Roo.Element",
100           "desc" : "The context element",
101           "isOptional" : false
102         },
103         {
104           "name" : "values",
105           "type" : "Object",
106           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
107           "isOptional" : false
108         },
109         {
110           "name" : "returnElement",
111           "type" : "Boolean",
112           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
113           "isOptional" : false
114         }
115       ],
116       "returns" : [
117         {
118           "name" : "",
119           "type" : "HTMLElement/Roo.Element",
120           "desc" : "The new node or Element"
121         }
122       ]
123     },
124     {
125       "name" : "insertBefore",
126       "desc" : "Applies the supplied values to the template and inserts the new node(s) before el.",
127       "isStatic" : false,
128       "isConstructor" : false,
129       "isPrivate" : false,
130       "memberOf" : "Roo.Template",
131       "example" : "",
132       "deprecated" : "",
133       "since" : "",
134       "see" : "",
135       "params" : [
136         {
137           "name" : "el",
138           "type" : "String/HTMLElement/Roo.Element",
139           "desc" : "The context element",
140           "isOptional" : false
141         },
142         {
143           "name" : "values",
144           "type" : "Object",
145           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
146           "isOptional" : false
147         },
148         {
149           "name" : "returnElement",
150           "type" : "Boolean",
151           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
152           "isOptional" : false
153         }
154       ],
155       "returns" : [
156         {
157           "name" : "",
158           "type" : "HTMLElement/Roo.Element",
159           "desc" : "The new node or Element"
160         }
161       ]
162     },
163     {
164       "name" : "applyTemplate",
165       "desc" : "Returns an HTML fragment of this template with the specified values applied.",
166       "isStatic" : false,
167       "isConstructor" : false,
168       "isPrivate" : false,
169       "memberOf" : "Roo.Template",
170       "example" : "",
171       "deprecated" : "",
172       "since" : "",
173       "see" : "",
174       "params" : [
175         {
176           "name" : "values",
177           "type" : "Object",
178           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
179           "isOptional" : false
180         }
181       ],
182       "returns" : [
183         {
184           "name" : "",
185           "type" : "String",
186           "desc" : "The HTML fragment"
187         }
188       ]
189     },
190     {
191       "name" : "compile",
192       "desc" : "Compiles the template into an internal function, eliminating the RegEx overhead.",
193       "isStatic" : false,
194       "isConstructor" : false,
195       "isPrivate" : false,
196       "memberOf" : "Roo.Template",
197       "example" : "",
198       "deprecated" : "",
199       "since" : "",
200       "see" : "",
201       "params" : [],
202       "returns" : [
203         {
204           "name" : "",
205           "type" : "Roo.Template",
206           "desc" : "this"
207         }
208       ]
209     },
210     {
211       "name" : "set",
212       "desc" : "Sets the HTML used as the template and optionally compiles it.",
213       "isStatic" : false,
214       "isConstructor" : false,
215       "isPrivate" : false,
216       "memberOf" : "Roo.Template",
217       "example" : "",
218       "deprecated" : "",
219       "since" : "",
220       "see" : "",
221       "params" : [
222         {
223           "name" : "html",
224           "type" : "String",
225           "desc" : "",
226           "isOptional" : false
227         },
228         {
229           "name" : "compile",
230           "type" : "Boolean",
231           "desc" : "(optional) True to compile the template (defaults to undefined)",
232           "isOptional" : false
233         }
234       ],
235       "returns" : [
236         {
237           "name" : "",
238           "type" : "Roo.Template",
239           "desc" : "this"
240         }
241       ]
242     },
243     {
244       "name" : "from",
245       "desc" : "Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.",
246       "isStatic" : true,
247       "isConstructor" : false,
248       "isPrivate" : false,
249       "memberOf" : "Roo.Template",
250       "example" : "",
251       "deprecated" : "",
252       "since" : "",
253       "see" : "",
254       "params" : [
255         {
256           "name" : "el",
257           "type" : "String/HTMLElement",
258           "desc" : "A DOM element or its id",
259           "isOptional" : false
260         }
261       ],
262       "returns" : []
263     },
264     {
265       "name" : "insertAfter",
266       "desc" : "Applies the supplied values to the template and inserts the new node(s) after el.",
267       "isStatic" : false,
268       "isConstructor" : false,
269       "isPrivate" : false,
270       "memberOf" : "Roo.Template",
271       "example" : "",
272       "deprecated" : "",
273       "since" : "",
274       "see" : "",
275       "params" : [
276         {
277           "name" : "el",
278           "type" : "String/HTMLElement/Roo.Element",
279           "desc" : "The context element",
280           "isOptional" : false
281         },
282         {
283           "name" : "values",
284           "type" : "Object",
285           "desc" : "The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})",
286           "isOptional" : false
287         },
288         {
289           "name" : "returnElement",
290           "type" : "Boolean",
291           "desc" : "(optional) true to return a Roo.Element (defaults to undefined)",
292           "isOptional" : false
293         }
294       ],
295       "returns" : [
296         {
297           "name" : "",
298           "type" : "HTMLElement/Roo.Element",
299           "desc" : "The new node or Element"
300         }
301       ]
302     },
303     {
304       "name" : "append",
305       "desc" : "Applies the supplied values to the template and appends the new node(s) to el.",
306       "isStatic" : false,
307       "isConstructor" : false,
308       "isPrivate" : false,
309       "memberOf" : "Roo.Template",
310       "example" : "",
311       "deprecated" : "",
312       "since" : "",
313       "see" : "",
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" : "apply",
344       "desc" : "Alias for {@link #applyTemplate}",
345       "isStatic" : false,
346       "isConstructor" : false,
347       "isPrivate" : false,
348       "memberOf" : "Roo.Template",
349       "example" : "",
350       "deprecated" : "",
351       "since" : "",
352       "see" : "",
353       "params" : [],
354       "returns" : []
355     }
356   ],
357   "events" : []
358 }