<?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: Help with ArcGIS API for JS, Custom Popups in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756376#M69936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this will work for&amp;nbsp;what I need&amp;nbsp;using&amp;nbsp;&lt;SPAN&gt;XMLHttpRequest().&lt;/SPAN&gt; &amp;nbsp; I will need to add my header parameters in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btn.addEventListener("click", function() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var ourRequest = new XMLHttpRequest();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ourRequest.open('GET', 'MyURL' + pageCounter + '.json');&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ourRequest.onload = function() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ourRequest.status &amp;gt;= 200 &amp;amp;&amp;amp; ourRequest.status &amp;lt; 400) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var ourData = JSON.parse(ourRequest.responseText);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;renderHTML(ourData);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;BR /&gt; console.log("returned an error.");&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; };&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jun 2017 11:58:58 GMT</pubDate>
    <dc:creator>JeffSherriff</dc:creator>
    <dc:date>2017-06-28T11:58:58Z</dc:date>
    <item>
      <title>Help with ArcGIS API for JS, Custom Popups</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756375#M69935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I have be messing around with the ArcGIS API for Javascript. &amp;nbsp;So far, I have a basemap, added in a point feature layer that I published to AGOL and I have set up a popup template displaying the attributes from my feature layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to display live data in my popup when a user clicks on a point feature. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I go about using the ID from the point feature selected, embed that into a URL and then run&amp;nbsp;a HTTP GET request (with Header auth) and return the data . &amp;nbsp;Then take that data and use it in my popup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hoping to find some sample code where the popup attribute data is being pulled from a URL or feature layer that is not currenlly added to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My HTTP GET request returns the data like below:&lt;/P&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 37px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;Statistics&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;max_speed&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;59&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/max_speed&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;min_speed&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;7&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/min_speed&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;avg_speed&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;40&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/avg_speed&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;avg_speed85&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;49&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/avg_speed85&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;speed_limit&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;40&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/speed_limit&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;count&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;163&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/count&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 53px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/Statistics&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 37px;"&gt;&lt;LABEL class="" for="gwt-uid-1966" style="font-size: 14px; margin-bottom: 5px;"&gt;&lt;/LABEL&gt;&lt;INPUT checked="checked" style="color: #666666; background: none 0px 0px repeat; font-size: 14px; margin: 0px 3px 0px 0px;" type="checkbox" /&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;Parametrs&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;minutes&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;60&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/minutes&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 83px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;speed_type&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #000000; padding: 0px 4px;"&gt;kmh&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/speed_type&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 53px;"&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/Parametrs&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 37px;"&gt;&lt;LABEL class="" for="gwt-uid-1971" style="font-size: 14px; margin-bottom: 5px;"&gt;&lt;/LABEL&gt;&lt;INPUT checked="checked" style="color: #666666; background: none 0px 0px repeat; font-size: 14px; margin: 0px 3px 0px 0px;" type="checkbox" /&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;raw_records&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #333333; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding-left: 67px;"&gt;&lt;LABEL class="" for="gwt-uid-1973" style="font-size: 14px; margin-bottom: 5px;"&gt;&lt;/LABEL&gt;&lt;INPUT style="color: #666666; background: none 0px 0px repeat; font-size: 14px; margin: 0px 3px 0px 0px;" type="checkbox" /&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;record&lt;SPAN class="" style="padding-left: 8px;"&gt;&lt;SPAN class="" style="color: #994500;"&gt;datetime&lt;/SPAN&gt;=&lt;SPAN class="" style="color: #1a1aa8;"&gt;"2017-06-27 15:00:00"&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN class="" style="color: #888888; padding: 0px 5px;"&gt;…&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;lt;/record&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="padding-left: 67px;"&gt;&lt;SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="" style="padding-left: 67px;"&gt;&lt;SPAN&gt;&lt;SPAN class="" style="color: #7a1f74;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2017 20:19:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756375#M69935</guid>
      <dc:creator>JeffSherriff</dc:creator>
      <dc:date>2017-06-27T20:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with ArcGIS API for JS, Custom Popups</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756376#M69936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this will work for&amp;nbsp;what I need&amp;nbsp;using&amp;nbsp;&lt;SPAN&gt;XMLHttpRequest().&lt;/SPAN&gt; &amp;nbsp; I will need to add my header parameters in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btn.addEventListener("click", function() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var ourRequest = new XMLHttpRequest();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ourRequest.open('GET', 'MyURL' + pageCounter + '.json');&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ourRequest.onload = function() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ourRequest.status &amp;gt;= 200 &amp;amp;&amp;amp; ourRequest.status &amp;lt; 400) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var ourData = JSON.parse(ourRequest.responseText);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;renderHTML(ourData);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;BR /&gt; console.log("returned an error.");&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; };&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2017 11:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756376#M69936</guid>
      <dc:creator>JeffSherriff</dc:creator>
      <dc:date>2017-06-28T11:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with ArcGIS API for JS, Custom Popups</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756377#M69937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could quite easily retrieve the data by ID with esri.request:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html"&gt;esri/request | API Reference | ArcGIS API for JavaScript 3.21&lt;/A&gt;.&amp;nbsp; So when you click on the feature, maybe set the popup window content to a load spinner image, and when the request completes, parse the XML and populate the popup window with the new content.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-with-arcgis-api-for-js-custom-popups/m-p/756377#M69937</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-07-10T11:06:57Z</dc:date>
    </item>
  </channel>
</rss>

