<?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 do I add an Action Section to a whole LayerList Widget? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161454#M15042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't want each Parent layer (or their children) to get the action. Instead, I would like for the whole LayerlistWidget to get the action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "save" action loops through each layer (and sublayer) and checks if the&amp;nbsp;property visible=true. When it finds one that is on, it saves that layer.title into an array. The cookie is generated from the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I don't need each layer to have a button that loops through the whole array, only one button for the whole widget&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Aug 2017 21:49:22 GMT</pubDate>
    <dc:creator>GregSalvador</dc:creator>
    <dc:date>2017-08-11T21:49:22Z</dc:date>
    <item>
      <title>How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161452#M15040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy question for the pros:&lt;/P&gt;&lt;P&gt;In the "LayerList widget with actions" sample code (&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-actions/index.html"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-actions/index.html&lt;/A&gt;) the code gives some actions to a layer.&amp;nbsp;I've modified that example&amp;nbsp;to add a "save" button that writes a cookie with the&amp;nbsp;currently visible layers, so I can reload the page and have&amp;nbsp;my new default layers be visible. However, when I add more layers, the save button shows up on each layer and each sublayer. I was looking for a way to have the save button appear once, but I don't really want it as part of any specific layer. Is there a way to do this? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-family: Consolas; font-size: small;"&gt;//LayerListWidget initialization&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; layerList = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; LayerList({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;view: view,&lt;/P&gt;&lt;P&gt;listItemCreatedFunction: onLayerWidgetStartup&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; onLayerWidgetStartup(event) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item = event.item;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item.actionsSections = [[{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; title: "Save Layer visibility",&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; className: "esri-icon-save"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; }]];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&lt;SPAN style="color: #339966;"&gt;rest of stuff to write cookies&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Since I'm calling onLayerWidgetStartup for each listItem, I get a Save Layer button on each.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 21:06:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161452#M15040</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-11T21:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161453#M15041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Are you saying that you do not want the children of the layer to get the action? If so then just check if the item.children property. If it is a collection then you are dealing with a parent element if it does not then you should not add the action.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 21:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161453#M15041</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-08-11T21:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161454#M15042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't want each Parent layer (or their children) to get the action. Instead, I would like for the whole LayerlistWidget to get the action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "save" action loops through each layer (and sublayer) and checks if the&amp;nbsp;property visible=true. When it finds one that is on, it saves that layer.title into an array. The cookie is generated from the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I don't need each layer to have a button that loops through the whole array, only one button for the whole widget&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 21:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161454#M15042</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-11T21:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161455#M15043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;As you probably know there is no overall menu for the LayerList widget so you would have to manually create something and add it to the widgets domNode. So it would take something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; layerList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;LayerList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// executes for each ListItem in the LayerList&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listItemCreatedFunction&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; defineActions
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; watchUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;whenDefinedOnce&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerList&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"viewModel"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;evt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; mydom &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; domConstruct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toDom&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"&amp;lt;a class='saveLink' href='#'&amp;gt;Save&amp;lt;/a&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;setTimeout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domConstruct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;place&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mydom&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;query&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'.esri-layer-list'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"first"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;query&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'.saveLink'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'click'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&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; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;info&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"save button clicked"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;200&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:29:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161455#M15043</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T08:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161456#M15044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Robert, this is exactly the kind of thing I was looking for. I didn't realize LayerList didn't have an overall menu. However, I'm having trouble making the code work. By adding a bunch of console.log("") lines, I've figured out that the watchUtils.whenDefinedOnce() function is not firing. Where in my code should this snippit go? I've placed it after&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;view.then(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; layerList = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; LayerList({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;view: view,&lt;/P&gt;&lt;P&gt;listItemCreatedFunction: onLayerWidgetStartup //this is my defineActions function&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; view.ui.add(layerList, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"top-left"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;//Your snippit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with view being&amp;nbsp;a mapView object. Thanks in advance for taking a look at this&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 15:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161456#M15044</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-14T15:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161457#M15045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You should notice in my snippet I am not using&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;listItemCreatedFunction as there is no need since you are not wanting to add an action to a individual layer. Just do as I did in my snippet.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 15:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161457#M15045</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-08-14T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161458#M15046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added your snippit inside of the view.then() function, not into the listItemCreatedFunction. The reason I did is because the ARCGIS example for the LayerList widget (&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist/index.html"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist/index.html&lt;/A&gt;) initializes the widget inside that function. I simply added your snippit below that. When I tried to take the layerList initialization and your snippit outside of view.then() function, I got an error saying "object does&amp;nbsp;not support&amp;nbsp;method &lt;SPAN&gt;whenDefinedOnce&lt;/SPAN&gt;". Very strange, since I know .whenDefinedOnce() is is part of watchUtils.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I also included "esri/core/watchUtils" in the require bracket&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you for taking a look at this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 16:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161458#M15046</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-14T16:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161459#M15047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You must have something off in your code then. Can you post what you have for review?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:05:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161459#M15047</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-08-14T19:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161460#M15048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure, here it is. I don't know how to put it in the fancy box with numbered lines like your replies.&lt;/P&gt;&lt;P&gt;require([&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/Map"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/views/MapView"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/layers/FeatureLayer"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/layers/TileLayer"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/widgets/LayerList"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"esri/core/watchUtils"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"dojo/dom"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"dojo/on"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"dojo/domReady!"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;], &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Map, MapView, FeatureLayer, TileLayer, LayerList, dom, on, watchUtils&lt;/P&gt;&lt;P&gt;) {&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; featureLayer = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; FeatureLayer({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; url: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com%2FV6ZHFr6zdgNZuVG0%2Farcgis%2Frest%2Fservices%2FLandscape_Trees%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; transportationLyr = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; TileLayer({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; url: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fserver.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FReference%2FWorld_Transportation%2FMapServer" rel="nofollow" target="_blank"&gt;https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;// This property can be used to uniquely identify the layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; id: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"streets"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//initialize the map object&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; map = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; Map({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; basemap: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"hybrid"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;map.add(featureLayer);&lt;/P&gt;&lt;P&gt;map.add(transportationLyr);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//set up the viewing object and inital viewport&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; view = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; MapView({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; container: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"viewDiv"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;// Reference to the DOM node that will contain the view&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; map: map, &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;// References the map object&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; extent: { &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;// autocasts as new Extent()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;xmin: -9177811,&lt;/P&gt;&lt;P&gt;ymin: 4247000,&lt;/P&gt;&lt;P&gt;xmax: -9176791,&lt;/P&gt;&lt;P&gt;ymax: 4247784,&lt;/P&gt;&lt;P&gt;spatialReference: 102100&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//LayerListWidget initialization&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; layerList = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; LayerList({&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;view: view,&lt;/P&gt;&lt;P&gt;listItemCreatedFunction: onLayerWidgetStartup&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; view.ui.add(layerList, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"top-left"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; watchUtils.whenDefinedOnce(layerList, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"viewModel"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (evt) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; mydom = domConstruct.toDom(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"&amp;lt;a class='saveLink' href='#'&amp;gt;Save&amp;lt;/a&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; setTimeout(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; domConstruct.place(mydom, query(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;'.esri-layer-list'&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;)[0], &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"first"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; on(query(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;'.saveLink'&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;)[0], &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;'click'&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; console.info(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"save button clicked"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;}, 200);&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; view.then(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; () {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; layerList.on(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"trigger-action"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (event) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; id = event.action.title;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//this is what is called when the save button is hit. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//If I undersand your snippit, I would paste over the&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//the console.info("save button clicked"); command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (id === &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"Save Layer visibility"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item = event.item;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; operationalItemCollection = layerList.operationalItems;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; visibleLayersArray = CheckVisibleProperty(operationalItemCollection);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; document.cookie = setCookie(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"CustomDefaultLayers"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;, visibleLayersArray.join(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"|"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//helper function to create visibleLayersArray&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; CheckVisibleProperty(passedCollection) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; passedArray = passedCollection.toArray();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; resultArray = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; Array();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; i = 0; i &amp;lt; passedArray.length; i++) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (passedArray&lt;I&gt;.visible === &lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (passedArray&lt;I&gt;.children.length != 0) {&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; tempArray = CheckVisibleProperty(passedArray&lt;I&gt;.children);&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;resultArray = resultArray.concat(tempArray);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;resultArray.push(passedArray&lt;I&gt;.title);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; resultArray;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//I belive the onLayerWidgetStartup() can be commented out since the &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//function only lets me read the cookies made and I know&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//this part works&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//helper function to initialize the layerList widget&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; onLayerWidgetStartup(event) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item = event.item;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//initializeing the visibility of the layers on startup&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item.visible = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (checkCookie()) &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//check cookie is defined in the cookieMonster&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; resultString = getCookie(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: small; font-family: Consolas;"&gt;"CustomDefaultLayers"&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (resultString.indexOf(item.title) != -1) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item.visible = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;//defaultVisibleLayers is defined as a JSON object in another .js file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; } &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; (defaultVisibleLayers.indexOf(item.title) != -1) { &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas;"&gt;&lt;SPAN&gt;//string.indexOf() reference &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.w3schools.com%2Fjsref%2Fjsref_indexof.asp" rel="nofollow" target="_blank"&gt;https://www.w3schools.com/jsref/jsref_indexof.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt; item.visible = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: small; font-family: Consolas;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 21:54:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161460#M15048</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-14T21:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161461#M15049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So what you will have to learn about JS coding (AMD style) is that your require array list needs to align with your variable list.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;require&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/Map"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/views/MapView"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/layers/FeatureLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/layers/TileLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/widgets/LayerList"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/core/watchUtils"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"dojo/dom"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"dojo/on"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"dojo/domReady!"&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
Map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TileLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LayerList&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; watchUtils&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dom&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; on
&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A class="link-titled" href="https://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/" title="https://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/" rel="nofollow noopener noreferrer" target="_blank"&gt;The abc’s of AMD | ArcGIS Blog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161461#M15049</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T08:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161462#M15050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing I notice on a quick review is your require modules don't match your function arguments. watchUtils is in the wrong order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 22:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161462#M15050</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-08-14T22:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an Action Section to a whole LayerList Widget?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161463#M15051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="mailto:HFOW#$FHOW#@HFW"&gt;HFOW#$FHOW#@HFW&lt;/A&gt; THIS CLEARS UP SO MUCH!! Thank you very much for your time. I have a javascript for beginners book ordered, but it hasn't arrived yet. Thanks for being my JavaScript for Dummies, Robert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 13:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-add-an-action-section-to-a-whole/m-p/161463#M15051</guid>
      <dc:creator>GregSalvador</dc:creator>
      <dc:date>2017-08-15T13:27:24Z</dc:date>
    </item>
  </channel>
</rss>

