# Javascript: RulerBarViewGenerator.getReadOnly Method

> Gets a value determining the ruler bar's read only mode. When the ruler bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 30.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: RulerBarViewGenerator.getReadOnly Method
- **412 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/rulerbarviewgenerator/getreadonly-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/rulerbarviewgenerator/getreadonly-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/rulerbarviewgenerator/getreadonly-method/llms-full.txt

---

### Description

Gets a value determining the ruler bar's read only mode. When the ruler bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.

### Syntax

```javascript
<void> RulerBarViewGenerator.getReadOnly(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `RulerBarViewGenerator.getReadOnly` in a practical document-editing workflow. It gets a value determining the ruler bar's read only mode. When the ruler bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.

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

TXTextControl.rulerBar.getReadOnly(
    function(result) {
        if (result) {
            console.log("get read only is available.");
        } else {
            console.warn("get read only is not available in the current document state.");
        }
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: RulerBarViewGenerator.getFormulaMode Method](https://docs.textcontrol.com/ds-server/reference/javascript/rulerbarviewgenerator/getformulamode-method/llms-full.txt)
- **Next:** [Javascript: RulerBarViewGenerator.getScaleUnit Method](https://docs.textcontrol.com/ds-server/reference/javascript/rulerbarviewgenerator/getscaleunit-method/llms-full.txt)
