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);
}
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.