Hi ESRI Developer team / GIS folks,
I have developed an WEBGIS application where an user can go & edit individual feature layers in the application.
As you know, the attribute inspector by default only comes with delete button. But, for some, users would like to have a save
button added on to attribute inspector and once they have completed editing, they wanted to use the save button. So, I have looked at the sample link below from ESRI javascript API and implemented the functionality into my application.
http://developers.arcgis.com/javascript/samples/ed_attribute_inspector/
The delete button and save button works extremely well in Internet Explorer, but fails to execute in FireFox and Chrome.
So to test this, I checked the sample link above to see whether the code works in firefox and chrome, but the problem is the same
in the ESRI sample link.
The problem is when you copy the link above in FF or Chrome and click any feature on the map and make some changes to the attribute, if you press save button, it will save on chrome and FF. But, if you press Delete button to delete a feature, then, it activates the save button, but not delete button. Actually the problem is here with the delete and save button, in FF and chrome.
Can you please look into this sample link above and throw some lights on how to fix it.
var layerInfos = [{ 'featureLayer': petroFieldsFL, 'showAttachments': false, 'showDeleteButton': false, /* set this to false */ .... var dButton = new Button({ label: "Delete", "class": "dButton"}); domConstruct.place(dButton.domNode, attInspector.deleteBtn.domNode, "after"); dButton.on("click",function(evt){ updateFeature.getLayer().applyEdits(null,null,[updateFeature]); map.infoWindow.hide(); })
Ganesh,
Thanks for letting us know. I was able to reproduce the fact that the delete button and delete listener aren't working on Chrome in the Attribute Inspector sample.
I can see that saves are working by using the browser console. Are you able to see the saves occurring in the background?
Have you opened a support ticket yet? That way we can get this tracked and in the queue.
If you need a quick fix you can always manually build your own custom delete button and set the default delete button to false. Here is a psuedo-code example to get you pointed in the right direction:var layerInfos = [{ 'featureLayer': petroFieldsFL, 'showAttachments': false, 'showDeleteButton': false, /* set this to false */ .... var dButton = new Button({ label: "Delete", "class": "dButton"}); domConstruct.place(dButton.domNode, attInspector.deleteBtn.domNode, "after"); dButton.on("click",function(evt){ updateFeature.getLayer().applyEdits(null,null,[updateFeature]); map.infoWindow.hide(); })
https://developers.arcgis.com/javascript/jsapi/attributeinspector.html#event-delete
-Andy