Hi,
I have a spatial layer which is join with a table, therefore all the field name will be in substring like PAD.LP_PD.OBJECTID.
I have no issue to run query from the substring, but i am stuck at function to zoom to selected feature/polygon when user click a row in datagrid(result from query).
Below is the code:
//Zoom to the parcel when the user clicks a row
function onRowClickHandler(evt){
var OBJECTID = ("PAD.LP_PAD.OBJECTID");
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 = selectedTaxLot.geometry.getExtent();
map.setExtent(taxLotExtent);
}
I have tried using this declaration:
var clickedTaxLotId = grid.getItem(evt.rowIndex).(PAD.LP_PAD.OBJECTID);
var clickedTaxLotId = grid.getItem(evt.rowIndex).valueOf(PAD.LP_PAD.OBJECTID);
but those two declaration will take the whole result in datagrid, not the exact selected row.
Please advice..
Suggestion is highly appreciated.