<?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 Example of a confirm dialog prior to deleting a record while editing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/example-of-a-confirm-dialog-prior-to-deleting-a/m-p/342190#M31641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am setting up an editor widget and I have included the delete button in the attributeinspector.&amp;nbsp;&amp;nbsp; Rather than just deleting the record, I'd like to insert a dialog, that has a prompt like "Are you sure you want to delete?"&amp;nbsp; I assume I can use the result of the user's choice to determine whether or not to actually apply the edit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I can use 'before-apply-edits' for this, but I can't wrap my head around how it all fits together.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone has an example to share?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 14:55:22 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2016-01-29T14:55:22Z</dc:date>
    <item>
      <title>Example of a confirm dialog prior to deleting a record while editing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/example-of-a-confirm-dialog-prior-to-deleting-a/m-p/342190#M31641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am setting up an editor widget and I have included the delete button in the attributeinspector.&amp;nbsp;&amp;nbsp; Rather than just deleting the record, I'd like to insert a dialog, that has a prompt like "Are you sure you want to delete?"&amp;nbsp; I assume I can use the result of the user's choice to determine whether or not to actually apply the edit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I can use 'before-apply-edits' for this, but I can't wrap my head around how it all fits together.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone has an example to share?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 14:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/example-of-a-confirm-dialog-prior-to-deleting-a/m-p/342190#M31641</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-01-29T14:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Example of a confirm dialog prior to deleting a record while editing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/example-of-a-confirm-dialog-prior-to-deleting-a/m-p/342191#M31642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this is not an example but just looking at this example: &lt;A href="https://developers.arcgis.com/javascript/jssamples/ed_attribute_inspector.html" title="https://developers.arcgis.com/javascript/jssamples/ed_attribute_inspector.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Using the attribute inspector | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code for your pop-up would go here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;&amp;nbsp; attInspector&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;on&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #dd1144;"&gt;"delete"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;function&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;evt&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; evt&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;feature&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;().&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;applyEdits&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;null&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;null&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;evt&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;feature&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;]);&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;infoWindow&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;hide&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;();&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;});&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside this function, I would create a dialogue div with 2 buttons yes and no. After the user clicks one of the two, put in an if statement that either deletes or doesn't depending on what the user clicked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that is done don't forget to destroy the dialogue div, so you can re-create it once another delete button has been pressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:08:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/example-of-a-confirm-dialog-prior-to-deleting-a/m-p/342191#M31642</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2021-12-11T16:08:45Z</dc:date>
    </item>
  </channel>
</rss>

