I am using the Editor Widget to add, update and delete features. However, the back end to the map is my own, so I am doing everything on the client. When feature layers are created, I applying the sources etc.
I simply want to add an event handler to these editor workflows so that I can handle the resultant pending changes myself on my own back end. Watching the viewModel of the Editor does not facilitate this. There is no change in state between supplying the edits and clicking 'Create' for example, in the create workflow.
There are also no specific events listed for the Editor Widget in the documentation. I want to intercept these events and then make the requisite calls to my back end to save the changes.
Thanks
Solved! Go to Solution.
I found the solution:
editor.viewModel.featureFormViewModel.on('submit', _ => {
console.log('submit');
let values = editor.viewModel.featureFormViewModel.getValues();
console.log(values);
});
I found the solution:
editor.viewModel.featureFormViewModel.on('submit', _ => {
console.log('submit');
let values = editor.viewModel.featureFormViewModel.getValues();
console.log(values);
});
The solution you found works for update . How did you detect the deleted features as submit event does not get fired on delete button