<?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: populate combobox from a local json array file in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161853#M81</link>
    <description>&lt;P&gt;THank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I applied the loop it seems that it populates the combobox but the entries are not visible as they are in white color! I didn't use any css. To resolve the issue I applied css for color:black but it is not working. As you can see I tried also to apply the&amp;nbsp;heightScale="l" but it doesn't expand.:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;calcite-shell-panel&lt;/SPAN&gt; &lt;SPAN&gt;slot&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"contextual-panel"&lt;/SPAN&gt; &lt;SPAN&gt;heightScale&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"l"&lt;/SPAN&gt; &lt;SPAN&gt;position&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"end"&lt;/SPAN&gt; &lt;SPAN&gt;detached&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LefterisKoumis_0-1649279953611.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38279i4F844936CA9FD72D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LefterisKoumis_0-1649279953611.png" alt="LefterisKoumis_0-1649279953611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 21:20:46 GMT</pubDate>
    <dc:creator>LefterisKoumis</dc:creator>
    <dc:date>2022-04-06T21:20:46Z</dc:date>
    <item>
      <title>populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161016#M78</link>
      <description>&lt;P&gt;I defined a combobox:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; &amp;lt;calcite-combobox value="county" label="county" placeholder="County" id="beg_county"
                  style="padding-bottom: 10px; width: 100px;"&amp;gt;&amp;lt;/calcite-combobox&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, I loaded the content of a json file to an array with label and value:&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;LI-CODE lang="javascript"&gt;esriRequest("./CountyRouteRanges.json", options)
        .then((response) =&amp;gt; {
---------
 for (var prop in thedata) {
            if (thedata.hasOwnProperty(prop)) {
                countylist.push({
                label: prop,
                value: prop
              });
            }
          }
-------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can't populate the combobox:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; let countyselection =  document.getElementById("beg_county")
countyselection.add(countylist);&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;</description>
      <pubDate>Tue, 05 Apr 2022 00:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161016#M78</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-04-05T00:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161421#M79</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You need to &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement" target="_self"&gt;create&lt;/A&gt; &lt;A href="https://developers.arcgis.com/calcite-design-system/components/combobox-item/" target="_self"&gt;calcite-combobox-item&lt;/A&gt; components for each of the JSON entries, and then &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild" target="_self"&gt;append&lt;/A&gt; them to the combobox. Here is a codepen:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/benesri/pen/zYpRpmp?editors=0010" target="_blank" rel="noopener"&gt;https://codepen.io/benesri/pen/zYpRpmp?editors=0010&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 23:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161421#M79</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-04-05T23:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161853#M81</link>
      <description>&lt;P&gt;THank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I applied the loop it seems that it populates the combobox but the entries are not visible as they are in white color! I didn't use any css. To resolve the issue I applied css for color:black but it is not working. As you can see I tried also to apply the&amp;nbsp;heightScale="l" but it doesn't expand.:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;calcite-shell-panel&lt;/SPAN&gt; &lt;SPAN&gt;slot&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"contextual-panel"&lt;/SPAN&gt; &lt;SPAN&gt;heightScale&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"l"&lt;/SPAN&gt; &lt;SPAN&gt;position&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"end"&lt;/SPAN&gt; &lt;SPAN&gt;detached&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LefterisKoumis_0-1649279953611.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38279i4F844936CA9FD72D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LefterisKoumis_0-1649279953611.png" alt="LefterisKoumis_0-1649279953611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 21:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161853#M81</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-04-06T21:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161856#M82</link>
      <description>&lt;P&gt;Hmm, can you provide a codepen that reproduces the issue? In your original code you were using "label" instead of "textLabel" for the prop. Maybe that's the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/calcite-design-system/components/combobox-item/#component-api-properties-textLabel" target="_blank"&gt;https://developers.arcgis.com/calcite-design-system/components/combobox-item/#component-api-properties-textLabel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 21:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161856#M82</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-04-06T21:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161864#M83</link>
      <description>&lt;P&gt;I fixed that but it still didn't work, because the&amp;nbsp;countyselection.add(option) doesn't work.&lt;/P&gt;&lt;P&gt;So, I replaced it with the code you provided.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; for (let items of countylist) {           
            const comboItem = document.createElement('calcite-combobox-item');
            comboItem.setAttribute('value', items.value);
            comboItem.setAttribute('labelText', items.label);
            countyselection.appendChild(comboItem);
          }&lt;/LI-CODE&gt;&lt;P&gt;Countylist is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LefterisKoumis_0-1649280682978.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38282i617D8E378AB49ECF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LefterisKoumis_0-1649280682978.png" alt="LefterisKoumis_0-1649280682978.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; &amp;lt;calcite-combobox value="county" label="county" placeholder="County" id="beg_county"
                  style="padding-bottom: 10px; padding-left:30px; width: 100px;" selection-mode="single"&amp;gt;
                &amp;lt;/calcite-combobox&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 21:34:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161864#M83</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-04-06T21:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161868#M85</link>
      <description>&lt;P&gt;If you prefer using setAttribute, then it should be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;comboItem.setAttribute('value', items.value);
comboItem.setAttribute('text-label', items.label);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 22:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161868#M85</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-04-06T22:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161877#M86</link>
      <description>&lt;P&gt;It works. Thank you. Also, as I mentioned in the previous post above, I am trying to make the panel to occupy&amp;nbsp; the whole height. I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;lt;calcite-shell-panel slot="contextual-panel" heightScale="l" position="end" detached&amp;gt;&lt;/P&gt;&lt;P&gt;but it didn't work. So, I applied the&amp;nbsp;style="height: 900px;" at each of&amp;nbsp; the calcite tab . It works, but is there a better way?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 22:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161877#M86</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-04-06T22:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161881#M87</link>
      <description>&lt;P&gt;Using vertical height is better, so it is not dependent on your monitor size:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;style="height:100vh;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 22:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161881#M87</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-04-06T22:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: populate combobox from a local json array file</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161883#M88</link>
      <description>&lt;P&gt;I will post another post for this issue. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 22:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/populate-combobox-from-a-local-json-array-file/m-p/1161883#M88</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2022-04-06T22:53:49Z</dc:date>
    </item>
  </channel>
</rss>

