JSDO properties, methods, and events reference : setItemTemplate( ) method
  

setItemTemplate( ) method

A class method that specifies a new default item format for all list views created with UIHelper instances in the current JavaScript session.
These settings can be overridden for specific list views by the setListView( ) method. In addition, the __format__ parameter can be overridden for specific items by the addItem( ) method.
Return type: null
Applies to: progress.ui.UIHelper class

Syntax

progress.ui.UIHelper.setItemTemplate( item-template )
item-template
A string value set to an HTML string that specifies new default item formats for list views used by UIHelper instances in the current JavaScript session.
It is not necessary to call setItemTemplate( ) unless one of the following is true:
*You are not using a jQuery Mobile environment.
*You are using a jQuery Mobile environment, but you want to change the default settings provided with the progress.ui.UIHelper class (see below).
The progress.ui.UIHelper class provides a default list view template for use in all jQuery Mobile environments.

Example

The following code fragment shows the setItemTemplate( ) method setting the installed default item template values for the progress.ui.UIHelper class Notice that the parameter is a single string with the field values for the template. In this particular case, it is a long string:
progress.ui.UIHelper.setItemTemplate(
'<li data-theme="c" data-id="{__id__}">
<a href="#{__page__}"class="ui-link" data-transition="slide">
{__format__}</a>
</li>'
);
As shown in the preceding example with the class default setting, the template string uses the following substitution parameters:
*{__id__} — The internal ID of the record
*{__page__} — The name attribute of the object pased as a parameter to setDetailPage( ), which defines the form for each individual list item
*{__format__} — The format property of the object pased as a parameter to setListView( ) or (optionally) to addItem( ), which identifies the fields to be included for each item in the list view

See also:

addItem( ) method, setListView( ) method