Javascript: TXTextControl.getAllowUndo Method
Description
Gets a value indicating whether the undo buffer is active or not.
Syntax
<void> TXTextControl.getAllowUndo(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| 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.getAllowUndo in a practical document-editing workflow. It gets a value indicating whether the undo buffer is active or not.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.getAllowUndo(
function(result) {
if (result) {
console.log("get allow undo is available.");
} else {
console.warn("get allow undo is not available in the current document state.");
}
},
onTxError
);