Roo.Template Roo.DomTemplate
Package: | Roo |
Defined In: | Roo/DomTemplate.js. |
Class: | DomTemplate |
Extends: | Roo.Template |
{a_variable} - output encoded.
{a_variable.format:("Y-m-d")} - call a method on the variable
{a_variable:raw} - unencoded output
{a_variable:toFixed(1,2)} - Roo.util.Format."toFixed"
{a_variable:this.method_on_template(...)} - call a method on the template object.
<div roo-for="a_variable or condition.."></div>
<div roo-if="a_variable or condition"></div>
<div roo-exec="some javascript"></div>
<div roo-name="named_template"></div>
Options | Defined By | |
---|---|---|
html : String
The HTML fragment or an array of fragments to join("") or multiple arguments to join("")
The HTML fragment or an array of fragments to join("") or multiple arguments to join("")
|
Roo.Template | |
url : String
The Url to load the template from.
The Url to load the template from. beware if you are loading from a url, the data may not be ready if you use it instantly..
it should be fixed so that template is observable... |
Roo.Template |
Method | Defined By | |
---|---|---|
new Roo.DomTemplate
()
Create a new Roo.DomTemplate
Create a new Roo.DomTemplate
|
||
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 | |
same as applyTemplate, except it's done to one of the subTemplates
when using named templates, you can do: var str = pl.applySubTemplate('your-name', values); |
Roo.DomTemplate | |
Returns an HTML fragment of this template with the specified values applied.
|
Roo.Template | |
compile
()
compile the template
This is not recursive, so I'm not sure how nested templates are really going to be handled.
compile the template
This is not recursive, so I'm not sure how nested templates are really going to be handled.. |
Roo.DomTemplate | |
compileTpl
()
Compile a segment of the template into a 'sub-template'
Compile a segment of the template into a 'sub-template'
|
Roo.DomTemplate | |
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 | |
Sets the HTML used as the template and optionally compiles it.
Sets the HTML used as the template and optionally compiles it.
|
Roo.Template |