You can look at your service directory to see how the field names are listed. if the field listed as PAD.LP_PAD.OBJECTID, then the statement should be clickedTaxLotId = grid.getItem(evt.rowIndex).PAD.LP_PAD.OBJECTID[0]. the best way to find out is to debug the statement.
Tried both..it does not working. Seems like does not know/understand OBJECTID because the field is called PAD.LP_PAD.OBJECTID. if no substring used (spatial does not join with other table), then I can use OBJECTID only
Try this: either change clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID to clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID[0], or loose up the comparsion graphic.attributes.OBJECTID === clickedTaxLotId to graphic.attributes.OBJECTID == clickedTaxLotId
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.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.