JavaScript
{dialog.object}setListTemplateAndPopulate Method
Syntax
{dialog.object}.setListTemplateAndPopulate(listName, data, template);
Arguments
- listName
The ID of the List Control.
- data
A JSON object defining the data used to populate the List.
- templatestring
The template for the List. The template can use client-side template syntax.
Description
Dynamically sets the template for a freeform List control and populates the List with data.
Discussion
This method is a special form of the more general {dialog.object}.setListColumnsAndPopulate.
With v4.6.5.1 and later, this method will automatically turn off list titles if the List was displaying titles before the command was invoked.
Example
var data = [
{
"Firstname": "Kathy",
"Lastname": "Morton",
"City": "New York",
"State": "NY"
}
];
var template = '{Firstname} {Lastname}<br><b>{City}</b>';
{dialog.object}.setListTemplateAndPopulate('list',data,template)See Also