Javascript: TXTextControl.setViewMode Method
Description
Sets the mode how Text Control displays a document.
Syntax
<void> TXTextControl.setViewMode(<ViewMode> viewMode, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| viewMode | The mode how Text Control displays a document. |
| 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.setViewMode in a practical document-editing workflow. It sets the mode how Text Control displays a document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.setViewMode(
TXTextControl.ViewMode.PageView,
function() {
console.log("set view mode completed.");
},
onTxError
);