<?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: Can't disable &amp;quot;Add feature&amp;quot; button in Editor widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118941#M75358</link>
    <description>&lt;P&gt;Thanks. Pardon me if I'm being obtuse. It looks as if you edited the source for the Editor example at &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/live/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/live/&lt;/A&gt;, but I don't know how to relate that to my own code.&lt;/P&gt;&lt;P&gt;I'd expect I'd have some sort of CSS entry that begins with .esri-editor__feature-list-item. I did find some CSS that uses "[role=button]" and ":first-child", so I may be able to figure this out. Sorry if this is CSS 101, but it's not familiar to me.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 22:36:17 GMT</pubDate>
    <dc:creator>BrentGrossman</dc:creator>
    <dc:date>2021-11-19T22:36:17Z</dc:date>
    <item>
      <title>Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118912#M75350</link>
      <description>&lt;P&gt;In my code (using API version 4.18), I'm using a WebScene and WebMap (toggling between 2d and 3d is supported) with many layers. I'd like for users to be able to edit, but not add to, features in one particular feature layer. However, I can't seem to be able to disable the "Add feature" button using addEnabled. Here's my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        window.locatesFeatureLayer = new this.FeatureLayer({
            url:
                "url to the feature layer in our portal"
        });

        editor = new this.Editor({
                view: view,
                container: editorContainer,
                layerInfos: [{
                    layer: window.locatesFeatureLayer,
                    addEnabled: false
                }]
       });
       editor.addEnabled = false; (//tried to set addEnabled here, too, but 
                                           no luck&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what the Editor widget looks like when I run my code (it's in an Expand widget, as you can see):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrentGrossman_0-1637357675821.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27959i4A4B4114A40AD1B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrentGrossman_0-1637357675821.png" alt="BrentGrossman_0-1637357675821.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even if I can disable "Add feature", that's not ideal, since the button is still visible in that case. What I'd really like is to hide or remove that button altogether.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My questions are,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Why am I not able to disable the "Add feature" button?&lt;/LI&gt;&lt;LI&gt;Is it possible to hide that button, in addition, or instead of, disabling it?&lt;/LI&gt;&lt;LI&gt;If the above isn't possible, can I maybe make the Editor window small enough to only show "Edit feature", but then expand that window when the form for editing is visible (after the user has selected a feature to edit)?&lt;/LI&gt;&lt;LI&gt;If none of the above is possible, can I implement my own editor widget, and if so, what available advice, direction, sample code, etc. is there for doing so?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 19 Nov 2021 21:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118912#M75350</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-19T21:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118915#M75351</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/469775"&gt;@BrentGrossman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can hide the button using css. But that would be fore all layers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One other way would be to disable creating features on the service.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118915#M75351</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2021-11-19T22:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118924#M75354</link>
      <description>&lt;P&gt;Thanks very much. I think hiding the button would be fine--I don't need it for any layers. I looked at Editor.scss and didn't find references to the add and edit buttons. Can you give me more information about how I'd go about hiding the add button?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118924#M75354</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-19T22:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118930#M75357</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/469775"&gt;@BrentGrossman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added to the element&amp;nbsp; visibility: hidden;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_1-1637360196973.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27965i64EE185EE6330A07/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_1-1637360196973.png" alt="RickeyFight_1-1637360196973.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RickeyFight_0-1637360175511.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27964i0E2C5C2D6E0890F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RickeyFight_0-1637360175511.png" alt="RickeyFight_0-1637360175511.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118930#M75357</guid>
      <dc:creator>RickeyFight</dc:creator>
      <dc:date>2021-11-19T22:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118941#M75358</link>
      <description>&lt;P&gt;Thanks. Pardon me if I'm being obtuse. It looks as if you edited the source for the Editor example at &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/live/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/live/&lt;/A&gt;, but I don't know how to relate that to my own code.&lt;/P&gt;&lt;P&gt;I'd expect I'd have some sort of CSS entry that begins with .esri-editor__feature-list-item. I did find some CSS that uses "[role=button]" and ":first-child", so I may be able to figure this out. Sorry if this is CSS 101, but it's not familiar to me.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118941#M75358</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-19T22:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118944#M75359</link>
      <description>&lt;P&gt;I tried this:&lt;/P&gt;&lt;LI-CODE lang="css"&gt;.esri-editor__feature-list-item[role="button"][tabindex="0"] {
  visibility: hidden;
}&lt;/LI-CODE&gt;&lt;P&gt;but it hid both buttons :(.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:47:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118944#M75359</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-19T22:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118946#M75360</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/40123"&gt;@RickeyFight&lt;/a&gt;&amp;nbsp;, this seems to work (though maybe there's a better way?):&lt;/P&gt;&lt;LI-CODE lang="css"&gt;.esri-editor__feature-list-item[role="button"]:nth-of-type(2) {
  visibility: hidden;
}&lt;/LI-CODE&gt;&lt;P&gt;Thanks much for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 22:51:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1118946#M75360</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-19T22:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119038#M75364</link>
      <description>&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;I am not sure this will help your workflow. However, you can refer to the Editor widget API for disabling the actions by specifying the Allowed workflows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const editor = new Editor({
  view: view,
  allowedWorkflows: ["update"] // allows only updates and no adds
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer to the link:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#activeWorkflow" target="_blank" rel="noopener"&gt;esri-widgets-Editor.html activeWorkflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 12:24:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119038#M75364</guid>
      <dc:creator>Kishore</dc:creator>
      <dc:date>2021-11-21T12:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119123#M75367</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/419647"&gt;@Kishore&lt;/a&gt;&amp;nbsp;already pointed out, using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#allowedWorkflows" target="_blank" rel="noopener"&gt;Editor.allowedWorkflows&lt;/A&gt; is the supported and recommended way to toggle which workflows are supported.&lt;/P&gt;&lt;P&gt;You can also tweak this on a per-layer basis using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos" target="_blank" rel="noopener"&gt;Editor.layerInfos&lt;/A&gt;&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const editor = new Editor({
  /* ... */
  layerInfos: [{
    layer: featureLayer,
    enabled: true, // default is true, set to false to disable editing functionality
    addEnabled: true, // default is true, set to false to disable the ability to add a new feature
    updateEnabled: false // default is true, set to false to disable the ability to edit an existing feature
    deleteEnabled: false // default is true, set to false to disable the ability to delete features
  }]
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps and makes your other Editor related questions obsolete&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/469775"&gt;@BrentGrossman&lt;/a&gt;,&amp;nbsp;otherwise feel free to reach out again!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 08:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119123#M75367</guid>
      <dc:creator>ArnoFiva</dc:creator>
      <dc:date>2021-11-22T08:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119220#M75370</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/419647"&gt;@Kishore&lt;/a&gt;. Your solution works for me and seems like a more straightforward way to set the allowed actions than modifying the CSS. I did not notice &lt;EM&gt;allowedWorkflows&lt;/EM&gt; when I originally looked at the Editor documentation, though it's one of the first listed properties.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/183503"&gt;@ArnoFiva&lt;/a&gt;'s alternative of using layerInfos is something I'd already tried (see the code in my original post) without success.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't accept Kishore's answer as the solution. Apparently here, unlike, for example, Stack Overflow, it's not only the original poster who can accept a solution. Anyway, thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 16:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119220#M75370</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-22T16:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119467#M75375</link>
      <description>&lt;P&gt;Thanks for the feedback&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/469775"&gt;@BrentGrossman&lt;/a&gt; and sorry I missed the fact that you also tried to pass addEnabled in the layerInfos. It would be good to see a complete sample as that should work. I've just tried it on the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/" target="_self"&gt;Configurable Editor Widget&lt;/A&gt; sample and this is what it looks like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Using addEnabled on the layerInfos&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-22 at 3.40.15 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28073iF57757C2D7E13644/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-11-22 at 3.40.15 PM.png" alt="Screen Shot 2021-11-22 at 3.40.15 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/419647"&gt;@Kishore&lt;/a&gt;&amp;nbsp;pointed out using allowedWorkflows directly on the Editor&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-22 at 3.40.50 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28074iD91F704EE87A37FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-11-22 at 3.40.50 PM.png" alt="Screen Shot 2021-11-22 at 3.40.50 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 08:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119467#M75375</guid>
      <dc:creator>ArnoFiva</dc:creator>
      <dc:date>2021-11-23T08:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't disable "Add feature" button in Editor widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119633#M75380</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/183503"&gt;@ArnoFiva&lt;/a&gt;, I was able to make "addEnabled: False" work on the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-configurable/" target="_self" rel="nofollow noopener noreferrer"&gt;Configurable Editor Widget&lt;/A&gt;&amp;nbsp;sample, too, by putting it in both layers. My code gets many layers from the portal WebScene that it uses (most of which are not editable), so maybe that's the difference?&lt;/P&gt;&lt;P&gt;"allowedWorkflows" is a perfectly adequate solution for me, but&amp;nbsp;I can probably provide more of my code, if you want to look at it to better understand why "addEnabled" didn't work for me, though I don't think I should post it here.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 18:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-disable-quot-add-feature-quot-button-in/m-p/1119633#M75380</guid>
      <dc:creator>BrentGrossman</dc:creator>
      <dc:date>2021-11-23T18:33:37Z</dc:date>
    </item>
  </channel>
</rss>

