/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_Template({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":["Ext.XTemplate"],"extends":null,"uses":[],"html":"

Subclasses

Files

Represents an HTML fragment template. Templates may be precompiled\nfor greater performance.

\n\n\n

For example usage see the constructor.

\n\n
Defined By

Config options

Ext.Template
view source
: Boolean
Specify true to compile the template\nimmediately (see compile). ...

Specify true to compile the template\nimmediately (see compile).\nDefaults to false.

\n
Ext.Template
view source
: Boolean
Specify true to disable format\nfunctions in the template. ...

Specify true to disable format\nfunctions in the template. If the template does not contain\nformat functions, setting disableFormats\nto true will reduce apply time. Defaults to false.

\n\n
var t = new Ext.Template(\n    '<div name=\"{id}\">',\n        '<span class=\"{cls}\">{name} {value}</span>',\n    '</div>',\n    {\n        compiled: true,      // compile immediately\n        disableFormats: true // reduce apply time since no formatting\n    }\n);\n
\n\n\n

For a list of available format functions, see Ext.util.Format.

\n

Defaults to: false

Ext.Template
view source
: RegExp
The regular expression used to match template variables. ...

The regular expression used to match template variables.\nDefaults to:

\n\n
re : /\\{([\\w\\-]+)\\}/g                                     // for Ext Core\nre : /\\{([\\w\\-]+)(?:\\:([\\w\\.]*)(?:\\((.*?)?\\))?)?\\}/g      // for Ext JS\n
\n\n

Defaults to: /\\{([\\w\\-]+)\\}/g

Defined By

Properties

Ext.Template
view source
html : Objectprivate
\n
\n
Ext.Template
view source
re : RegExp

See re.

\n

See re.

\n

Methods

Defined By

Instance Methods

Ext.Template
view source
new( config ) : Ext.Template
An instance of this class may be created by passing to the constructor either\na single argument, or multiple argument...

An instance of this class may be created by passing to the constructor either\na single argument, or multiple arguments:

\n\n
    \n
  • single argument : String/Array\n
    \nThe single argument may be either a String or an Array:
      \n
    • String :
    • \n
      var t = new Ext.Template(\"<div>Hello {0}.</div>\");\nt.append('some-element', ['foo']);\n
      \n
    • Array :
    • \nAn Array will be combined with join('').\n
      var t = new Ext.Template([\n    '<div name=\"{id}\">',\n        '<span class=\"{cls}\">{name:trim} {value:ellipsis(10)}</span>',\n    '</div>',\n]);\nt.compile();\nt.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});\n
      \n
  • \n
  • multiple arguments : String, Object, Array, ...\n
    \nMultiple arguments will be combined with join('').\n
    var t = new Ext.Template(\n    '<div name=\"{id}\">',\n        '<span class=\"{cls}\">{name} {value}</span>',\n    '</div>',\n    // a configuration object:\n    {\n        compiled: true,      // compile immediately\n        disableFormats: true // See Notes below.\n    }\n);\n
    \n

    Notes:

    \n
      \n
    • Formatting and disableFormats are not applicable for Ext Core.
    • \n
    • For a list of available format functions, see Ext.util.Format.
    • \n
    • disableFormats reduces apply time\nwhen no formatting is required.
    • \n
    \n
  • \n
\n\n

Parameters

  • config : Mixed
    \n

Returns

Ext.Template
view source
( el, values, [returnElement] ) : HTMLElement/Ext.Element
Applies the supplied values to the template and appends\nthe new node(s) to the specified el. ...

Applies the supplied values to the template and appends\nthe new node(s) to the specified el.

\n\n

For example usage see the constructor.

\n\n

Parameters

  • el : Mixed

    The context element

    \n
  • values : Object/Array

    The template values. Can be an array if the params are numeric (i.e. {0})\nor an object (i.e. {foo: 'bar'}).

    \n
  • returnElement : Boolean (optional)

    true to return an Ext.Element (defaults to undefined)

    \n

Returns

Ext.Template
view source
( values ) : String
Alias for applyTemplate\nReturns an HTML fragment of this template with the specified values applied. ...

Alias for applyTemplate\nReturns an HTML fragment of this template with the specified values applied.

\n

Parameters

  • values : Object/Array

    The template values. Can be an array if the params are numeric (i.e. {0})\nor an object (i.e. {foo: 'bar'}).

    \n

Returns

Ext.Template
view source
( values ) : String
Returns an HTML fragment of this template with the specified values applied. ...

Returns an HTML fragment of this template with the specified values applied.

\n

Parameters

  • values : Object/Array

    The template values. Can be an array if the params are numeric (i.e. {0})\nor an object (i.e. {foo: 'bar'}).

    \n

Returns

Ext.Template
view source
( ) : Ext.Templatechainable
Compiles the template into an internal function, eliminating the RegEx overhead. ...

Compiles the template into an internal function, eliminating the RegEx overhead.

\n

Returns

Ext.Template
view source
( el, values, [returnElement] ) : HTMLElement/Ext.Element
Applies the supplied values to the template and inserts the new node(s) after el. ...

Applies the supplied values to the template and inserts the new node(s) after el.

\n

Parameters

  • el : Mixed

    The context element

    \n
  • values : Object/Array

    The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})

    \n
  • returnElement : Boolean (optional)

    true to return a Ext.Element (defaults to undefined)

    \n

Returns

Ext.Template
view source
( el, values, [returnElement] ) : HTMLElement/Ext.Element
Applies the supplied values to the template and inserts the new node(s) before el. ...

Applies the supplied values to the template and inserts the new node(s) before el.

\n

Parameters

  • el : Mixed

    The context element

    \n
  • values : Object/Array

    The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})

    \n
  • returnElement : Boolean (optional)

    true to return a Ext.Element (defaults to undefined)

    \n

