TX Text Control .NET Server

Javascript: TXTextControl.getCanUndo Method

Method|Introduced in 28.0

Description

Gets a value indicating whether the user can undo the previous operation in a Text Control.

Syntax

<void> TXTextControl.getCanUndo(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

The callback function that receives the requested value.

errorCallback

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

Examples

The following example demonstrates TXTextControl.getCanUndo in a practical document-editing workflow. It gets a value indicating whether the user can undo the previous operation in a Text Control.

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

TXTextControl.getCanUndo(
    function(result) {
        if (result) {
            console.log("get can undo is available.");
        } else {
            console.warn("get can undo is not available in the current document state.");
        }
    },
    onTxError
);