module Ext_Template:Represents an HTML fragment template. Templates ma ...sig
..end
Represents an HTML fragment template. Templates may be precompiled for greater performance.
An instance of this class may be created by passing to the constructor either a single argument, or multiple arguments:
The single argument may be either a String or an Array:
String:
var t = new Ext.Template("<div>Hello {0}.</div>");
t.append('some-element', ['foo']);
Array:
An Array will be combined with join('')
.
var t = new Ext.Template([
'<div name="{id}">',
'<span class="{cls}">{name:trim} {value:ellipsis(10)}</span>',
'</div>',
]);
t.compile();
t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
Multiple arguments will be combined with join('')
.
var t = new Ext.Template(
'<div name="{id}">',
'<span class="{cls}">{name} {value}</span>',
'</div>',
// a configuration object:
{
compiled: true, // compile immediately
}
);
disableFormats
reduces apply
time when no formatting is required.class type t =object
..end
class type configs =object
..end
class type events =object
..end
class type statics =object
..end
val get_static : unit -> statics Js.t
val static : statics Js.t
val from : 'a Js.t -> 'b Js.t Js.optdef -> 'c Js.t
statics.from
val of_configs : configs Js.t -> t Js.t
of_configs c
casts a config object c
to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o
casts instance o
of class t
to a config object