Class nokia.places.widgets.Widget
Class Summary
The Widget class defines a UI component that renders place data, using a template and a JSON data object. It is the base class extended by the classes nokia.places.widgets.Place, nokia.places.widgets.ResultList and nokia.places.widgets.SearchBox.
new nokia.places.widgets.Widget
(params)
Method Summary
getData
(selector, defaultValue)
This method retrieves the rendered data object.
hide
()
This method hides the rendered widget.
setData
(data, (optional))
This method associates data with the given widget and renders the data using a template.
setTemplate
(template, [locale, [onTemplate, reRender]])
This method changes the template for the given widget.
show
()
This method shows the rendered widget.
Constructor Detail
The Widget class defines a UI component that renders place data, using a template and a JSON data object. It is the base class extended by the classes nokia.places.widgets.Place, nokia.places.widgets.ResultList and nokia.places.widgets.SearchBox.
new nokia.places.widgets.Widget(params)
Parameters:
| {Object} | params |
An initialization object with the following properties:
|
Method Detail
getData
(selector, defaultValue)
This method retrieves the rendered data object.
Parameters:
| selector | ||
| defaultValue |
Returns:
| A JSON object containing the rendered data. |
setData
(data, (optional))
This method associates data with the given widget and renders the data using a template.
Parameters:
| {Object} | data | The data to associate with the widget and to render |
| {Object} | (optional) | the target element in which to render the data |
setTemplate
(template, [locale, [onTemplate, reRender]])
This method changes the template for the given widget.
Parameters:
| {Object} | template | A template object, which may be an HTML string, an existing DOM element id, or a reference to a DOM node (see also class initialization parameters) |
| {String} | [locale]: | A language designation composed of An ISO 369 lanuage code and an ISO 36166-1 Alpha-2 country code (for example 'cs-cz' stands for Czech as spoken in the Czech Republic; if not specified the browser language is used |
| {function} | [onTemplate]: | A caller-defined function to be executed when a template is applied |
| {Boolean} | reRender |
A Boolean, if true,
the widget is re-rendered with the last used (existing) JSON data object
|
