<?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: Buttonmenu and buttonmenuitem cannot be added to feature table in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268953#M80585</link>
    <description>&lt;P&gt;Which version of the API are you using? That &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#event-selection-change" target="_self"&gt;event&lt;/A&gt; was deprecated in 4.25&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 14:00:34 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-03-17T14:00:34Z</dc:date>
    <item>
      <title>Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267041#M80529</link>
      <description>&lt;P&gt;I am very confused, because I followed official samples and codes, but none worked for me.&lt;BR /&gt;I am mostly a new developer that's learning both JS and Experience Builder.&lt;BR /&gt;&lt;BR /&gt;I tried codes from both of these related questions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-customize-the-featuretable/td-p/1038158" target="_blank" rel="noopener"&gt;How to display feature table&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-customize-the-featuretable/td-p/1038158" target="_blank" rel="noopener"&gt;How to customize the feature table&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also researched many samples and tried the codes, like:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-tablelist/" target="_blank" rel="noopener"&gt;Widgets Tablelist&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-editing/" target="_blank" rel="noopener"&gt;Widgets FeatureTable Editing&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I cannot add a custom button anywhere in the feature table through ButtonMenu, ButtonMenuItem.&lt;BR /&gt;I am very confused because it is all official documentation, but it doesn't work for me in either&amp;nbsp;&lt;BR /&gt;JS files that I manually create or through custom widget in Experience Builder. Neither works for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureTable.visibleElements = {
        header: true,
        menu: true,
        menuItems: {
          clearSelection: true,
          refreshData: true,
          toggleColumns: true,
          selectedRecordsShowAllToggle: true,
          zoomToSelection: true
        },
        selectionColumn: true,
        columnMenus: true
      }&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;featureTable.when().then(() =&amp;gt; {
        const newMenuItem = {
            label: "Do something",
            iconClass: "Icon font name, if applicable",
            visible: true,
            clickFunction: (event) =&amp;gt; {
                console.log("Clicked!");
            }
        };
        featureTable.menu.items.push(newMenuItem);
    });&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;   // Typical usage for ButtonMenuItem
      const buttonMenuItem1 = new ButtonMenuItem ({
        label: "custom menu item label",
        iconClass: "Icon font name, if applicable",
        clickFunction: function () {
          // Add custom function to perform on menu item button click
        }
      });
      
      const buttonMenuItem2 = new ButtonMenuItem ({
        label: "Second custom menu item label",
        iconClass: "esri-icon-minimize",
        clickFunction: function (event) {
          // Add second custom function to perform on menu item button click
        }
      });
      
      // Apply the button menu items above to the button menu
      const buttonMenu = new ButtonMenu ({
        iconClass: "esri-icon-minimize",
        items: [buttonMenuItem1, buttonMenuItem2]
      });&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;None of the above worked for me. I cannot determine any issues.&lt;BR /&gt;Is it possible all of this is because of specific Feature Layer limitations? I have no knowledge of how feature layers are made from administrators. Thank you any feedback is welcome.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 13:24:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267041#M80529</guid>
      <dc:creator>GDipublisher</dc:creator>
      <dc:date>2023-03-13T13:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267086#M80533</link>
      <description>&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#menu" target="_self"&gt;menu&lt;/A&gt; property of the FeatureTable is read-only, so you can't set anything with it. Instead, you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#menuConfig" target="_self"&gt;menuConfig&lt;/A&gt; property to set which menu items appear, using your buttonMenu variable. Take a look at this &lt;A href="https://codepen.io/kenbuja/pen/abaqrZr?editors=1010" target="_self"&gt;CodePen&lt;/A&gt;, using a modified FeatureTable &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable/" target="_self"&gt;sample&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 15:05:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267086#M80533</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-03-13T15:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267909#M80567</link>
      <description>&lt;P&gt;Sorry for the delayed response.&lt;BR /&gt;&lt;BR /&gt;So that's how the menuConfig is used. I researched it, but didn't find many examples of it being used, that's why I didn't consider it important. But thank you, it was the missing piece! Thank you, beer or coffee on me.&lt;BR /&gt;&lt;BR /&gt;I got one little further up question - can the menuConfig be dynamically added and removed from the table? Or just toggled visibility on and off.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 08:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1267909#M80567</guid>
      <dc:creator>GDipublisher</dc:creator>
      <dc:date>2023-03-15T08:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268021#M80569</link>
      <description>&lt;P&gt;Yes you can. I updated the &lt;A href="https://codepen.io/kenbuja/pen/abaqrZr?editors=1010" target="_self"&gt;CodePen&lt;/A&gt; showing this. When it first opens, there is just one menu item. Clicking the button in the upper left adds another menu item.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 14:02:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268021#M80569</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-03-15T14:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268896#M80584</link>
      <description>&lt;P&gt;I checked it out, its perfect.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Only thing I would like to ask again is hiding the menu after being shown. I tried to do "selection-change" event on the feature table, and it shows the menu on row select, now I just need it hidden when there are no rows selected.&amp;nbsp; I tried with the removedRows, but it doesn't fire when turning off selected feature.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;the_table.on("selection-change", (event) =&amp;gt; {
    let addedRows = event.added; 
    let removedRows = event.removed;

if(addedRows.length === 0) { the_table.menuConfig = null; }
      
if(addedRows &amp;amp;&amp;amp; addedRows.length &amp;gt; 0){

            the_table.menuConfig = buttonMenu;     
  
  }
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:29:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268896#M80584</guid>
      <dc:creator>GDipublisher</dc:creator>
      <dc:date>2023-03-17T10:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268953#M80585</link>
      <description>&lt;P&gt;Which version of the API are you using? That &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#event-selection-change" target="_self"&gt;event&lt;/A&gt; was deprecated in 4.25&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 14:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1268953#M80585</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-03-17T14:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Buttonmenu and buttonmenuitem cannot be added to feature table</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1269222#M80599</link>
      <description>&lt;P&gt;In the JS API I'm mainly switching between 4.23 and 4.25 for styles and some functionality.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the Experience Builder, I'm not sure I'll get back to you and edit this post later.&lt;BR /&gt;&lt;BR /&gt;I don't think highlightIds changes my situation, as I need to hide and show the menu, the event where is irrelevant. For now its table select on 4.25. But thank you all in all, I learned much and I'll figure it out.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 17:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buttonmenu-and-buttonmenuitem-cannot-be-added-to/m-p/1269222#M80599</guid>
      <dc:creator>GDipublisher</dc:creator>
      <dc:date>2023-03-18T17:14:03Z</dc:date>
    </item>
  </channel>
</rss>

