DS Server

Javascript: SideBarToggleButton.getCurrentSideBar Method

Method|Introduced in 30.0

Description

Returns the side bar which is shown in the side bar toggle / drop down button at the top right of the ribbon bar.

Syntax

<void> SideBarToggleButton.getCurrentSideBar(<SideBarTypeRequestCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the current value.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates SideBarToggleButton.getCurrentSideBar in a practical document-editing workflow. It returns the side bar which is shown in the side bar toggle / drop down button at the top right of the ribbon bar.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.sideBarToggleButton.getCurrentSideBar(
    function(sideBarType) {
        if (!sideBarType) {
            console.warn("No side bar type was returned.");
            return;
        }
        
        console.log("get current side bar result:", sideBarType);
    },
    onTxError
);