DS Server

Javascript: Footnote.scrollTo Method

Method|Introduced in 32.0

Description

Scrolls the beginning of the footnote mark into the visible part of the document using a default position depending on the previous position.

Syntax

<void> Footnote.scrollTo([<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Footnote.scrollTo in a practical document-editing workflow. It scrolls the beginning of the footnote mark into the visible part of the document using a default position depending on the previous position.

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

TXTextControl.footnotes.elementAt(0, function(footnote) {
    if (!footnote) {
        console.warn("No footnote is available.");
        return;
    }

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