TX Text Control .NET Server

Javascript: TableOfContents.getHasLinks Method

Method|Introduced in 29.0

Description

Gets value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.

Syntax

<void> TableOfContents.getHasLinks(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the property value.

errorCallback

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

Examples

The following example demonstrates TableOfContents.getHasLinks in a practical document-editing workflow. It gets value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.

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

function inspectHasLinks(tableOfContents) {
    tableOfContents.getHasLinks(
        function(result) {
            if (result) {
                console.log("get has links is available.");
            } else {
                console.warn("get has links is not available in the current document state.");
            }
        },
        onTxError
    );
}