Template XTemplate
Package: | Ext |
Defined In: | XTemplate.js |
Class: | XTemplate |
Extends: | Template |
A template class that supports advanced functionality like:
XTemplate provides the templating mechanism built into:
For example usage see the constructor.
Config Options | Defined By | |
---|---|---|
compiled : Boolean Specify true to compile the template
immediately (see compile ).
Defaults to false. | Template | |
disableFormats : Boolean Specify true to disable format
functions in the template. If the template does not contain
format functions, setting ... Specify true to disable format
functions in the template. If the template does not contain
format functions, setting disableFormats
to true will reduce apply time. Defaults to false.
For a list of available format functions, see Ext.util.Format. | Template | |
re : RegExp The regular expression used to match template variables.
Defaults to:re : /\{([\w\-]+)\}/g ... The regular expression used to match template variables.
Defaults to:
| Template |
Method | Defined By | |
---|---|---|
XTemplate( Mixed config ) The Ext.Template constructor describes
the acceptable parameters to pass to the constructor. The following
examples d... The Ext.Template constructor describes
the acceptable parameters to pass to the constructor. The following
examples demonstrate all of the supported features.
Parameters:
| XTemplate | |
XTemplate.from( String/HTMLElement el ) : Ext.Template <static> Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. <static> Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. Parameters:
| XTemplate | |
append( Mixed el, Object/Array values, [Boolean returnElement] ) : HTMLElement/Ext.Element Applies the supplied values to the template and appends
the new node(s) to the specified el.
For example usage see th... Applies the supplied values to the template and appends
the new node(s) to the specified el .
For example usage see the constructor. Parameters:
| Template | |
apply( Object/Array values ) : String Alias for applyTemplate
Returns an HTML fragment of this template with the specified values applied. Alias for applyTemplate
Returns an HTML fragment of this template with the specified values applied. Parameters:
| XTemplate | |
applyTemplate( Object 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. Parameters:
| XTemplate | |
compile() : Function Compile the template to a function for optimized performance. Recommended if the template will be used frequently. Compile the template to a function for optimized performance. Recommended if the template will be used frequently. Parameters:
| XTemplate | |
insertAfter( Mixed el, Object/Array values, [Boolean 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. Parameters:
| Template | |
insertBefore( Mixed el, Object/Array values, [Boolean 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. Parameters:
| Template | |
insertFirst( Mixed el, Object/Array values, [Boolean 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. Parameters:
| Template | |
overwrite( Mixed el, Object/Array values, [Boolean 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). Parameters:
| Template |