<?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: Resizing a popup in 4.X in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resizing-a-popup-in-4-x/m-p/1536529#M85637</link>
    <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/restore-popup-resize-method-functionality/idi-p/1528218" target="_blank" rel="noopener"&gt;I submitted an idea&lt;/A&gt; to get the resize method restored in the API but I finally have success using CSS. I'm still using the same approach as originally outline above but&amp;nbsp; my resizePopupWindow function has changed. I'm now using the setProperty method on the style property and that finally works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;	resizePopupWindow(theWidth,theHeight) {
		  var theCssWidth = theWidth + 'px';
		  var theCssHeight = theHeight + 'px';
		  var cols = document.querySelectorAll('.esri-view-width-xlarge .esri-popup__main-container');
				if (cols.length &amp;gt; 0) {
					  console.log('Adjusting the popup dimensions to ' + theWidth + ' x ' + theHeight);
					  for(var i = 0; i &amp;lt; cols.length; i++) {
						cols[i].style.setProperty("maxHeight", theCssHeight,"important");
						cols[i].style.setProperty("maxWidth", theCssWidth,"important");						
						cols[i].style.setProperty("height", theCssHeight,"important");						
						cols[i].style.setProperty("width", theCssWidth,"important");							
					  }
				}
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully that helps out someone else. I should note that the application I'm using this with is really designed for us in a desktop browser environment. I don't know about trying to use this approach under mobile device circumstances.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 17:49:35 GMT</pubDate>
    <dc:creator>SteveCole</dc:creator>
    <dc:date>2024-09-09T17:49:35Z</dc:date>
    <item>
      <title>Resizing a popup in 4.X</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resizing-a-popup-in-4-x/m-p/1523805#M85406</link>
      <description>&lt;P&gt;In 3.X, this was quite simple as there was the infoWindow.Resize() method but there seemingly is not an equivalent option in 4.X? The closest thing I found was&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/increase-pop-up-height/m-p/1357649" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt; where someone was using CSS to resize the popup. Unfortunately, this hasn't been working for me and I need to adjust the popup's dimensions a number of times, depending on the layer that was clicked.&lt;/P&gt;&lt;P&gt;In my attempt, I'm using reactiveUtil to watch for features being added to the popup:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;		reactiveUtils.watch(()=&amp;gt;theView.popup.features, (event)=&amp;gt;{
		  // If the zoom-out action is clicked, fire the zoomOut() function
			//Attempt to resize the popup based on the layer
			if (event.length &amp;gt; 0) {
				var theLayerName = theView.popup.features[0].layer.id;
				switch(theLayerName) {
					case "tipLine":
						break;
					case "tipPoint":
						break;
					case "swmCip":
						break;
					case "schools":
						break;
					case "parcels":
						break;
					case "raceTracts":
						app.plmf.resizePopupWindow(925,500);
						break;
					case "raceBlockGroups":
						break;
					case "povertyTracts":
						break;
					case "povertyBlockGroups":
						break;
					case "lepTracts":
						break;
					case "lepBlockGroups":
						break;
					case "ageSexTracts":
						break;
					case "ageSexBlockGroups":
						break;	
					case "disabilityTracts":
						break;
					case "disabilityBlockGroups":
						break;	
					case "originTracts":
						break;						
					default:
				}
			}
		});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then the function that is called to attempt to resize the popup is as follows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;	resizePopupWindow(theWidth,theHeight) {
		  var theCssWidth = theWidth + 'px !important';
		  var theCssHeight = theHeight + 'px !important';
		  
		  var cols = document.querySelectorAll('.esri-view-width-xlarge .esri-popup__main-container, .esri-view-width-large .esri-popup__main-container, .esri-view-width-medium .esri-popup__main-container');
				if (cols.length &amp;gt; 0) {
					  for(var i = 0; i &amp;lt; cols.length; i++) {
						cols[i].style.height = theCssHeight;
						cols[i].style.width = theCssWidth;						
					  }
				}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Aug 2024 15:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resizing-a-popup-in-4-x/m-p/1523805#M85406</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2024-08-19T15:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Resizing a popup in 4.X</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resizing-a-popup-in-4-x/m-p/1536529#M85637</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/restore-popup-resize-method-functionality/idi-p/1528218" target="_blank" rel="noopener"&gt;I submitted an idea&lt;/A&gt; to get the resize method restored in the API but I finally have success using CSS. I'm still using the same approach as originally outline above but&amp;nbsp; my resizePopupWindow function has changed. I'm now using the setProperty method on the style property and that finally works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;	resizePopupWindow(theWidth,theHeight) {
		  var theCssWidth = theWidth + 'px';
		  var theCssHeight = theHeight + 'px';
		  var cols = document.querySelectorAll('.esri-view-width-xlarge .esri-popup__main-container');
				if (cols.length &amp;gt; 0) {
					  console.log('Adjusting the popup dimensions to ' + theWidth + ' x ' + theHeight);
					  for(var i = 0; i &amp;lt; cols.length; i++) {
						cols[i].style.setProperty("maxHeight", theCssHeight,"important");
						cols[i].style.setProperty("maxWidth", theCssWidth,"important");						
						cols[i].style.setProperty("height", theCssHeight,"important");						
						cols[i].style.setProperty("width", theCssWidth,"important");							
					  }
				}
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully that helps out someone else. I should note that the application I'm using this with is really designed for us in a desktop browser environment. I don't know about trying to use this approach under mobile device circumstances.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 17:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resizing-a-popup-in-4-x/m-p/1536529#M85637</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2024-09-09T17:49:35Z</dc:date>
    </item>
  </channel>
</rss>

