<?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: Filter Widget from JS SDK code sample not displaying features when using different data in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392799#M83898</link>
    <description>&lt;P&gt;You changed some class names in the html, so you need to do that in the javascript too.&amp;nbsp; .category-item data-category&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const seasonsNodes = document.querySelectorAll(`.category-item`);
        const seasonsElement = document.getElementById("seasons-filter");

        // click event handler for seasons choices
        seasonsElement.addEventListener("click", filterBySeason);

        // User clicked on Winter, Spring, Summer or Fall
        // set an attribute filter on flood warnings layer view
        // to display the warnings issued in that season
        function filterBySeason(event) {
          console.log(document.querySelectorAll('.category-item'));
          const selectedSeason = event.target.getAttribute("data-category");
          floodLayerView.filter = {
            where: "Category = '" + selectedSeason + "'"
          };
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2024 20:29:09 GMT</pubDate>
    <dc:creator>MatthewDriscoll</dc:creator>
    <dc:date>2024-03-07T20:29:09Z</dc:date>
    <item>
      <title>Filter Widget from JS SDK code sample not displaying features when using different data</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392713#M83896</link>
      <description>&lt;P&gt;I am trying to use the code sample for the JavaScript SDK code sample using a filter at this link:&lt;/P&gt;&lt;P&gt;&lt;A title="FilterByAttributes" href="https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/" target="_self"&gt;ArcGIS JavaScript SDK FilterByAttributes&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the data source to my own AGOL hosted feature layer and changed the category filter list items in the filter div; however, when I click on one of the categories all of the features disappear.&lt;/P&gt;&lt;P&gt;&lt;A title="MyFilterSample" href="https://codepen.io/geoJshon/pen/OJGywGo?editors=1111" target="_self"&gt;MyFilterSample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't changed references in variable names and other placeholder code yet and the CSS still needs to be refined to fit my list. Just trying to get the basic filter function to work at this point.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 18:23:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392713#M83896</guid>
      <dc:creator>AlcoGISUser</dc:creator>
      <dc:date>2024-03-07T18:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Widget from JS SDK code sample not displaying features when using different data</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392799#M83898</link>
      <description>&lt;P&gt;You changed some class names in the html, so you need to do that in the javascript too.&amp;nbsp; .category-item data-category&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const seasonsNodes = document.querySelectorAll(`.category-item`);
        const seasonsElement = document.getElementById("seasons-filter");

        // click event handler for seasons choices
        seasonsElement.addEventListener("click", filterBySeason);

        // User clicked on Winter, Spring, Summer or Fall
        // set an attribute filter on flood warnings layer view
        // to display the warnings issued in that season
        function filterBySeason(event) {
          console.log(document.querySelectorAll('.category-item'));
          const selectedSeason = event.target.getAttribute("data-category");
          floodLayerView.filter = {
            where: "Category = '" + selectedSeason + "'"
          };
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 20:29:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392799#M83898</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2024-03-07T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Widget from JS SDK code sample not displaying features when using different data</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392945#M83907</link>
      <description>&lt;P&gt;That did it! Thank you. Thought I had already changed those lines.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 23:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-widget-from-js-sdk-code-sample-not/m-p/1392945#M83907</guid>
      <dc:creator>AlcoGISUser</dc:creator>
      <dc:date>2024-03-07T23:48:15Z</dc:date>
    </item>
  </channel>
</rss>

