jsMotif.Template is a template rendering class.
It is extended by nokia.places.ui.Template.
addEvent
(rel, name, handler)
|
This method adds an event handler to a template element. |
addEventMap
(events)
|
This method adds an event map to the template. |
fetch
(jsonObject)
|
This method renders the received data using the HTML template and returns the result as an HTML string. |
getRelMap
(node)
|
This method obtains a map object relating the rel attributes and the DOM elements to which they apply within the caller-supplied DOM node.
|
registerAttr
(name, handler)
|
This method registers a handler for an attribute in a template DOM node. |
render
(jsonObject, targetElem)
|
This method renders the HTML template, using the data and the target element specified by the caller. |
jsMotif.Template is a template rendering class.
It is extended by nokia.places.ui.Template.
params
template - (mandatory) a value which represents a template it can be:
targetNode - the element into which the template is to be rendered; its value
can be:
functions - an object/hashmap which contains a user-defined function that
may be used to render or to affect rendering of the element in template.
event - an array of objects which specify the events attached to template nodes and
the event handlers; each object in the array has the following attributes:
rel - a {String} indicating the template node to which to attach the event
name - a {String} providing the name of the attached event; the supported
event names are 'keydown', 'keyup', 'keypress', 'click', 'dblclick', 'mousedown',
'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mouseenter', 'mouseleave', 'blur',
'change', 'focus', 'reset', 'select', 'submit', 'abort'
handler - a caller-defined {Function} to be invoked when the user
triggers the attached event; the function receives the data object as an argument and
'this' within the function refers to the element on which the event was triggered
addEvent
(rel, name, handler)
rel
rel attribute in the template node
name
handler
addEventMap
(events)
events
event in the class contructor)
fetch
(jsonObject)
jsonObject
getRelMap
(node)
rel attributes and the
DOM elements to which they apply within the caller-supplied DOM node.
node
rel attribute
rel attributes and DOM elements
registerAttr
(name, handler)
name
handler
render
(jsonObject, targetElem)
jsonObject
targetElem
Copyright © 2011 Nokia. All rights reserved. Terms and Conditions