0

I'm new to arcgis JS api, now I want to update the whole records in a specific field of the feature layer, but I don't want to use the Editor Widget, is it possible? How to set the layer editable? I did some research about using ApplyEdit() method, but still confuse about it. Can anyone give me some hints or code examples? Thanks in advance!

1
  • If you get a suitable answer to this on the Esri forum, please make sure to post it here so that future readers will see it.
    – user3461
    Commented Oct 21, 2013 at 18:46

1 Answer 1

2

you don't really do anything specific in your code to set a featureLayer to be editable. if the url of the service you supply supports the applyEdits operation (as visible near the bottom of the layer's REST endpoint), then it will be possible to edit the feature layer.

in the sample below you can see that a click event is wired to delete features without relying on a widget. we check to see if the CTRL key is down before calling applyEdits() with a graphic as the third argument. https://developers.arcgis.com/en/javascript/jssamples/ed_feature_creation.html

if you just want to update an existing feature, all you need to do is get a reference to a specific graphic, update its attributes, and then pass the same graphic to applyEdits() as the second argument (to update).

applyEdits(adds?,updates?,deletes?,callback?,errback?) https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#applyedits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.