//Zoom to the POINT when the user clicks a row function onRowClickHandler(evt){ var clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID; var selectedTaxLot; dojo.forEach(map.graphics.graphics,function(graphic){ if((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId){ selectedTaxLot = graphic; return; } }); var taxLotExtent = new esri.geometry.Extent(); taxLotExtent.xmin = selectedTaxLot.geometry.x - .1; taxLotExtent.ymin = selectedTaxLot.geometry.y - .1; taxLotExtent.xmax = selectedTaxLot.geometry.x + .5; taxLotExtent.ymax = selectedTaxLot.geometry.y + .5; map.setExtent(taxLotExtent); }
I haven't been able to get this function to run properly. It works as expected in version 2.6, but I am at my wits end trying to get it working in 3.8. Any help is greatly appreciated.//Zoom to the POINT when the user clicks a row function onRowClickHandler(evt){ var clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID; var selectedTaxLot; dojo.forEach(map.graphics.graphics,function(graphic){ if((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId){ selectedTaxLot = graphic; return; } }); var taxLotExtent = new esri.geometry.Extent(); taxLotExtent.xmin = selectedTaxLot.geometry.x - .1; taxLotExtent.ymin = selectedTaxLot.geometry.y - .1; taxLotExtent.xmax = selectedTaxLot.geometry.x + .5; taxLotExtent.ymax = selectedTaxLot.geometry.y + .5; map.setExtent(taxLotExtent); }
//Zoom to the POINT when the user clicks a row function onRowClickHandler(evt) { var clickedTaxLotId = evt.grid.getItem(evt.rowIndex).OBJECTID; var selectedTaxLot; dojo.forEach(map.graphics.graphics, function (graphic) { if((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId){ selectedTaxLot = graphic; return; } }); var spatialRef = new esri.SpatialReference({wkid:102100}) var taxLotExtent = new esri.geometry.Extent(); taxLotExtent.xmin = selectedTaxLot.geometry.x - .1; taxLotExtent.ymin = selectedTaxLot.geometry.y + .5; taxLotExtent.xmax = selectedTaxLot.geometry.x - .1; taxLotExtent.ymax = selectedTaxLot.geometry.y + .5; taxLotExtent.spatialReference = spatialRef; map.setExtent(taxLotExtent); }