Class Template
- Extends:
- EventDispatcher
- Requires:
- Class
- Event
- EventDispatcher
- JsonRpcAbstract
- JsonRpcError
- JsonRpcResult
- TemplateManager
- Defined in:
- Template.js
Template Base template class.
Constructor
Template(name, configuration)
Representing template.
Static Fields
| Field | |
|---|---|
|
Template.ACTION_ERROR_ABORT
[constant]
|
|
|
Template.ACTION_ERROR_DEFAULT
[constant]
|
|
|
Template.ACTION_ERROR_DISCARD
[constant]
|
|
|
Template.ACTION_ERROR_PROPAGATE
[constant]
|
|
|
Template.ERROR
[constant]
|
|
|
Template.RENDERED
[constant]
|
Fields
| Field | |
|---|---|
|
Indicates if template is a child of parent.
|
|
|
Indicates if template was rendered.
|
Methods
| Method | |
|---|---|
|
addChild(child)
Adding child template
|
|
|
addEventListener(type, callbackFunction, context)
Adding listener
|
|
Dispatches event
|
|
dispatchRender(data)
Dispatchig render action and handles its errors and exceptions.
|
|
|
Returns content generated by specific render engine
|
|
|
Returns error handler
|
|
|
getName()
Returns template name
|
|
|
getPath()
Returns template location path
|
|
|
Returns template manager who holds every template in the subtree
|
|
|
hasEventListener(type)
Checks if given event type listener is registered
|
|
onData(e)
Handling model load.
|
|
|
onDataError(e)
Handling model error.
|
|
|
removeAllEventListeners(type)
Remove group of listeners or all listeners
|
|
removeEventListener(type, callbackFunction)
Remove listener
|
|
render(data)
Abstract method.
|
|
|
setRenderedData(data)
Setting rendering result
|
|
|
setTemplateManager(templateManager)
Sets template manager object which holds every template in the subtree
|
Class Detail
Template(name, configuration)
| Parameters (optional) | ||
|---|---|---|
| name | {String} | |
| configuration | {Object} | |
- Throws:
- {Template.Exception.CONFIG_INVALID} if given name or configuration are invalid.
Static Field Details
Template.ACTION_ERROR_ABORT
[constant]
Template.ACTION_ERROR_DEFAULT
[constant]
Template.ACTION_ERROR_DISCARD
[constant]
Template.ACTION_ERROR_PROPAGATE
[constant]
Template.ERROR
[constant]
Template.RENDERED
[constant]
Field Details
hasParent
Indicates if template is a child of parent.
isRendered
Indicates if template was rendered.
Method Details
addChild(child)
Adding child template
| Parameters (optional) | ||
|---|---|---|
| child | {Template} | |
dispatchRender(data)
Dispatchig render action and handles its errors and exceptions.
| Parameters (optional) | ||
|---|---|---|
| data | {Object} | |
- Throws:
- {Template.Exception.NOT_IMPLEMENTED} if method render wasn't overriden
getContent()
:{String}
Returns content generated by specific render engine
- Returns:
- {String}
getErrorAction()
:{CONST}
Returns error handler
- Returns:
- {CONST}
getName()
:{String}
Returns template name
- Returns:
- {String}
getPath()
:{String}
Returns template location path
- Returns:
- {String} template path
Returns template manager who holds every template in the subtree
- Returns:
- {TemplateManager}
onData(e)
Handling model load. Called on DriverAbstract.LOADED
| Parameters (optional) | ||
|---|---|---|
| e | {Event} | |
onDataError(e)
Handling model error. Called on DriverAbstract.ERROR
| Parameters (optional) | ||
|---|---|---|
| e | {ErrorEvent} | |
render(data)
Abstract method. Needed to be overriden - otherwise Template.Exception.NOT_IMPLEMENTED will be throwed.
| Parameters (optional) | ||
|---|---|---|
| data | {Object} | |
setRenderedData(data)
Setting rendering result
| Parameters (optional) | ||
|---|---|---|
| data | {Object} | |
setTemplateManager(templateManager)
Sets template manager object which holds every template in the subtree
| Parameters (optional) | ||
|---|---|---|
| templateManager | {TemplateManager} | |
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Aug 17 2011 15:33:34 GMT+0200 (CEST)