TX Text Control .NET Server

Javascript: TableOfContents.update Method

Method|Introduced in 29.0

Description

Updates the content and the page numbers of the table of contents.

Syntax

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

Parameters

ParameterDescription
callback

Receives whether the call was succesful.

errorCallback

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

Examples

The following example demonstrates TableOfContents.update in a practical document-editing workflow. It updates the content and the page numbers of the table of contents.

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

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