Documentation

Open component in slider

When a page needs to be opened inside a slider without iframe, it can be done as follows:

BX.SidePanel.Instance.open("widget:example-item", {
    contentCallback: function (slider) {
        return new Promise(function(resolve, reject) {
            BX.ajax.runAction('example.item.view', {
                data: {
                    id: 2208
                }
            }).then(function(response) {
                resolve({ html: response.data.html });
            });
        });
    },
    animationDuration: 100,
    width: 370
});

Please note, that the action example.item.view, must returns type of response \Bitrix\Main\Engine\Response\Component.

© «Bitrix24», 2001-2024
Up