HOW TO
Any widget in an application may require resizing every time it is opened to display its content clearly. This can hinder the user experience and make the application seem inefficient.
Following these steps, the size of a widget window can be set to certain values in pixels manually. As a result, whenever the widget is opened, its window will have a size suitable for displaying its content.
In the 'Widget.js' file of a widget, there are various callback functions associated with the actions performed by the widget. By adding code that changes certain values of the properties of the widget, such as height and width of the panel, this code can be executed when these functions are called.
To set the default widget size:
onOpen: function() { var panel = this.getPanel(); panel.position.width = 600; panel.position.height = 600; panel.setPosition(panel.position); panel.panelManager.normalizePanel(panel); },
With this change, the application resizes the widget every time it is opened, since the 'onOpen' function is used.
Article ID: 000025937
Get help from ArcGIS experts
Download the Esri Support App