Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / output / Ext.Template.js
1 Ext.data.JsonP.Ext_Template({
2   "tagname": "class",
3   "name": "Ext.Template",
4   "doc": "<p>Represents an HTML fragment template. Templates may be <a href=\"#/api/Ext.Template--compile\" rel=\"Ext.Template--compile\" class=\"docClass\">precompiled</a>\nfor greater performance.</p>\n\n\n<p>An instance of this class may be created by passing to the constructor either\na single argument, or multiple arguments:</p>\n\n<div class=\"mdetail-params\"><ul>\n<li><b>single argument</b> : String/Array\n<div class=\"sub-desc\">\nThe single argument may be either a String or an Array:<ul>\n<li><tt>String</tt> : </li>\n<pre><code>var t = new Ext.Template(\"&lt;div>Hello {0}.&lt;/div>\");\nt.<a href=\"#/api/Ext.Template-method-append\" rel=\"Ext.Template-method-append\" class=\"docClass\">append</a>('some-element', ['foo']);\n   </code></pre>\n<li><tt>Array</tt> : </li>\nAn Array will be combined with <code>join('')</code>.\n<pre><code>var t = new Ext.Template([\n    '&lt;div name=\"{id}\"&gt;',\n        '&lt;span class=\"{cls}\"&gt;{name:trim} {value:ellipsis(10)}&lt;/span&gt;',\n    '&lt;/div&gt;',\n]);\nt.<a href=\"#/api/Ext.Template--compile\" rel=\"Ext.Template--compile\" class=\"docClass\">compile</a>();\nt.<a href=\"#/api/Ext.Template-method-append\" rel=\"Ext.Template-method-append\" class=\"docClass\">append</a>('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});\n   </code></pre>\n</ul></div></li>\n<li><b>multiple arguments</b> : String, Object, Array, ...\n<div class=\"sub-desc\">\nMultiple arguments will be combined with <code>join('')</code>.\n<pre><code>var t = new Ext.Template(\n    '&lt;div name=\"{id}\"&gt;',\n        '&lt;span class=\"{cls}\"&gt;{name} {value}&lt;/span&gt;',\n    '&lt;/div&gt;',\n    // a configuration object:\n    {\n        compiled: true,      // <a href=\"#/api/Ext.Template--compile\" rel=\"Ext.Template--compile\" class=\"docClass\">compile</a> immediately\n    }\n);\n   </code></pre>\n<p><b>Notes</b>:</p>\n<div class=\"mdetail-params\"><ul>\n<li>For a list of available format functions, see <a href=\"#/api/Ext.util.Format\" rel=\"Ext.util.Format\" class=\"docClass\">Ext.util.Format</a>.</li>\n<li><code>disableFormats</code> reduces <code><a href=\"#/api/Ext.Template-method-apply\" rel=\"Ext.Template-method-apply\" class=\"docClass\">apply</a></code> time\nwhen no formatting is required.</li>\n</ul></div>\n</div></li>\n</ul></div>\n\n",
5   "extends": null,
6   "mixins": [
7
8   ],
9   "alternateClassNames": [
10
11   ],
12   "xtype": null,
13   "author": null,
14   "docauthor": null,
15   "singleton": false,
16   "private": false,
17   "cfg": [
18     {
19       "tagname": "cfg",
20       "name": "disableFormats",
21       "member": "Ext.Template",
22       "type": "Boolean",
23       "doc": "<p>true to disable format functions in the template. If the template doesn't contain format functions, setting\ndisableFormats to true will reduce apply time (defaults to false)</p>\n",
24       "private": false,
25       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
26       "linenr": 111,
27       "html_filename": "Template2.html",
28       "href": "Template2.html#Ext-Template-cfg-disableFormats",
29       "shortDoc": "true to disable format functions in the template. If the template doesn't contain format functions, setting\ndisableFo..."
30     }
31   ],
32   "method": [
33     {
34       "tagname": "method",
35       "name": "append",
36       "member": "Ext.Template",
37       "doc": "<p>Applies the supplied <code>values</code> to the template and appends\nthe new node(s) to the specified <code>el</code>.</p>\n\n<p>For example usage <a href=\"#/api/Ext.Template--Template\" rel=\"Ext.Template--Template\" class=\"docClass\">see the constructor</a>.</p>\n\n",
38       "params": [
39         {
40           "type": "Mixed",
41           "name": "el",
42           "doc": "<p>The context element</p>\n",
43           "optional": false
44         },
45         {
46           "type": "Object/Array",
47           "name": "values",
48           "doc": "<p>The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)\nor an object (i.e. <code>{foo: 'bar'}</code>).</p>\n",
49           "optional": false
50         },
51         {
52           "type": "Boolean",
53           "name": "returnElement",
54           "doc": "<p>(optional) true to return an <a href=\"#/api/Ext.core.Element\" rel=\"Ext.core.Element\" class=\"docClass\">Ext.core.Element</a> (defaults to undefined)</p>\n",
55           "optional": true
56         }
57       ],
58       "return": {
59         "type": "HTMLElement/Ext.core.Element",
60         "doc": "<p>The new node or Element</p>\n"
61       },
62       "private": false,
63       "static": false,
64       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
65       "linenr": 237,
66       "html_filename": "Template2.html",
67       "href": "Template2.html#Ext-Template-method-append",
68       "shortDoc": "Applies the supplied values to the template and appends\nthe new node(s) to the specified el.\n\nFor example usage see t..."
69     },
70     {
71       "tagname": "method",
72       "name": "apply",
73       "member": "Ext.Template",
74       "doc": "<p>Alias for <a href=\"#/api/Ext.Template--applyTemplate\" rel=\"Ext.Template--applyTemplate\" class=\"docClass\">applyTemplate</a>\nReturns an HTML fragment of this template with the specified <code>values</code> applied.</p>\n",
75       "params": [
76         {
77           "type": "Object/Array",
78           "name": "values",
79           "doc": "<p>The template values. Can be an array if the params are numeric (i.e. <code>{0}</code>)\nor an object (i.e. <code>{foo: 'bar'}</code>).</p>\n",
80           "optional": false
81         }
82       ],
83       "return": {
84         "type": "String",
85         "doc": "<p>The HTML fragment</p>\n"
86       },
87       "private": false,
88       "static": false,
89       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
90       "linenr": 272,
91       "html_filename": "Template2.html",
92       "href": "Template2.html#Ext-Template-method-apply",
93       "shortDoc": "<p>Alias for <a href=\"#/api/Ext.Template--applyTemplate\" rel=\"Ext.Template--applyTemplate\" class=\"docClass\">applyTemplate</a>\nReturns an HTML fragment of this template with the specified <code>values</code> applied.</p>\n"
94     },
95     {
96       "tagname": "method",
97       "name": "from",
98       "member": "Ext.Template",
99       "doc": "<p>Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.</p>\n",
100       "params": [
101         {
102           "type": "String/HTMLElement",
103           "name": "el",
104           "doc": "<p>A DOM element or its id</p>\n",
105           "optional": false
106         },
107         {
108           "type": "Object",
109           "name": "config",
110           "doc": "<p>A configuration object</p>\n",
111           "optional": false
112         }
113       ],
114       "return": {
115         "type": "Ext.Template",
116         "doc": "<p>The created template</p>\n"
117       },
118       "private": false,
119       "static": true,
120       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
121       "linenr": 59,
122       "html_filename": "Template2.html",
123       "href": "Template2.html#Ext-Template-method-from",
124       "shortDoc": "<p>Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.</p>\n"
125     },
126     {
127       "tagname": "method",
128       "name": "insertAfter",
129       "member": "Ext.Template",
130       "doc": "<p>Applies the supplied values to the template and inserts the new node(s) after el.</p>\n",
131       "params": [
132         {
133           "type": "Mixed",
134           "name": "el",
135           "doc": "<p>The context element</p>\n",
136           "optional": false
137         },
138         {
139           "type": "Object/Array",
140           "name": "values",
141           "doc": "<p>The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})</p>\n",
142           "optional": false
143         },
144         {
145           "type": "Boolean",
146           "name": "returnElement",
147           "doc": "<p>(optional) true to return a <a href=\"#/api/Ext.core.Element\" rel=\"Ext.core.Element\" class=\"docClass\">Ext.core.Element</a> (defaults to undefined)</p>\n",
148           "optional": true
149         }
150       ],
151       "return": {
152         "type": "HTMLElement/Ext.core.Element",
153         "doc": "<p>The new node or Element</p>\n"
154       },
155       "private": false,
156       "static": false,
157       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
158       "linenr": 226,
159       "html_filename": "Template2.html",
160       "href": "Template2.html#Ext-Template-method-insertAfter",
161       "shortDoc": "<p>Applies the supplied values to the template and inserts the new node(s) after el.</p>\n"
162     },
163     {
164       "tagname": "method",
165       "name": "insertBefore",
166       "member": "Ext.Template",
167       "doc": "<p>Applies the supplied values to the template and inserts the new node(s) before el.</p>\n",
168       "params": [
169         {
170           "type": "Mixed",
171           "name": "el",
172           "doc": "<p>The context element</p>\n",
173           "optional": false
174         },
175         {
176           "type": "Object/Array",
177           "name": "values",
178           "doc": "<p>The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})</p>\n",
179           "optional": false
180         },
181         {
182           "type": "Boolean",
183           "name": "returnElement",
184           "doc": "<p>(optional) true to return a <a href=\"#/api/Ext.core.Element\" rel=\"Ext.core.Element\" class=\"docClass\">Ext.core.Element</a> (defaults to undefined)</p>\n",
185           "optional": true
186         }
187       ],
188       "return": {
189         "type": "HTMLElement/Ext.core.Element",
190         "doc": "<p>The new node or Element</p>\n"
191       },
192       "private": false,
193       "static": false,
194       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
195       "linenr": 215,
196       "html_filename": "Template2.html",
197       "href": "Template2.html#Ext-Template-method-insertBefore",
198       "shortDoc": "<p>Applies the supplied values to the template and inserts the new node(s) before el.</p>\n"
199     },
200     {
201       "tagname": "method",
202       "name": "insertFirst",
203       "member": "Ext.Template",
204       "doc": "<p>Applies the supplied values to the template and inserts the new node(s) as the first child of el.</p>\n",
205       "params": [
206         {
207           "type": "Mixed",
208           "name": "el",
209           "doc": "<p>The context element</p>\n",
210           "optional": false
211         },
212         {
213           "type": "Object/Array",
214           "name": "values",
215           "doc": "<p>The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})</p>\n",
216           "optional": false
217         },
218         {
219           "type": "Boolean",
220           "name": "returnElement",
221           "doc": "<p>(optional) true to return a <a href=\"#/api/Ext.core.Element\" rel=\"Ext.core.Element\" class=\"docClass\">Ext.core.Element</a> (defaults to undefined)</p>\n",
222           "optional": true
223         }
224       ],
225       "return": {
226         "type": "HTMLElement/Ext.core.Element",
227         "doc": "<p>The new node or Element</p>\n"
228       },
229       "private": false,
230       "static": false,
231       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
232       "linenr": 204,
233       "html_filename": "Template2.html",
234       "href": "Template2.html#Ext-Template-method-insertFirst",
235       "shortDoc": "<p>Applies the supplied values to the template and inserts the new node(s) as the first child of el.</p>\n"
236     },
237     {
238       "tagname": "method",
239       "name": "overwrite",
240       "member": "Ext.Template",
241       "doc": "<p>Applies the supplied values to the template and overwrites the content of el with the new node(s).</p>\n",
242       "params": [
243         {
244           "type": "Mixed",
245           "name": "el",
246           "doc": "<p>The context element</p>\n",
247           "optional": false
248         },
249         {
250           "type": "Object/Array",
251           "name": "values",
252           "doc": "<p>The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})</p>\n",
253           "optional": false
254         },
255         {
256           "type": "Boolean",
257           "name": "returnElement",
258           "doc": "<p>(optional) true to return a <a href=\"#/api/Ext.core.Element\" rel=\"Ext.core.Element\" class=\"docClass\">Ext.core.Element</a> (defaults to undefined)</p>\n",
259           "optional": true
260         }
261       ],
262       "return": {
263         "type": "HTMLElement/Ext.core.Element",
264         "doc": "<p>The new node or Element</p>\n"
265       },
266       "private": false,
267       "static": false,
268       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
269       "linenr": 258,
270       "html_filename": "Template2.html",
271       "href": "Template2.html#Ext-Template-method-overwrite",
272       "shortDoc": "<p>Applies the supplied values to the template and overwrites the content of el with the new node(s).</p>\n"
273     },
274     {
275       "tagname": "method",
276       "name": "set",
277       "member": "Ext.Template",
278       "doc": "<p>Sets the HTML used as the template and optionally compiles it.</p>\n",
279       "params": [
280         {
281           "type": "String",
282           "name": "html",
283           "doc": "\n",
284           "optional": false
285         },
286         {
287           "type": "Boolean",
288           "name": "compile",
289           "doc": "<p>(optional) True to compile the template (defaults to undefined)</p>\n",
290           "optional": true
291         }
292       ],
293       "return": {
294         "type": "Ext.Template",
295         "doc": "<p>this</p>\n"
296       },
297       "private": false,
298       "static": false,
299       "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
300       "linenr": 154,
301       "html_filename": "Template2.html",
302       "href": "Template2.html#Ext-Template-method-set",
303       "shortDoc": "<p>Sets the HTML used as the template and optionally compiles it.</p>\n"
304     }
305   ],
306   "property": [
307
308   ],
309   "event": [
310
311   ],
312   "filename": "/Users/nick/Projects/sencha/SDK/platform/src/Template.js",
313   "linenr": 1,
314   "html_filename": "Template2.html",
315   "href": "Template2.html#Ext-Template",
316   "cssVar": [
317
318   ],
319   "cssMixin": [
320
321   ],
322   "component": false,
323   "superclasses": [
324
325   ],
326   "subclasses": [
327     "Ext.XTemplate"
328   ],
329   "mixedInto": [
330
331   ],
332   "allMixins": [
333
334   ]
335 });