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!

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Oct 21, 2013 at 16:51
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. 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

answered Oct 22, 2013 at 4:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.