<?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: Start/stop edit layers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657952#M61381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, after a long time looking in the compiled code, it seems this solution work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Deactivate : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget.stopEditing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget._disableMapClickHandler();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Activate :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget._enableMapClickHandler();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Be carefull to not call _enableMapClickHandler twice&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//var editModeIsEdit (bool) true|false =&amp;gt; editing session ?
function manageEditor(){
 if(editModeIsEdit){
&amp;nbsp; if(editorWidget!=undefined){
&amp;nbsp;&amp;nbsp; editorWidget._disableMapClickHandler();
&amp;nbsp;&amp;nbsp; editorWidget._enableMapClickHandler();
&amp;nbsp; }
 }else{
&amp;nbsp; if(templatePicker!=undefined){
&amp;nbsp;&amp;nbsp; templatePicker.clearSelection(false);
&amp;nbsp; }
&amp;nbsp; if(editorWidget!=undefined){
&amp;nbsp;&amp;nbsp; editorWidget.stopEditing(false);
&amp;nbsp;&amp;nbsp; editorWidget._disableMapClickHandler();
&amp;nbsp; }
 }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:51:04 GMT</pubDate>
    <dc:creator>PatrickChapuis</dc:creator>
    <dc:date>2021-12-12T03:51:04Z</dc:date>
    <item>
      <title>Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657948#M61377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcGIS for Server 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS API for JavaScript 3.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to start and stop editing layers. In my application, I can show and hide the editor widget (esri.dijit.editing.Editor) but, after has been started the first time, I cannot stop to edit features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here, the using process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1- start editor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2- click on a feature : I got a popup and I can edit the geometry (vertices, size, ...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3- stop editor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4- click on a different feature (or the same one), I can still edit the geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here, the ways to correct it I tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- layer.setEditable(false) =&amp;gt; "FeatureLayer:setEditable - this functionality is not yet supported for layer in a feature service"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- destroy the editor or the template picker by using many ways&amp;nbsp; =&amp;gt; inefficient&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- start/stop the editor object =&amp;gt; no way to do (activate/deactivate method don't exist)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 09:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657948#M61377</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2012-12-06T09:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657949#M61378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I haven't tested this with the latest api, but try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;editor._updateCurrentFeature(dojo.hitch(this,function(){
&amp;nbsp; editor._clearSelection(false);
}));&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657949#M61378</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-12-12T03:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657950#M61379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, thanks but it doesn't work. I tried to call your code when I shutdown the editor but maybe should I do it when I click on my feature?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 12:23:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657950#M61379</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2012-12-07T12:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657951#M61380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;And, for information, this method exists : myEditor.stopEditing()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From /esri/dijit/editing/Editor.js&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
stopEditing : function(_6) {
 this._updateCurrentFeature(_2.hitch(this,
&amp;nbsp; function() {
&amp;nbsp;&amp;nbsp; this._clearSelection(false);
&amp;nbsp;&amp;nbsp; _6 &amp;amp;&amp;amp; _6();
&amp;nbsp; }));
},&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems it need a variable but I can't find which kind of&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657951#M61380</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2021-12-12T03:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657952#M61381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, after a long time looking in the compiled code, it seems this solution work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Deactivate : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget.stopEditing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget._disableMapClickHandler();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Activate :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editorWidget._enableMapClickHandler();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Be carefull to not call _enableMapClickHandler twice&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//var editModeIsEdit (bool) true|false =&amp;gt; editing session ?
function manageEditor(){
 if(editModeIsEdit){
&amp;nbsp; if(editorWidget!=undefined){
&amp;nbsp;&amp;nbsp; editorWidget._disableMapClickHandler();
&amp;nbsp;&amp;nbsp; editorWidget._enableMapClickHandler();
&amp;nbsp; }
 }else{
&amp;nbsp; if(templatePicker!=undefined){
&amp;nbsp;&amp;nbsp; templatePicker.clearSelection(false);
&amp;nbsp; }
&amp;nbsp; if(editorWidget!=undefined){
&amp;nbsp;&amp;nbsp; editorWidget.stopEditing(false);
&amp;nbsp;&amp;nbsp; editorWidget._disableMapClickHandler();
&amp;nbsp; }
 }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657952#M61381</guid>
      <dc:creator>PatrickChapuis</dc:creator>
      <dc:date>2021-12-12T03:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Start/stop edit layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657953#M61382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick, how did you know of the existence of stopEditing() and _disableMapClickHandler()&amp;nbsp;method?. Those&amp;nbsp;methods don´t exist in the&amp;nbsp;javascript api&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/editor-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/editor-amd.html"&gt;Editor | API Reference | ArcGIS API for JavaScript 3.20&lt;/A&gt;&amp;nbsp;. Excuse my English and&amp;nbsp;I appreciate your response.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 15:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/start-stop-edit-layers/m-p/657953#M61382</guid>
      <dc:creator>CarlosLopez9</dc:creator>
      <dc:date>2017-03-22T15:25:21Z</dc:date>
    </item>
  </channel>
</rss>

