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

setFieldTemplate( ) method

A class method that specifies a new default field format for all detail forms created with UIHelper instances in the current JavaScript session.
These settings can be overridden for specific forms by the optional fieldTemplate property of the JavaScript object passed to the setDetailPage( ) method.
Return type: null
Applies to: progress.ui.UIHelper class

Syntax

progress.ui.UIHelper.setFieldTemplate( field-template )
field-template
A string value set to an HTML string that specifies new default field formats for detail forms used by UIHelper instances in the current JavaScript session.
It is not necessary to call setFieldTemplate( ) 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 form template for use in all jQuery Mobile environments.

Example

The following code fragment shows the setFieldTemplate( ) method setting the installed default field 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.setFieldTemplate( '<div data-role="fieldcontain">
<label for="{__name__}">{__label__}</label>
<input id="{__name__}" name="{__name__}"
placeholder="" value="" type="text" />
</div>'
);
As shown in the preceding example with the class default setting, the template string uses the following substitution parameters:
*{__name__} — The name of the field, as defined by the schema
*{__label__} — The title property of the field, as defined by the schema

See also:

setDetailPage( ) method