<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Editor Widget - onDelete event handler in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245480#M22727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't have much in the way of an answer but i'm struggling with a similar issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to provide rollback support for my users when they edit in my js map app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have read the it can be done but must be implemented at the client level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something like a guid that esri passed back when a successful edit is done?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or do i have to remember the edit to support undo?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I see exampled of redo/undo but they are always for client-side graphics and not for true feature editing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2012 14:26:55 GMT</pubDate>
    <dc:creator>KevinGooss</dc:creator>
    <dc:date>2012-08-29T14:26:55Z</dc:date>
    <item>
      <title>Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245473#M22720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i would like to ask if there's an event handler for deleting a feature in the Editor Widget? i know that it should be straightforward but i've been looking over esri apis help but couldn't find it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it should be something like that but it doesn't work&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo.connect(editorWidget,"onDelete",function(feature)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the Attribute Inspector this event handler exists, but when i tried to implement it in the Editor Widget it didn't work, i mean when i delete a feature the onDelete isn't fired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 09:23:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245473#M22720</guid>
      <dc:creator>MostafaFouly</dc:creator>
      <dc:date>2012-08-09T09:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245474#M22721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 12:45:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245474#M22721</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2012-08-09T12:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245475#M22722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;API JS 3.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Oracle 11g&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a similar issue and maybe my question will answers yours. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to intercept objects to add, update or delete &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;before &lt;/SPAN&gt;&lt;SPAN&gt;they are sent to server. Because I have to authorize each edit and complete the attributes before they are applied to database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The featureLayer get an event called &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onBeforeApplyEdits" rel="nofollow noopener noreferrer" target="_blank"&gt;onBeforeApplyEdits&lt;/A&gt;&lt;SPAN&gt; fired just before the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#applyEdits" rel="nofollow noopener noreferrer" target="_blank"&gt;applyEdits&lt;/A&gt;&lt;SPAN&gt; function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This event gives 3 arrays of Graphic : adds, updates and deletes. I can modify or reset &lt;/SPAN&gt;&lt;STRONG&gt;adds &lt;/STRONG&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;STRONG&gt;updates&lt;/STRONG&gt;&lt;SPAN&gt; but there is no way to reset the &lt;/SPAN&gt;&lt;STRONG&gt;deletes&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried, without success:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
