TX Text Control .NET Server

Javascript: TextField.setEditable Method

Method|Introduced in 28.0

Description

Sets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.

Syntax

<void> TextField.setEditable(<boolean> editable, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
editable

Specifies whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates TextField.setEditable in a practical document-editing workflow. It sets whether the text of a text field can be changed by the end-user while a TX Text Control document is being edited.

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

function configureEditable(textField) {
    textField.setEditable(
        true,
        function() {
            console.log("set editable completed.");
        },
        onTxError
    );
}