Returns

Ext.Template
view source
( el, values, [returnElement] ) : HTMLElement/Ext.Element
Applies the supplied values to the template and inserts the new node(s) as the first child of el. ...

Applies the supplied values to the template and inserts the new node(s) as the first child of el.

\n

Parameters

  • el : Mixed

    The context element

    \n
  • values : Object/Array

    The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})

    \n
  • returnElement : Boolean (optional)

    true to return a Ext.Element (defaults to undefined)

    \n

Returns

Ext.Template
view source
( el, values, [returnElement] ) : HTMLElement/Ext.Element
Applies the supplied values to the template and overwrites the content of el with the new node(s). ...

Applies the supplied values to the template and overwrites the content of el with the new node(s).

\n

Parameters

  • el : Mixed

    The context element

    \n
  • values : Object/Array

    The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})

    \n
  • returnElement : Boolean (optional)

    true to return a Ext.Element (defaults to undefined)

    \n

Returns

Ext.Template
view source
( html, [compile] ) : Ext.Templatechainable
Sets the HTML used as the template and optionally compiles it. ...

Sets the HTML used as the template and optionally compiles it.

\n

Parameters

  • html : String
    \n
  • compile : Boolean (optional)

    True to compile the template (defaults to undefined)

    \n

Returns

Defined By

Static Methods

Ext.Template
view source
( el, config ) : Ext.Templatestatic
Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. ...

Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML.

\n

Parameters

  • el : String/HTMLElement

    A DOM element or its id

    \n
  • config : Object

    A configuration object

    \n

Returns

","superclasses":[],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.Template","meta":{"static":true},"name":"from","id":"static-method-from"}],"event":[],"css_mixin":[]},"files":[{"href":"Template-more.html#Ext-Template","filename":"Template-more.js"},{"href":"Template.html#Ext-Template","filename":"Template.js"}],"linenr":1,"members":{"property":[{"tagname":"property","owner":"Ext.Template","meta":{},"name":"disableFormats","id":"property-disableFormats"},{"tagname":"property","owner":"Ext.Template","meta":{"private":true},"name":"html","id":"property-html"},{"tagname":"property","owner":"Ext.Template","meta":{},"name":"re","id":"property-re"}],"cfg":[{"tagname":"cfg","owner":"Ext.Template","meta":{},"name":"compiled","id":"cfg-compiled"},{"tagname":"cfg","owner":"Ext.Template","meta":{},"name":"disableFormats","id":"cfg-disableFormats"},{"tagname":"cfg","owner":"Ext.Template","meta":{},"name":"re","id":"cfg-re"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.Template","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"append","id":"method-append"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"apply","id":"method-apply"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"applyTemplate","id":"method-applyTemplate"},{"tagname":"method","owner":"Ext.Template","meta":{"chainable":true},"name":"compile","id":"method-compile"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"insertAfter","id":"method-insertAfter"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"insertBefore","id":"method-insertBefore"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"insertFirst","id":"method-insertFirst"},{"tagname":"method","owner":"Ext.Template","meta":{},"name":"overwrite","id":"method-overwrite"},{"tagname":"method","owner":"Ext.Template","meta":{"chainable":true},"name":"set","id":"method-set"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.Template","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.Template","mixins":[],"mixedInto":[]});