Hello,
I need to configure SketchViewModel to not allow deleting graphics but after a while searching it doesn't seem the sdk has this option, is there any way to disable deleting graphics? The 'delete' event also does not have the option to stopPropagation.
The only work around I imagined is to do graphicsLayer.graphics.addMany(event.graphics) at the delete event, but not the best solution I think.
Solved! Go to Solution.
An alternate way would be to override the delete function:
sketchViewModel.delete = function() { };
The above would cause nothing to happen when the delete function is called. If you needed to remove any graphics created by that module, you'd have to use some alternate means, like:
sketchViewModel.layer.removeAll();
An alternate way would be to override the delete function:
sketchViewModel.delete = function() { };
The above would cause nothing to happen when the delete function is called. If you needed to remove any graphics created by that module, you'd have to use some alternate means, like:
sketchViewModel.layer.removeAll();
Thank you @JoelBennett. Didn't think about this option and works well.