The stretch() method adjusts the modal dialog dimensions according to the content (to avoid scrollbars if possible).
DayPilot.Modal.stretch();
The autoStretch mode is enabled by default. However, you may still want to run this method manually after content page changes (e.g. after expanding a collapsed element).