Class: InfoTemplateE-mail This Topic Printable Version Give Us Feedback

Description

An InfoTemplate contains a title and content template string used to transform Graphic.attributes into an HTML representation. The Dojo syntax ${<key>} performs the parameter substitution. In addition, a wildcard ${*} can be used as the template string. The wildcard prints out all of the attribute's name value pairs. The default behavior on a Graphic is to show the Map's InfoWindow after a click on the Graphic. An InfoTemplate is required for this default behavior.

Class hierarchy

esri.InfoTemplate

Constructor

Constructor Description
esri.InfoTemplate() Creates a new empty InfoTemplate object.
esri.InfoTemplate(title, content) Creates a new InfoTemplate object. All parameters are required and must be specified in the order given.
esri.InfoTemplate(json) Creates a new InfoTemplate object using a JSON object.

Properties

Property Type Description
content String The template for defining how to format the content used in an InfoWindow.
title String The template for defining how to format the title used in an InfoWindow.

Methods

Method Return Value Description
setContent(template) InfoTemplate Sets the content template.
setTitle(template) InfoTemplate Sets the title template.
toJson() Object Converts object to its ArcGIS Server JSON representation.
Constructor Detail

esri.InfoTemplate()

Creates a new empty InfoTemplate object.

esri.InfoTemplate(title, content)

Creates a new InfoTemplate object. All parameters are required and must be specified in the order given.
Parameters:
<String> title Required The template for defining how to format the title used in an InfoWindow.
<String> content Required The template for defining how to format the content used in an InfoWindow.

esri.InfoTemplate(json)

Creates a new InfoTemplate object using a JSON object.
Parameters:
<Object> json Required JSON object representing the InfoTemplate.

{title:"Test Title", content:"Test Content"}
Properties Detail

<String> content

The template for defining how to format the content used in an InfoWindow.

<String> title

The template for defining how to format the title used in an InfoWindow.
Methods Detail

setContent(template)

Sets the content template.
Return value: InfoTemplate
Input Parameters:
<String> template Required The template for the content.

setTitle(template)

Sets the title template.
Return value: InfoTemplate
Input Parameters:
<String> template Required The template for the title.

toJson()

Converts object to its ArcGIS Server JSON representation.
Return value: Object