Select to view content in your preferred language

getContent() not working at 2.2

829
2
04-19-2011 06:42 AM
MarkSmith
Occasional Contributor
I have a few JS API apps which on Identify use the getContent() method to get hold of all the attribute information which I then format for various purposes for example:

function addToMap(idResults, evt) {
          //run through each feature found
          for (var i = 0, il = idResults.length; i < il; i++) {
              var idResult = idResults;
              var content = idResult.feature.getContent()
              ............etc


This works great at 2.1, but if I change to 2.2 it breaks and the value of my variable 'content' is null as opposed to some nice HTML of fields and values I get at 2.1.

Can anyone please tell me how to get the content at 2.2?  I've tried exploring the reference, but can't work it out.  Thank you,

Mark.
0 Kudos
2 Replies
KellyHutchins
Esri Notable Contributor
This forum post contains details on how to fix this at 2.2.
0 Kudos
MarkSmith
Occasional Contributor
Thank you,

This is what I now use:
var content = esri.substitute(idResult.feature.attributes, "${*}")

Rather than this which doesn't work at 2.2:
var content = idResult.feature.getContent()
0 Kudos