<?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: Display an array with one element per line in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317892#M29324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just be advised that your targeted browsers would have to support ES6 arrow functions and array.reduce to use Thomas's code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Mar 2017 21:10:53 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-03-14T21:10:53Z</dc:date>
    <item>
      <title>Display an array with one element per line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317889#M29321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a custom widget I want to display the contents of an output array one element per line. Currently the&amp;nbsp;output in the widget's panel is:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;RESULTS: 21N29W160,21N29W210&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;this is the js line that passes the array:&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Quart&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;innerHTML &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'RESULTS: '&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;Quarter&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this is the html line:&lt;/P&gt;&lt;PRE class="line-numbers language-markup"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;data-dojo-attach-point&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Quart&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;eventually each output line will be a link using a specific element of Quarter for the path and name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 19:54:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317889#M29321</guid>
      <dc:creator>StahlyEngineering</dc:creator>
      <dc:date>2017-03-14T19:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Display an array with one element per line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317890#M29322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stahly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Then you need to loop through the Quarter array using dojo array or a simple for loop. and add a "&amp;lt;br&amp;gt;" to the end of each line of text before you add it to the innerHTML.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 20:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317890#M29322</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-14T20:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Display an array with one element per line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317891#M29323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My advice would be to use an HTML list, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let htmlString = Quarter.reduce((accum, current) =&amp;gt; accum += `&amp;lt;li&amp;gt;${current}&amp;lt;/li&amp;gt;`, "&amp;lt;ul&amp;gt;");&lt;/P&gt;&lt;P&gt;htmlString += "&amp;lt;/ul&amp;gt;"&amp;nbsp;&lt;/P&gt;&lt;P&gt;this.Quart.innerHTML = 'RESULTS: '+htmlString;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For older versions of JS you could do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var htmlString =&amp;nbsp;&lt;SPAN&gt;Quarter.reduce(function(accum, current){ accum += "&amp;lt;li&amp;gt;"+current+"&amp;lt;/li&amp;gt;"}, "&amp;lt;ul&amp;gt;");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;htmlString += "&amp;lt;/ul&amp;gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can style the list separately to your liking.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 21:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317891#M29323</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-03-14T21:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Display an array with one element per line</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317892#M29324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just be advised that your targeted browsers would have to support ES6 arrow functions and array.reduce to use Thomas's code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 21:10:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/display-an-array-with-one-element-per-line/m-p/317892#M29324</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-14T21:10:53Z</dc:date>
    </item>
  </channel>
</rss>

