Nipa

Display all attributes in infoWindow popup

Discussion created by Nipa on Apr 20, 2012
Latest reply on Apr 20, 2012 by svakil-esristaff
Hello,

I would like to format my infowindow to display all fields.  Below is my code display only few fields.  How can I display all attributes.

Please help.

function executeIdentifyTask(evt) {
        identifyParams.geometry = evt.mapPoint;
        identifyParams.mapExtent = map.extent;
      
        var deferred;
       
        for (layerNumber in stateLayerNameArray) {
         if (selState == stateLayerNameArray[layerNumber]) {
           var layerIdArray = new Array();
            for (layer in myESIBaseLayers[selState]) {
              layerIdArray.push(myESIBaseLayers[selState][layer].id);
            }
            identifyParams.layerIds = layerIdArray;
            deferred = identifyTaskArray[layerNumber].execute(identifyParams);
         }
        }
        
        deferred.addCallback(function(response) {    
          // response is an array of identify result objects   
          // Let's return an array of features.
          return dojo.map(response, function(result) {
            var feature = result.feature;
            feature.attributes.layerName = result.layerName;
            if(result.layerName === 'esi lines'){
              console.log(feature.attributes.OBJECTID);
              var template = new esri.InfoTemplate("", "${OBJECTID} <br/> ESI of record: ${ESI}");
              feature.setInfoTemplate(template);
            }
            else if (result.layerName === 'esi polygons'){
              var template = new esri.InfoTemplate("", "ESI: ${ESI}");
              feature.setInfoTemplate(template);
            }
            return feature;
          });
        });


Nipa

Outcomes