# Javascript: SideBarToggleButton.getCurrentSideBar Method

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

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: SideBarToggleButton.getCurrentSideBar Method
- **380 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getcurrentsidebar-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getcurrentsidebar-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getcurrentsidebar-method/llms-full.txt

---

### 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

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

### Parameters

| Parameter | Description |
|---|---|
| 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.

```javascript
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
);
```

---

## Nearby

- **Previous:** [Javascript: SideBarToggleButton.getAllowedSideBars Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/getallowedsidebars-method/llms-full.txt)
- **Next:** [Javascript: SideBarToggleButton.setAllowedSideBars Method](https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setallowedsidebars-method/llms-full.txt)
