Places API Reference

Contents

UI API

 
nokia

Data API

 
nokia

jsMotif

 
jsMotif

Class nokia.places.APITemplate

Class Summary

The class APITemplate extends the jsMotif templating engine with a DOM element attribute module. The attribute can be used in templates to name the Places API components that can, for example, assist in rendering HTML elements and/or define the behavior of the user interface after the elements have been rendered. In addition, APITemplate allows you to specify initialization parameters for each of the Places API UI components referenced by the templates.

Extends jsMotif.

Method Summary

getModules (name) : object
This method searches for the module named by the caller.
This method hides the spinner element.
render (jsonObject, [targetElem])
This method renders an HTML template, using the data and the target element supplied by the caller.
renderObject (node, jsonObject)
This method renders a single node in the template.
This method shows the spinner element.

Constructor Detail

The class APITemplate extends the jsMotif templating engine with a DOM element attribute module. The attribute can be used in templates to name the Places API components that can, for example, assist in rendering HTML elements and/or define the behavior of the user interface after the elements have been rendered. In addition, APITemplate allows you to specify initialization parameters for each of the Places API UI components referenced by the templates.

new nokia.places.APITemplate(params)
Parameters:
{Object} params
An initialization object that can include parameters defined for jsMotif as well as the following optional properties:
  • moduleParams - {Object}, a hash map which specifies the parameters for the modules that render template DOM nodes; for example, this is how you can enable all rating modules specified within the template and set the perPage parameter for every List object used within the template to 5:
             
             moduleParams: {
                 'Rating': {
                     enabled: true
                 },
                 'List': {
                     perPage: 5
                 }
             }
             
             

Method Detail

getModules (name) : object
This method searches for the module named by the caller.
Parameters:
{String} name
The name of the module for which to search
Returns:
{object}
An object representing the located module
hideSpinner ()
This method hides the spinner element.
render (jsonObject, [targetElem])
This method renders an HTML template, using the data and the target element supplied by the caller.
Parameters:
{Object} jsonObject
An object containing data to be rendered
{Object} [targetElem]:
A target element in which to render the data
See:
jsMotif.Template#render
renderObject (node, jsonObject)
This method renders a single node in the template. It also checks if a module is associated with the node and, if so, it invokes that modules' callback.
Parameters:
{Object} node
An object containing the template node to render
{Object} jsonObject
An object containing data needed to render in the node
showSpinner ()
This method shows the spinner element. A new spinner element is created when this method is called for the first time.

Copyright © 2011 Nokia. All rights reserved. Terms and Conditions