Editor Widget does not updates

307
2
05-13-2020 04:13 PM
Vakhtang_Zubiashvili
Occasional Contributor II

Hi guys,

I got problem.

I can add new feature without problem, but when i want to select and update feature it does not select to update.

I use JS 4.15 Version.

Here is a code i use.

Help please

//Add Regulator
     var urduli = new FeatureLayer({url: "http://LocalHost:6080/arcgis/rest/services/test/aragvi_service/FeatureServer/4",
             title:"Regulator",
             visible: true,
             outFields:["*"],
     })
     map.add(Regulator) 

var editor = new Editor({
  view: view,
  layerInfos: [{
    layer: Regulator, // pass in the feature layer
    fieldConfig: [ // Specify which fields to configure
      {
        name: "Comments",
        label: "კომენტარი"
      }],
    enabled: true, // default is true, set to false to disable editing functionality
    addEnabled: true, // default is true, set to false to disable the ability to add a new feature
    updateEnabled: true, // default is true, set to false to disable the ability to edit an existing feature
    deleteEnabled: true // default is true, set to false to disable the ability to delete features
  }]
});

view.ui.add(editor, "top-right");
 ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
2 Replies
mdonnelly
Esri Contributor

One thing to check is that your service allows for updates. Go into ArcGIS Server manager and examine the service properties to see if the update operation is permitted.

It is usually switched on by default for Feature services, so it would be only if you or someone turned it off.

Regards,
Mark
0 Kudos
VictorTey
Esri Contributor

Hi vakhtang zubiashvili‌, to debug this, open your developer tool, F12 on chrome 

when you click on ok/add/update on your editor, it will trigger a http request to your feature layer

http://LocalHost:6080/arcgis/rest/services/test/aragvi_service/FeatureServer/4

and hit the rest endpoint I think it is applyEdit

You can copy that URL and change the format from f=json to f=html which will present you with a HTML page for updating the feature. You can then debug from there to know what went wrong.

Hope that helps

0 Kudos