Open Popup BX24.openApplication

We are still updating this page

Some data may be missing here — we will complete it shortly.

void BX24.openApplication([
            Object parameters[
            Function closeCallback
            ]
        ]);
        

When the method BX24.openApplication is called, a popup window will open with the application frame. The application will receive data from the parameters parameter. The closeCallback handler will be invoked when the popup window is closed. The method can control the size, title, and label of the slider.

Parameters

Parameter

Description

parameters
unknown

An object with parameters that will be passed to the opened application as a JSON string

closeCallback
unknown

The application close handler

bx24_width
unknown

The width of the slider

bx24_label
unknown

The title of the label

bx24_title
unknown

The title of the page

bx24_leftBoundary
unknown

The slider spans the full width with a left margin. Cannot be used simultaneously with bx24_width.

For placements CRM_*_LIST_MENU, it is blocked.

Examples

A unified example for BX24.openApplication and BX24.closeApplication

<script src="//api.bitrix24.com/api/v1/"></script>
        <?
        // parsing input data
        $placementOptions = array();
        if(array_key_exists('PLACEMENT_OPTIONS', $_REQUEST))
        {
            $placementOptions = json_decode($_REQUEST['PLACEMENT_OPTIONS'], true);
        }
        
        // if the application is not opened, display the open button; otherwise, display the close button
        if(!isset($placementOptions['opened']))
        {
        ?>
            <span onclick="openApplication()">Open</span>
        <?
        }
        else
        {
        ?>
            <span onclick="closeApplication()">Close</span>
        <?
        }
        
        ?>
        <script>
            function openApplication()
            {
                BX24.openApplication(
                    {
                        'opened': true // data passed to the opened application
                    },
                    function()
                    {
                        // this handler will be triggered when the application is closed
                        alert('Application closed!')
                    }
                );
        
                setTimeout(closeApplication, 15000); // automatically close after 15 seconds
            }
        
            function closeApplication()
            {
                BX24.closeApplication();
            }
        </script>
        

Example with slider

BX24.openApplication(
            {
                'opened': true,
                'bx24_width': 450,// int
                'bx24_label': {
                    'bgColor':'pink', // aqua/green/orange/brown/pink/blue/grey/violet
                    'text': 'my task',
                    'color': '#07ff0e',
                },
                'bx24_title': 'my title', // str
                //'bx24_leftBoundary': 300, //int
            },
            function()
            {
                console.log('Application closed!')
            }
        );
        

How to Use Examples in Documentation