<?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: How to destroy esri.dijit.editing.Editor? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662842#M61836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hey. After selecting Map from Editor I get the following error when I want to editorwidget.destroy()&lt;BR /&gt;error message: _E.DISCONNECT IS NOT A FUNCTION&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi orhun,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you create a sample of your issue using jsfiddle.net so I can take a look?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Apr 2014 15:20:13 GMT</pubDate>
    <dc:creator>JonathanUihlein</dc:creator>
    <dc:date>2014-04-15T15:20:13Z</dc:date>
    <item>
      <title>How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662835#M61829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I call destroy()&amp;nbsp; and recreate after, got following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unable to draw graphic (geometry:null, symbol:null): Tried to register widget with id==templateDiv but that id is already registered.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 09:24:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662835#M61829</guid>
      <dc:creator>AndrisBerzins</dc:creator>
      <dc:date>2011-01-06T09:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662836#M61830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i did something similar and got the same error... heh. now i cannot remember what i did to fix it, but here is a snippet of my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; function openEdit(){
&amp;nbsp;&amp;nbsp; editLayersAdded = dojo.connect(map,'onLayersAddResult',addEditor);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; StructurePoints = new esri.layers.FeatureLayer(STRUCTPOINTSERV, {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"]
&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; RecPolygon = new esri.layers.FeatureLayer(RECPOLYSERV, {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"]
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayers([StructurePoints,RecPolygon]);
&amp;nbsp; } 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; function closeEditor(){
&amp;nbsp;&amp;nbsp; if(editIsOn){
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.disconnect(editLayersAdded);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(StructurePoints);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(RecPolygon);
&amp;nbsp;&amp;nbsp;&amp;nbsp; myEditor.destroy();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; function addEditor(r){
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var contentHolder = "&amp;lt;div id='editorDiv'&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div id='tmpDiv'&amp;gt;&amp;lt;/div&amp;gt;";
&amp;nbsp;&amp;nbsp; $j('##editDiv').append(contentHolder);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var templateLayers = dojo.map(r,function(result){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return result.layer;
&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var widget = new esri.dijit.editing.TemplatePicker({
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayers: templateLayers,
&amp;nbsp;&amp;nbsp;&amp;nbsp; grouping: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows: 'auto',
&amp;nbsp;&amp;nbsp;&amp;nbsp; columns: 3
&amp;nbsp;&amp;nbsp; },'tmpDiv');
&amp;nbsp;&amp;nbsp; widget.startup();
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var layers = dojo.map(r, function(result) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return {featureLayer:result.layer};
&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; var settings = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,
&amp;nbsp;&amp;nbsp;&amp;nbsp; templatePicker: widget,
&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService: new esri.tasks.GeometryService(GEOSERVICE),
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfos:layers,
&amp;nbsp;&amp;nbsp;&amp;nbsp; toolbarVisible: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp; createOptions: {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polylineDrawTools:[ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYLINE],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.dijit.editing.Editor.CREATE_TOOL_CIRCLE,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.dijit.editing.Editor.CREATE_TOOL_TRIANGLE,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.dijit.editing.Editor.CREATE_TOOL_RECTANGLE ]
&amp;nbsp;&amp;nbsp;&amp;nbsp; },
&amp;nbsp;&amp;nbsp;&amp;nbsp; toolbarOptions: {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reshapeVisible: true
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; var params = {settings: settings};&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; myEditor = new esri.dijit.editing.Editor(params,'editorDiv');
&amp;nbsp;&amp;nbsp; myEditor.startup();&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;basically my editor is now in an accordion container... when the users switch accordion panels, it turns on/off the editor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can ignore the double # signs... i use coldfusion as a backend... and am 'escaping' the # character used by cf.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662836#M61830</guid>
      <dc:creator>timgogl</dc:creator>
      <dc:date>2021-12-12T04:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662837#M61831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had experienced the same problem.&amp;nbsp; From what I can tell in testing, the solution is to called &amp;lt;yourEditorWidget&amp;gt;.destroy() successfully.&amp;nbsp; In addition, create the template and editor divs dynamically in the DOM using the tools of your choice.&amp;nbsp; In dojo...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var contentHolder = "&amp;lt;div id='templateDiv'&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div id='editorDiv'&amp;gt;&amp;lt;/div&amp;gt;";
dojo.place(contentHolder, "LogOccurrence", "first");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Include this code prior to or during your creation of the editor-related objects.&amp;nbsp; To deactivate editing or recreate the editing stuff upon opening a container, for example, just call &amp;lt;yourEditorWidget&amp;gt;.destroy();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using static divs in the page prevented the editor from reappearing after a destroy.&amp;nbsp; I could see the editor initially but not after destroy.&amp;nbsp; I believe the destroy operation blows away the domNodes associated with the static divs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:01:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662837#M61831</guid>
      <dc:creator>DavidHollema</dc:creator>
      <dc:date>2021-12-12T04:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662838#M61832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I had experienced the same problem.&amp;nbsp; From what I can tell in testing, the solution is to called &amp;lt;yourEditorWidget&amp;gt;.destroy() successfully.&amp;nbsp; In addition, create the template and editor divs dynamically in the DOM using the tools of your choice.&amp;nbsp; In dojo...&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var contentHolder = "&amp;lt;div id='templateDiv'&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div id='editorDiv'&amp;gt;&amp;lt;/div&amp;gt;";
dojo.place(contentHolder, "LogOccurrence", "first");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Include this code prior to or during your creation of the editor-related objects.&amp;nbsp; To deactivate editing or recreate the editing stuff upon opening a container, for example, just call &amp;lt;yourEditorWidget&amp;gt;.destroy();&lt;BR /&gt;&lt;BR /&gt;Using static divs in the page prevented the editor from reappearing after a destroy.&amp;nbsp; I could see the editor initially but not after destroy.&amp;nbsp; I believe the destroy operation blows away the domNodes associated with the static divs.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have two options really.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Destroy the containing div as well.&amp;nbsp; We use a container div and then the edit div.&amp;nbsp; When destroying edit, we destroy the edit div as well.&amp;nbsp; Actually we have to do this for almost all widgets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Loop through the dijit.registry and destroy the proper widget (Code below destroys all).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dijit.registry.forEach(function(w){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w.destroy();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662838#M61832</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2021-12-12T04:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662839#M61833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For an example of destroying/recreating the editor take a look at the Basic Viewer template. The source code is available as a download here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=89db99ee00834c85b3f9284d9e81c964"&gt;http://www.arcgis.com/home/item.html?id=89db99ee00834c85b3f9284d9e81c964&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 15:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662839#M61833</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2011-12-16T15:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662840#M61834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey, did you get this problem solved? my problem is similar but a little bit different. If i dont click on the map, its working pretty well. but as long as i click an point on the map and turn off editor which is using destroy(), the console shows error "object layer layer1 has no method 'disconnect'",thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When I call destroy()&amp;nbsp; and recreate after, got following error:&lt;BR /&gt;&lt;BR /&gt;Unable to draw graphic (geometry:null, symbol:null): Tried to register widget with id==templateDiv but that id is already registered.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 22:22:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662840#M61834</guid>
      <dc:creator>dancheng</dc:creator>
      <dc:date>2013-07-05T22:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662841#M61835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey. After selecting Map from Editor I get the following error when I want to editorwidget.destroy()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;error message: _E.DISCONNECT IS NOT A FUNCTION&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2014 07:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662841#M61835</guid>
      <dc:creator>UmutZaim</dc:creator>
      <dc:date>2014-04-15T07:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to destroy esri.dijit.editing.Editor?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662842#M61836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hey. After selecting Map from Editor I get the following error when I want to editorwidget.destroy()&lt;BR /&gt;error message: _E.DISCONNECT IS NOT A FUNCTION&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi orhun,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you create a sample of your issue using jsfiddle.net so I can take a look?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Apr 2014 15:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-destroy-esri-dijit-editing-editor/m-p/662842#M61836</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-04-15T15:20:13Z</dc:date>
    </item>
  </channel>
</rss>

