Roo.Template Roo.MasterTemplate
Package: | Roo |
Defined In: | Roo/MasterTemplate.js. |
Class: | MasterTemplate |
Extends: | Roo.Template |
var t = new Roo.MasterTemplate(
'<select name="{name}">',
'<tpl name="options"><option value="{value:trim}">{text:ellipsis(10)}</option></tpl>',
'</select>'
);
t.add('options', {value: 'foo', text: 'bar'});
// or you can add multiple child elements in one shot
t.addAll('options', [
{value: 'foo', text: 'bar'},
{value: 'foo2', text: 'bar2'},
{value: 'foo3', text: 'bar3'}
]);
// then append, applying the master template values
t.append('my-form', {name: 'my-select'});
Method | Defined By | |
---|---|---|
new Roo.MasterTemplate
()
Create a new Roo.MasterTemplate
Create a new Roo.MasterTemplate
|
||
Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML.
|
Roo.MasterTemplate | |
Roo.MasterTemplate | ||
addAll
()
Alias for fill().
Alias for fill().
|
Roo.MasterTemplate | |
append
(String/HTMLElement/Roo.Element el, Object values, Boolean returnElement)
:
HTMLElement/Roo.Element
Applies 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.
|
Roo.Template | |
apply
()
Alias for {link applyTemplate}
Alias for {link applyTemplate}
|
Roo.Template | |
Returns an HTML fragment of this template with the specified values applied.
|
Roo.Template | |
compile
()
:
Roo.Template
Compiles the template into an internal function, eliminating the RegEx overhead.
Compiles the template into an internal function, eliminating the RegEx overhead.
|
Roo.Template | |
Applies all the passed values to a child template.
Applies all the passed values to a child template.
|
Roo.MasterTemplate | |
insertAfter
(String/HTMLElement/Roo.Element el, Object values, Boolean returnElement)
:
HTMLElement/Roo.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.
|
Roo.Template | |
insertBefore
(String/HTMLElement/Roo.Element el, Object values, Boolean returnElement)
:
HTMLElement/Roo.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.
|
Roo.Template | |
insertFirst
(String/HTMLElement/Roo.Element el, Object values, Boolean returnElement)
:
HTMLElement/Roo.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.
|
Roo.Template | |
overwrite
(String/HTMLElement/Roo.Element el, Object values, Boolean returnElement)
:
HTMLElement/Roo.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).
|
Roo.Template | |
reset
()
:
MasterTemplate
Resets the template for reuse
Resets the template for reuse
|
Roo.MasterTemplate | |
Sets the HTML used as the template and optionally compiles it.
Sets the HTML used as the template and optionally compiles it.
|
Roo.Template |