+ * Add confirmation before deleting selecting features. As it touches the internal removeSelectedFeatures implementation, it affects both UI controls and API calls.
+ * This runtime patch is intended to be appended to the MapConfig.js file of the portal instance
+ * 2016-10-21 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com>
+Sys.Application.add_init(function() {
+ Intergraph.WebSolutions.Core.WebClient.Platform.ClientScript.Edit.InsertFeature.prototype.removeSelectedFeatures = function() {
+ var args = Array.prototype.slice.call(arguments);
+ $GP.selectedFeatures.find({}, function(ret) {
+ // ret.featureClassIds is array of feature class Ids
+ // ret.featureIds and ret.features are multidimensional arrays with array of features for each featureClassId from ret.featureClassIds
+ if (ret.featureClassIds.join(",").indexOf("UndeletableFeatureClass1") > -1) {
+ $GP.ui.info("You cannot delete objects from this feature class!");
+ // Examine feature classes and features using $GP.selectedFeatures methods and decide what to do
+ var confirmation = window.confirm("Are you sure?");
+ $GP.ui.info("Features saved");