<?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: How to resize infoWindow automatically based on the content? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116611#M10861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the resize method as you suggested. It only shrink to fit for height not the width. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]28560[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advice me on how to made this shrink to fit for width of the infoWindow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Oct 2013 02:04:32 GMT</pubDate>
    <dc:creator>AmaranathaNarasinghe</dc:creator>
    <dc:date>2013-10-24T02:04:32Z</dc:date>
    <item>
      <title>How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116609#M10859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using infoWindow to display some text to the user. The content of the infoWindow is dynamically generated HTML formatted text. The problem here is, infoWindow shows the text by adding scroll bars.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to re-size the window to avoid the scroll bars. infoWindow.resize() method can't be used as the HTML text may have tables, new paragraphs or any thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help me to re-size the infoWindow automatically based on the content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]28506[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 07:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116609#M10859</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-22T07:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116610#M10860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;welcome to the forums!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in this situation you want to call either infoWindow or popup.&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/popup-amd.html"&gt;resize()&lt;/A&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this will set a new maximum size to accomodate more text.&amp;nbsp; when less text is present, the popup/infoWindow will shrink to fit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try playing around with this sample to get the hang of it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/map_infowindow.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/map_infowindow.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 15:10:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116610#M10860</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2013-10-23T15:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116611#M10861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the resize method as you suggested. It only shrink to fit for height not the width. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]28560[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please advice me on how to made this shrink to fit for width of the infoWindow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 02:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116611#M10861</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-24T02:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116612#M10862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Amaranatha,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can check the length of the content you set in the info window and based on the length you could resize the infowindow as required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please have a look at this fiddle:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://jsfiddle.net/patelmanya/5SRgH/1/"&gt;http://jsfiddle.net/patelmanya/5SRgH/1/&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manish Patel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 02:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116612#M10862</guid>
      <dc:creator>ManishkumarPatel</dc:creator>
      <dc:date>2013-10-24T02:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116613#M10863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Manish,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The content shown in my actual implementation is generated dynamically and it's a HTML formatted string. It may contain HTML tables (&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;), new paragraphs (&amp;lt;p&amp;gt;) and any other HTML tags. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's the reason why I can't find the length of the lengthiest line of the content when previewing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 02:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116613#M10863</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-24T02:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116614#M10864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Manish,&lt;BR /&gt;&lt;BR /&gt;The content shown in my actual implementation is generated dynamically and it's a HTML formatted string. It may contain HTML tables (&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;), new paragraphs (&amp;lt;p&amp;gt;) and any other HTML tags. &lt;BR /&gt;&lt;BR /&gt;That's the reason why I can't find the length of the lengthiest line of the content when previewing.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Amnalk&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Amnalk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh I see. Is it possible you could provide some examples of the content that are occuring in your actual implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although you can create a DIV element and assign the content (tables/para etc) as the innerHTML to this DIV and set the info window content as this DIV.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var infocontdiv = document.createElement("div");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; infocontdiv.id = "infoContDiv";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; infocontdiv.innerHTML = "This text can be dynamically set as per required and then calcuate the lenght of this text and set the width and height of info window.";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.infoWindow.setContent(infocontdiv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this alternative, the DIV element will always set its width and height dynamically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 02:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116614#M10864</guid>
      <dc:creator>ManishkumarPatel</dc:creator>
      <dc:date>2013-10-24T02:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116615#M10865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Manish,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried as you suggested by adding a div. But still the issue exists. Please find the sample text for content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;1111111111&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;22222222222222222222222222&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;3333333333&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;4444444444444444444444444444444&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;555555555555555&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;66666666666666666666666&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;77777777777777777&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;8888888888888888888888888888&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 03:21:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116615#M10865</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-24T03:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116616#M10866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Manish,&lt;BR /&gt;&lt;BR /&gt;I tried as you suggested by adding a div. But still the issue exists. Please find the sample text for content.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;1111111111&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;22222222222222222222222222&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;3333333333&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;4444444444444444444444444444444&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;555555555555555&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;66666666666666666666666&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;77777777777777777&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;8888888888888888888888888888&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Amnalk&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Amnalk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try the below code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var infocontdiv = document.createElement("div");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; infocontdiv.id = "infoContDiv";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; infocontdiv.innerHTML = "&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;1111111111&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;22222222222222222222222222&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;3333333333&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;4444444444444444444444444444444&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td nowrap&amp;gt;555555555555555&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;66666666666666666666666&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;77777777777777777&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;8888888888888888888888888888&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.infoWindow.setContent(infocontdiv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.infoWindow.resize(map.infoWindow._contentPane.scrollWidth + 50, map.infoWindow._contentPane.scrollHeight + 20);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 03:55:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116616#M10866</guid>
      <dc:creator>ManishkumarPatel</dc:creator>
      <dc:date>2013-10-24T03:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116617#M10867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Manish,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code works fine for the first time when I clicked on the map. But the width of the dialog box is keep on growing upon opening.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amaranatha&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 05:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116617#M10867</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-24T05:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116618#M10868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Manish,&lt;BR /&gt;&lt;BR /&gt;Your code works fine for the first time when I clicked on the map. But the width of the dialog box is keep on growing upon opening.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards,&lt;BR /&gt;Amaranatha&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Amnalk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry I actually didnt try that for multiple times. Anyways, you will have to try creating a global variable and assign the width &amp;amp; height to it. Also you will have to put a check if the scrollwidth and scrollheight is different then reassign the value and it will resize as per content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//global variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var infowindowWid,infowindowHgt = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; map.infoWindow.setContent(infocontdiv);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!infowindowWid)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //here you can put multiple conditions as per your requirement.&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infowindowWid = map.infoWindow._contentPane.scrollWidth + 50;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infowindowHgt = map.infoWindow._contentPane.scrollHeight + 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.resize(infowindowWid, infowindowHgt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 06:16:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116618#M10868</guid>
      <dc:creator>ManishkumarPatel</dc:creator>
      <dc:date>2013-10-24T06:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116619#M10869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Manish,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for the quick responses and the assistance. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But still I've a issue with resizing as map.infoWindow._contentPane.scrollWidth does not adjust according to the content. Once the infoWindow popups with map.infoWindow._contentPane.scrollWidth + 50 that width remains for ever.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As my display content is dynamic, this causes problems. As an example, for the first time content is too large and say map.infoWindow._contentPane.scrollWidth = 500. In the second time, content is very small. But map.infoWindow._contentPane.scrollWidth remains same and infoWindow is too wide to show this small content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amnalk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 08:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116619#M10869</guid>
      <dc:creator>AmaranathaNarasinghe</dc:creator>
      <dc:date>2013-10-24T08:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to resize infoWindow automatically based on the content?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116620#M10870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The module "dojo/dom-geometry" &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;might&lt;/SPAN&gt;&lt;SPAN&gt; be helpful.&amp;nbsp; I was faced with a similar infoWindow scrollbar issue this week and it seems to be resolved after adding some code which incorporates that module.&amp;nbsp; The variance in size for me was in height-only, as I was using NWS weather observation XML and which varies in content by station and observation time.&amp;nbsp; The variance you describe seems to be in both dimensions, and probably much larger in magnitude.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I create the div (and assign it an ID) in the function which processes the output from the XHR request, then include the dojo/dom-geometry module in the function tied to the mouse-over event.&amp;nbsp; The dom-geometry module is used against the div id to obtain its dimensions, which you can then use to calculate/set a new infoWindow size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
