dojo.connect(myLayer, "onBeforeApplyEdits", saveValues); function saveValues(adds,updates,deletes) { /** Treatements **/ }
API JS 3.0ArcGIS 10.1Oracle 11gI have a similar issue and maybe my question will answers yours. I have to intercept objects to add, update or delete before they are sent to server. Because I have to authorize each edit and complete the attributes before they are applied to database.The featureLayer get an event called onBeforeApplyEdits fired just before the applyEdits function.This event gives 3 arrays of Graphic : adds, updates and deletes. I can modify or reset adds and updates but there is no way to reset the deletes.I tried, without success: delete deletes; deletes = undefined; deletes = new Array(); It seems impossible to cancel the call to applyEdit (it's a REST request send to the server).A solution exists : to put a personal event on the delete button instead of the default one. This event would call a function wich would call applyEdits or not. But, this is not a solution if use the cut tool (my case) because updates and deletes are used and you not press a button but draw in the map.I cannot believe there is no way to cancel a delete before it is sent to the server.Maybe it will help to solve your problem but I think my situation is close so if someone have an idea.
delete deletes; deletes = undefined; deletes = new Array();
I'm not even sure what events the editor emits, if any, but the FeatureLayer has an "onEditsComplete" that will let you know what was deleted.http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.