delete deletes;
deletes = undefined;
deletes = new Array();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems impossible to cancel the call to applyEdit (it's a REST request send to the server).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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 &lt;/SPAN&gt;&lt;STRONG&gt;updates &lt;/STRONG&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;STRONG&gt;deletes &lt;/STRONG&gt;&lt;SPAN&gt;are used and you not press a button but draw in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I cannot believe there is no way to cancel a delete before it is sent to the server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it will help to solve your problem but I think my situation is close so if someone have an idea.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:14:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245475#M22722</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2021-12-11T12:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245476#M22723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;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.&lt;BR /&gt; &lt;BR /&gt;&lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete"&gt;http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onEditsComplete&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;actually i'm using the "onEditsComplete" but the point is i lose the pointer for the deleted point, i managed to get a pointer to it before it's deleted but still having some other errors and conflicts with the update function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i couldn't find any onDelete event handler for the editor!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 09:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245476#M22723</guid>
      <dc:creator>MostafaFouly</dc:creator>
      <dc:date>2012-08-13T09:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245477#M22724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;API JS 3.0&lt;BR /&gt;ArcGIS 10.1&lt;BR /&gt;Oracle 11g&lt;BR /&gt;&lt;BR /&gt;I have a similar issue and maybe my question will answers yours. &lt;BR /&gt;&lt;BR /&gt;I have to intercept objects to add, update or delete &lt;SPAN style="text-decoration:underline;"&gt;before &lt;/SPAN&gt;they are sent to server. Because I have to authorize each edit and complete the attributes before they are applied to database.&lt;BR /&gt;&lt;BR /&gt;The featureLayer get an event called &lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#onBeforeApplyEdits" rel="nofollow noopener noreferrer" target="_blank"&gt;onBeforeApplyEdits&lt;/A&gt; fired just before the &lt;A href="http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#applyEdits" rel="nofollow noopener noreferrer" target="_blank"&gt;applyEdits&lt;/A&gt; function.&lt;BR /&gt;&lt;BR /&gt;This event gives 3 arrays of Graphic : adds, updates and deletes. I can modify or reset &lt;STRONG&gt;adds &lt;/STRONG&gt;and &lt;STRONG&gt;updates&lt;/STRONG&gt; but there is no way to reset the &lt;STRONG&gt;deletes&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;I tried, without success:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
delete deletes;
deletes = undefined;
deletes = new Array();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;It seems impossible to cancel the call to applyEdit (it's a REST request send to the server).&lt;BR /&gt;&lt;BR /&gt;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 &lt;STRONG&gt;updates &lt;/STRONG&gt;and &lt;STRONG&gt;deletes &lt;/STRONG&gt;are used and you not press a button but draw in the map.&lt;BR /&gt;&lt;BR /&gt;I cannot believe there is no way to cancel a delete before it is sent to the server.&lt;BR /&gt;&lt;BR /&gt;Maybe it will help to solve your problem but I think my situation is close so if someone have an idea.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i tried the solution that you provided but unfortunately it's not working with me because i didn't create the delete button myself to be able to handle its event. so i'm using featureLayer.onEditsComplete event handler and check if the deletes parameter's length is greater than zero.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i am working on the update method now, i tried out the "onBeforeApplyEdits" event handler to get the value before and after being updated, but the result is the same, in other words i wasn't able to save the original value before updating it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i checked the attribute inspector and it works properly, but i couldn't mix the functionality of both the editorWidget and the attributeInspector, it should look like the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo.connect(editorWidget, "onAttributeChange", function (feature, fieldName, newFieldValue) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;did you manage to save the original values before the changes being applied?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my point is that i want to save all the operations to the UndoManager to be able to execute the undo/redo method&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245477#M22724</guid>
      <dc:creator>MostafaFouly</dc:creator>
      <dc:date>2021-12-11T12:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245478#M22725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you try to do this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dojo.connect(myLayer, "onBeforeApplyEdits", saveValues);
function saveValues(adds,updates,deletes) {
 /** Treatements **/
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just tried and it seems to work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And, I found a shameful solution for my problem: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/64501-Control-or-reset-arrays-of-graphics-before-applyEdits?p=223481&amp;amp;posted=1#post223481" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/64501-Control-or-reset-arrays-of-graphics-before-applyEdits?p=223481&amp;amp;posted=1#post223481&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:14:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245478#M22725</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2021-12-11T12:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245479#M22726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;my issue is that i want in the onDelete event handler to call the layer.applyEdits(...) passing my own parameters. so if i used the "onBeforeApplyEdits" it's going to be an infinite loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's why i wonder if somebody knows how to handle the EditorWidget onDelete event&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 08:16:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245479#M22726</guid>
      <dc:creator>MostafaFouly</dc:creator>
      <dc:date>2012-08-14T08:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245480#M22727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't have much in the way of an answer but i'm struggling with a similar issue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to provide rollback support for my users when they edit in my js map app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have read the it can be done but must be implemented at the client level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something like a guid that esri passed back when a successful edit is done?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or do i have to remember the edit to support undo?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I see exampled of redo/undo but they are always for client-side graphics and not for true feature editing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 14:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245480#M22727</guid>
      <dc:creator>KevinGooss</dc:creator>
      <dc:date>2012-08-29T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Editor Widget - onDelete event handler</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245481#M22728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample shows how to use the UndoManager and the FeatureLayer onEditsComplete event to provide undo/redo capability to an editing application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_undoRedo.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_undoRedo.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 15:52:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-ondelete-event-handler/m-p/245481#M22728</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2012-08-29T15:52:18Z</dc:date>
    </item>
  </channel>
</rss>

