<?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 Problem displaying attribute table via actions &amp;amp; LayerList in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-displaying-attribute-table-via-actions-amp/m-p/1095601#M74562</link>
    <description>&lt;P&gt;I am trying to open an attribute table but I get something else :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OguzSariyildiz_0-1630868288699.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22435i19C441ABC5F0540A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OguzSariyildiz_0-1630868288699.png" alt="OguzSariyildiz_0-1630868288699.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It tries to create an infinite number of tables. Do you have any idea why that happens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        let layerList = new LayerList({
            view: view,
            container:"sideDiv",
            listItemCreatedFunction: defineActions   
        });

        function defineActions(event) {
        // The event object contains an item property.
        // is 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.

          var item = event.item;
          
          item.actionsSections = [
            [
              {
                title: "Go to full extent",
                className: "esri-icon-zoom-out-fixed",
                id: "full-extent"
              },

              {
                title: "Attribute Table",
                className: "esri-icon-table",
                id: "attribute-table"
              },

              {
                title: "Layer information",
                className: "esri-icon-description",
                id: "information"
              }
            ],
          ];

          view.when(function() {  

              layerList.on("trigger-action", function(event) {
              // The layer visible in the view at the time of the trigger.
              
              // Capture the action id.
              var id = event.action.id;
              activeLayer = event.item.layer 
              
              if (id === "full-extent") {
                // If the full-extent action is triggered then navigate
                // to the full extent of the visible layer.
                view.goTo(activeLayer.fullExtent); 

              } else if (id === "attribute-table") {
                // If the table action is triggered, then
                // open the attribute table

                var featureTable = new FeatureTable({
                  view: view, // make sure to pass in view in order for selection to work
                  layer: activeLayer,
                  container: "tableDiv"
                });
                
              } else if (id === "information") {
                // If the information action is triggered, then
                // open the item details page of the service layer.
                window.open(activeLayer.url);
              };
            });
          });      
        }
      });
    &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 19:16:03 GMT</pubDate>
    <dc:creator>Amadeus111</dc:creator>
    <dc:date>2021-09-07T19:16:03Z</dc:date>
    <item>
      <title>Problem displaying attribute table via actions &amp; LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-displaying-attribute-table-via-actions-amp/m-p/1095601#M74562</link>
      <description>&lt;P&gt;I am trying to open an attribute table but I get something else :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OguzSariyildiz_0-1630868288699.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22435i19C441ABC5F0540A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OguzSariyildiz_0-1630868288699.png" alt="OguzSariyildiz_0-1630868288699.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It tries to create an infinite number of tables. Do you have any idea why that happens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        let layerList = new LayerList({
            view: view,
            container:"sideDiv",
            listItemCreatedFunction: defineActions   
        });

        function defineActions(event) {
        // The event object contains an item property.
        // is 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.

          var item = event.item;
          
          item.actionsSections = [
            [
              {
                title: "Go to full extent",
                className: "esri-icon-zoom-out-fixed",
                id: "full-extent"
              },

              {
                title: "Attribute Table",
                className: "esri-icon-table",
                id: "attribute-table"
              },

              {
                title: "Layer information",
                className: "esri-icon-description",
                id: "information"
              }
            ],
          ];

          view.when(function() {  

              layerList.on("trigger-action", function(event) {
              // The layer visible in the view at the time of the trigger.
              
              // Capture the action id.
              var id = event.action.id;
              activeLayer = event.item.layer 
              
              if (id === "full-extent") {
                // If the full-extent action is triggered then navigate
                // to the full extent of the visible layer.
                view.goTo(activeLayer.fullExtent); 

              } else if (id === "attribute-table") {
                // If the table action is triggered, then
                // open the attribute table

                var featureTable = new FeatureTable({
                  view: view, // make sure to pass in view in order for selection to work
                  layer: activeLayer,
                  container: "tableDiv"
                });
                
              } else if (id === "information") {
                // If the information action is triggered, then
                // open the item details page of the service layer.
                window.open(activeLayer.url);
              };
            });
          });      
        }
      });
    &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 19:16:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-displaying-attribute-table-via-actions-amp/m-p/1095601#M74562</guid>
      <dc:creator>Amadeus111</dc:creator>
      <dc:date>2021-09-07T19:16:03Z</dc:date>
    </item>
  </channel>
</rss>

