DS Server

Javascript: RulerBarViewGenerator.getReadOnly Method

Method|Introduced in 30.0

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

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

Parameters

ParameterDescription
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.

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