Select to view content in your preferred language

popupInfo: Concatenate a value to the fieldName?

2378
1
04-17-2013 03:03 PM
NewUser
Emerging Contributor
When configuring popupInfo, you provide "fieldName" and "label."  I'd like to be able to concatenate a string to the value returned by "fieldName" and have that displayed in the popup rather than just the "fieldName" value.  Is there any way to do this?
0 Kudos
1 Reply
derekswingley1
Deactivated User
Yes, use a label in fieldInfos as shown here:  http://developers.arcgis.com/en/javascript/jssamples/widget_popupfl.html

Something like:
var popupTemplate = new esri.dijit.PopupTemplate({
  title: "{address}",
  fieldInfos: [
    {fieldName: "req_type", visible: true, label:"req_type and extra text"},
    {fieldName: "req_date", visible:true, label:"Date" ,format:{dateFormat:'shortDateShortTime'}}
  ]
});
0 Kudos