DS Server

Javascript: TrackedChange.getHighlightColor Method

Method|Introduced in 28.0

Description

Gets the highlight color for the tracked change.

Syntax

<void> TrackedChange.getHighlightColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the highlight color for the tracked change.

errorCallback

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

Examples

The following example demonstrates TrackedChange.getHighlightColor in a practical document-editing workflow. It gets the highlight color for the tracked change.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const trackedChanges = mainText.trackedChanges;
    trackedChanges.getItem(function(trackedChange) {
        if (!trackedChange) {
            console.warn("No tracked change is available at the current input position.");
            return;
        }
    
        trackedChange.getHighlightColor(
            function(result) {
                console.log("get highlight color result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);