Package: | Ext |
Defined In: | Template.js, Template-more.js |
Class: | Template |
Subclasses: | XTemplate |
Extends: | Object |
var t = new Ext.Template(
'<div name="{id}">',
'<span class="{cls}">{name:trim} {value:ellipsis(10)}</span>',
'</div>'
);
t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
Property | Defined By | |
---|---|---|
disableFormats : Boolean true to disable format functions (defaults to false) | Template | |
re : RegExp The regular expression used to match template variables | Template |
Method | Defined By | |
---|---|---|
Template( String/Array html )
Parameters:
| Template | |
Template.from( String/HTMLElement el , Object config )
:
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:
| Template | |
append( Mixed el , Object/Array values , [Boolean returnElement ] )
:
HTMLElement/Ext.ElementApplies the supplied values to the template and appends the new node(s) to el. Applies the supplied values to the template and appends the new node(s) to el. Parameters:
| Template | |
apply( Object/Array values )
:
StringAlias 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:
| Template | |
insertAfter( Mixed el , Object/Array values , [Boolean returnElement ] )
:
HTMLElement/Ext.ElementApplies 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.ElementApplies 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.ElementApplies 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.ElementApplies 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 | |
set( String html , [Boolean compile ] )
:
Ext.TemplateSets the HTML used as the template and optionally compiles it. Sets the HTML used as the template and optionally compiles it. Parameters:
| Template |