var responsePoints = new FeatureLayer("http://myorgxxx/arcgis/rest/services/Secure/FeatureLayerName/FeatureServer/0", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ['*'] });
//apply sql filter var id= <%=GetID()%>; //this comes from Asp.net server side responsePoints.setDefinitionExpression("ID="+id); map.addLayers([responsePoints]);
I found answer to this:
first add event to populate ID, when editing begins
dojo.connect(myFeatureLayer,"onEditsComplete",populateID);
//then add function
function populateID(addResults) { if (addResults.length > 0) { // this gets the corresponding graphic of the feature that was just added var graphic = myFeatureLayer.graphics[OccurrencesFL.graphics.length - 1]; var ID = 123 ; (your id value here) graphic.attributes["ID"] =parseInt(ID); myFeatureLayer.applyEdits(null, [graphic], null);
}
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.