I am using Javascript API for ArcGIS version 4. I have a map with one layer and Editor Widget where one value can be edited.
Is there a way to detect click on "update" button in the Editor Widget? I found the button class from web-page, but it seems to be a general name (<button class="esri-editor__control-button esri-button">Update</button>).
I am facing the same problem. Is there somebody who can help?
Any support with this, please? @ESRI1
A workaround that I used is to override the default applyEdits method in the feature layer.
Code in typescript:
mapview.on('layerview-create', async (event) => {
if (event.layer.type === 'feature') {
const eventLayer = event.layer as FeatureLayer;
eventLayer['defaultApplyEdits'] = eventLayer.applyEdits;
eventLayer.applyEdits = function (
edits: __esri.FeatureLayerBaseApplyEditsEdits
) {
console.log(edits);
// apply your logic here
return this.get<Function>('defaultApplyEdits').apply(this, arguments);
};
}
});