DS Server

Javascript: FootnoteCollection.remove Method

Method|Introduced in 32.0

Description

Removes a footnote from a Text Control document.

Syntax

<void> FootnoteCollection.remove(<Footnote> footnote, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
footnote

Specifies the footnote to remove.

callback

Optional. Receives true, if the footnote could be removed and false otherwise.

errorCallback

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

Examples

The following example demonstrates FootnoteCollection.remove in a practical document-editing workflow. It removes a footnote from a Text Control document.

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

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