<?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: Limit LayerList dragEnabled to top level in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572071#M86307</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/22093"&gt;@CalebSchwind&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can set the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#childrenSortable" target="_self"&gt;childrenSortable&lt;/A&gt;&amp;nbsp;property on the ListItem within the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction" target="_self"&gt;listItemCreatedFunction&lt;/A&gt;&amp;nbsp;.&amp;nbsp; You could limit this to just group layers or set it for all child layers like this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/sagewall/pen/mybqbXm" target="_blank"&gt;https://codepen.io/sagewall/pen/mybqbXm&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // A function that executes each time a ListItem is created for a layer.
        arcgisLayerList.listItemCreatedFunction = (event) =&amp;gt; {
          // The event object contains an item property.
          // It is a ListItem referencing the associated layer
          // and other properties. You can control the visibility of the
          // item, its title, and actions using this object.
          const { item } = event;
          
          // Prevent drag and drop on all child layers
          item.childrenSortable = false;
          
          // Or if you wanted to limit to group layers
          // if (item.layer.type === "group") {
          //   item.childrenSortable = false;
          // }
         }&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 02 Jan 2025 13:47:12 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2025-01-02T13:47:12Z</dc:date>
    <item>
      <title>Limit LayerList dragEnabled to top level</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572013#M86304</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a layer list with dragEnabled set to true. This is a nice feature but one of my apps I would like to lock this down so that users can't drag children of a group layer outside of the group layer. Is this possible? If not could, I would like to request this feature be added.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 20:49:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572013#M86304</guid>
      <dc:creator>CalebSchwind</dc:creator>
      <dc:date>2025-01-01T20:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Limit LayerList dragEnabled to top level</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572071#M86307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/22093"&gt;@CalebSchwind&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can set the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#childrenSortable" target="_self"&gt;childrenSortable&lt;/A&gt;&amp;nbsp;property on the ListItem within the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction" target="_self"&gt;listItemCreatedFunction&lt;/A&gt;&amp;nbsp;.&amp;nbsp; You could limit this to just group layers or set it for all child layers like this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/sagewall/pen/mybqbXm" target="_blank"&gt;https://codepen.io/sagewall/pen/mybqbXm&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // A function that executes each time a ListItem is created for a layer.
        arcgisLayerList.listItemCreatedFunction = (event) =&amp;gt; {
          // The event object contains an item property.
          // It is a ListItem referencing the associated layer
          // and other properties. You can control the visibility of the
          // item, its title, and actions using this object.
          const { item } = event;
          
          // Prevent drag and drop on all child layers
          item.childrenSortable = false;
          
          // Or if you wanted to limit to group layers
          // if (item.layer.type === "group") {
          //   item.childrenSortable = false;
          // }
         }&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Jan 2025 13:47:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572071#M86307</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2025-01-02T13:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Limit LayerList dragEnabled to top level</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572078#M86308</link>
      <description>&lt;P&gt;That worked thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 14:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/limit-layerlist-dragenabled-to-top-level/m-p/1572078#M86308</guid>
      <dc:creator>CalebSchwind</dc:creator>
      <dc:date>2025-01-02T14:13:06Z</dc:date>
    </item>
  </channel>
</rss>

