TX Text Control .NET Server

Javascript: TXTextControl.getViewMode Method

Method|Introduced in 28.0

Description

Gets the mode how Text Control displays a document.

Syntax

<void> TXTextControl.getViewMode(<RequestViewModeCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the mode how Text Control displays a document.

errorCallback

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

Examples

The following example demonstrates TXTextControl.getViewMode in a practical document-editing workflow. It gets the mode how Text Control displays a document.

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

TXTextControl.getViewMode(
    function(viewMode) {
        if (!viewMode) {
            console.warn("No view mode was returned.");
            return;
        }
        
        console.log("get view mode result:", viewMode);
    },
    onTxError
);