DS Server

Javascript: Footnote.setID Method

Method|Introduced in 32.0

Description

Sets a user-defined identifier. It must be a one-based value. A value of zero indicates that the footnote has no identifier.

Syntax

<void> Footnote.setID(<number> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The property value.

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.setID in a practical document-editing workflow. It sets a user-defined identifier. It must be a one-based value. A value of zero indicates that the footnote has no identifier.

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.setID(
        1,
        function() {
            console.log("set id completed.");
        },
        onTxError
    );
}, onTxError);