parcelInfoContent = parcelInfoTemplate.setContent(parcelSetWindowContent);
function parcelSetWindowContent(graphic) { var addressTest = graphic.attributes.SITEADDRES; var legalTest = graphic.attributes.LEGAL1; var twpRangeSecString = "Township:" + graphic.attributes.TOWNSHIP + " Range:" + graphic.attributes.RANGE + " Section: " + graphic.attributes.SECTION_ + "<br>" +"Legal Description:<br>" + graphic.attributes.LEGAL1; var initString = ""; if (addressTest.length > 1) { initString = initString + "Site Address: :" + addressTest ; } if (legalTest) { initString = initString + "<br>" + twpRangeSecString; } return initString; }
function onRowClickHandler(evt){ map.graphics.clear(); map.infoWindow.hide(); var OID = grid.getItem(evt.rowIndex).OBJECTID; var selectedParcel; var query = new esri.tasks.Query(); query.objectIds = [OID]; // query.where = "PID= '" + parcelId + "'"; parcelFeatureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW, function (features) { var parcelExtent = esri.graphicsExtent(features); parcelExtent.expand(2); map.setExtent(parcelExtent); var feature = features[0]; var centerPt = parcelExtent.getCenter(); feature.setInfoTemplate(parcelInfoTemplate); map.infoWindow.setTitle(feature.attributes.PID); var content = esri.substitute(feature.attributes, parcelInfoContent); map.infoWindow.setContent(content); // map.infoWindow.setFeatures([feature]); var labelPt = new esri.geometry.Point(centerPt, spatialReference); map.infoWindow.show(labelPt); }); }
Solved! Go to Solution.
map.infoWindow.setContent(features[0].getContent());
map.infoWindow.setContent(features[0].getContent());