<?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: Custom widget height sizing in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1178008#M14776</link>
    <description>&lt;P&gt;onOpen fires right after startup completes so you should see it firing pretty quickly once you open the widget. Personally I would try to get your events to fire appropriately just by using console logging. Once that works then you can add back the calling of your resize function.&lt;/P&gt;&lt;P&gt;Also I don't think it matters at all but I like to order the functions based on the timing. for example I keep startup first and then onOpen and finally my custom functions.&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 15:48:08 GMT</pubDate>
    <dc:creator>BrianLeroux</dc:creator>
    <dc:date>2022-05-27T15:48:08Z</dc:date>
    <item>
      <title>Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177731#M14771</link>
      <description>&lt;P&gt;WAB Dev 2.19&lt;/P&gt;&lt;P&gt;Lauchpad Theme&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to resize an entire custom widget to maximize it's height property.&amp;nbsp; Already attempted to set position{} properties in the config.json with no affect.&amp;nbsp; However if I inspect the widget in DevTools and manually adjust the height value to 80% it looks like what I want but unsure how to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="jimu-panel jimu-launchpad-panel" id="widgets_Pega WU Tool_Widget_43_panel" widgetid="widgets_Pega WU Tool_Widget_43_panel" style="inset: 120px auto auto 60px; width: 350px; height: 80%; padding: 0px; margin: auto; z-index: 101; position: absolute; opacity: 1;"&amp;gt;&amp;lt;/div&amp;gt;&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JamesCrandall_0-1653598828383.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42238i666E55ED120F4B90/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JamesCrandall_0-1653598828383.png" alt="JamesCrandall_0-1653598828383.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried to implement PanelManger in the Widget.js file itself in an onOpen() function but ran into errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 21:08:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177731#M14771</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2022-05-26T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177909#M14772</link>
      <description>&lt;P&gt;Try reviewing the following thread to see if that helps.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-change-the-width-and-height-of-the-custom/td-p/776163" target="_blank" rel="noopener"&gt;how-to-change-the-width-and-height-of-the-custom&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 12:24:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177909#M14772</guid>
      <dc:creator>BrianLeroux</dc:creator>
      <dc:date>2022-05-27T12:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177974#M14773</link>
      <description>&lt;P&gt;Thanks Brian and Robert of course!&lt;/P&gt;&lt;P&gt;That does in fact work to alter the size of the widget.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to specify a percent size instead of just integer value?&amp;nbsp; Something like instead of 600 can set it so 80%?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;panel.setPosition({ top: 120, left: 10, width: 650, height: 600, margin: 10, index: 0 });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This only worked in the startup: function () {} for my widget.&amp;nbsp; I tried to implement onOpen(){} but it doesn't fire when I close/open the widget.&amp;nbsp; Full solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;_resizeWidget: function (widgetName) {
            var wm = WidgetManager.getInstance();
            var pm = PanelManager.getInstance();
            var myWidget = null;
            arrayUtils.some(wm.appConfig.widgetPool.widgets, function (aWidget) {
                if (aWidget.name === widgetName) {
                    myWidget = aWidget;
                }
            });

            if (myWidget) {
                var controller = wm.getWidgetsByName("AnchorBarController");
                var pos = {
                    relativeTo: map,
                    left: 277,
                    top: 225,
                    width: 600,
                    height: 820
                };
                if (controller.length &amp;gt; 0) {
                    pm.showPanel(myWidget).then(lang.hitch(this, function (panel) {
                        //panel.setPosition({ top: 120, left: 10, width: 350, height: 80%, margin: 10, index: 0 });
                        panel.setPosition({ top: 120, left: 10, width: 650, height: 600, margin: 10, index: 0 });
                        pm.normalizePanel(panel);
                    }));
                } else {
                    pm.showPanel(myWidget);
                }
            }
        },

        onOpen: function () {
            this._resizeWidget("Pega WU Tool"); //doesn't ever fire
        },

        startup: function () {
            //resize widget to specs
            this._resizeWidget("Pega WU Tool");
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 May 2022 14:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177974#M14773</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2022-05-27T14:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177990#M14774</link>
      <description>&lt;P&gt;Have you tried putting 80% as the height value?&amp;nbsp; If that does not work you should be able to calculate the pixel value you want. I would try to take map.height x 0.8 to get 80 % of the map height.&lt;/P&gt;&lt;P&gt;For onOpen, any error in console? I would add a console.log("OnOpen Fired") to make sure you see that event occurring.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 15:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177990#M14774</guid>
      <dc:creator>BrianLeroux</dc:creator>
      <dc:date>2022-05-27T15:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177994#M14775</link>
      <description>&lt;P&gt;heck of an idea!&amp;nbsp; Thanks!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var heightVal = this.map.height * 0.80
panel.setPosition({ top: 75, left: 10, width: 350, height: heightVal, margin: 10, index: 0 });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No errors, the onOpen: function(){} just never gets fired at all. I'm sure it has something to do with the Widget Life Cycle but I haven't fully investigated that yet.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 15:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1177994#M14775</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2022-05-27T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Custom widget height sizing</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1178008#M14776</link>
      <description>&lt;P&gt;onOpen fires right after startup completes so you should see it firing pretty quickly once you open the widget. Personally I would try to get your events to fire appropriately just by using console logging. Once that works then you can add back the calling of your resize function.&lt;/P&gt;&lt;P&gt;Also I don't think it matters at all but I like to order the functions based on the timing. for example I keep startup first and then onOpen and finally my custom functions.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 15:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/custom-widget-height-sizing/m-p/1178008#M14776</guid>
      <dc:creator>BrianLeroux</dc:creator>
      <dc:date>2022-05-27T15:48:08Z</dc:date>
    </item>
  </channel>
</rss>