/* excerpt from function mkinfoWindowContent
var infocontdiv = domConstruct.create("div");
infocontdiv.id = "wthrdiv";
infocontdiv.innerHTML = content;&amp;nbsp; 
r9WthrApp.map.infoWindow.setContent(infocontdiv);


/* excerpt from function which uses dojo/dom-geometry to determine height of content
require(["dojo/_base/Deferred","dojo/dom","dojo/dom-geometry"], 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function(Deferred,dom,domGeom){
.
.
.
&amp;nbsp;&amp;nbsp;&amp;nbsp; var retdata = new Deferred();
&amp;nbsp;&amp;nbsp;&amp;nbsp; retdata = getWthrXML(forestnum); //deferred
&amp;nbsp;&amp;nbsp;&amp;nbsp; retdata.then(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function(xmldoc) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mkInfoWindowContent(xmldoc);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (evt) ? r9WthrApp.map.infoWindow.show(evt.screenPoint,r9WthrApp.map.getInfoWindowAnchor(evt.screenPoint)) : null; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var node = dom.byId("wthrdiv");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var coords = domGeom.position(node);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newht = coords.h + 50;&amp;nbsp; //coords.h is height property
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r9WthrApp.map.infoWindow.resize(250,newht);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ); //end deferred then
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-resize-infowindow-automatically-based-on/m-p/116620#M10870</guid>
      <dc:creator>bobcarr</dc:creator>
      <dc:date>2021-12-11T06:51:29Z</dc:date>
    </item>
  </channel>
</rss>

