Javascript: TXTextControl.setEditMode Method
Description
Sets a value indicating whether the document's text is protected, or can be freely edited and formatted.
Syntax
<void> TXTextControl.setEditMode(<EditMode> editMode, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| editMode | Specifies whether the document's text is protected, or can be freely edited and formatted. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TXTextControl.setEditMode in a practical document-editing workflow. It sets a value indicating whether the document's text is protected, or can be freely edited and formatted.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.setEditMode(
TXTextControl.EditMode.Edit,
function() {
console.log("set edit mode completed.");
},
onTxError
);