Skip to main content

How to dynamically resize a pop-up window

How can I make my pop-up window automatically grow and shrink at runtime?

For example: I created a pop-up window using Popup_Editor with a TableRecords; the contents of the TableRecords can be changed from inside the pop-up window and I want to automatically change the pop-up size according to the size of the TableRecords.


To make a pop-up automatically grow according to the contents inside set the AutoResize property from Popup_Editor to True.

Pop-up AutoResize

The AutoResize property only affects the automatic growth of the pop-up window. To make the pop-up automatically shrink according to the contents inside follow these steps:

  1. Add the following JavaScript snippet to the JavaScript property of the pop-up Web Screen:

    function PopupEditor_ForceResize() {
        var popupDiv =$(".os-internal-ui-dialog-content");
        var popupDivOldHeight = popupDiv.height();
        // reduce iframe's div height to its contents
        // pop-up editor already auto-grows, so we just need to address auto-shrink
        if (popupDiv.height() >= popupDivOldHeight) {
            return false;
        var result =, -1, -1, false, {target: popupDiv});
        if (!result) {
            // something wrong happened in resize - reset iframe's div height

    This JavaScript snippet defines a function PopupEditor_ForceResize() that you will use to shrink the pop-up window during runtime.

  2. Add the RunJavaScript action from the HTTPRequestHandler extension and set the Script property set as "PopupEditor_ForceResize()" to every action that makes your popup contents shrink.

    This will call the PopupEditor_ForceResize() JavaScript action.

  • Was this article helpful?