Object | +--YAHOO.ext.DomHelper.Template
Represents an HTML fragment template
Defined in DomHelper.js
| Constructor Summary | |
YAHOO.ext.DomHelper.Template
(<String> html)
|
|
| Method Summary * Parameter types in italic indicate optional parameters | |
HTMLElement
|
append(<HTMLElement> el, <Object> values)
Applies the supplied values to the template and append the new node(s) to el |
String
|
applyTemplate(<Object> values)
Returns an HTML fragment of this template with the specified values applied |
void
|
compile()
Compiles the template into an internal function, eliminating the RegEx overhead |
HTMLElement
|
insertAfter(<HTMLElement> el, <Object> values)
Applies the supplied values to the template and inserts the new node(s) after el |
HTMLElement
|
insertBefore(<HTMLElement> el, <Object> values)
Applies the supplied values to the template and inserts the new node(s) before el |
HTMLElement
|
overwrite(<HTMLElement> el, <Object> values)
Applies the supplied values to the template and overwrites the content of el with the new node(s) |
| Constructor Detail |
YAHOO.ext.DomHelper.Template(<String> html)
html - The HTML fragment
| Method Detail |
HTMLElement append(<HTMLElement> el, <Object> values)
el - The context element
values - The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {YAHOO.ext.DomHelper.Template.prototype.foo = 'bar';})
String applyTemplate(<Object> values)
values - The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {YAHOO.ext.DomHelper.Template.prototype.foo = 'bar';})
void compile()
HTMLElement insertAfter(<HTMLElement> el, <Object> values)
el - The context element
values - The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {YAHOO.ext.DomHelper.Template.prototype.foo = 'bar';})
HTMLElement insertBefore(<HTMLElement> el, <Object> values)
el - The context element
values - The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {YAHOO.ext.DomHelper.Template.prototype.foo = 'bar';})
HTMLElement overwrite(<HTMLElement> el, <Object> values)
el - The context element
values - The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {YAHOO.ext.DomHelper.Template.prototype.foo = 'bar';})