# Javascript: SideBarToggleButton.setCurrentSideBar Method

> Sets 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.setCurrentSideBar Method
- **363 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setcurrentsidebar-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setcurrentsidebar-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/sidebartogglebutton/setcurrentsidebar-method/llms-full.txt

---

### Description

Sets 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.setCurrentSideBar(<SideBarType> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| value | A bitwise combination of one or more SideBarType values. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SideBarToggleButton.setCurrentSideBar` in a practical document-editing workflow. It sets 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.setCurrentSideBar(
    TXTextControl.SideBarType.TrackChanges,
    function() {
        console.log("set current side bar completed.");
    },
    onTxError
);
```

---

## Nearby

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