TX Text Control .NET Server

Javascript: TrackedChange.getChangeKind Method

Method|Introduced in 28.0

Description

Gets the kind of change.

Syntax

<void> TrackedChange.getChangeKind(<RequestChangeKindCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the kind of change.

errorCallback

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

Examples

The following example demonstrates TrackedChange.getChangeKind in a practical document-editing workflow. It gets the kind of 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.getChangeKind(
            function(changeKind) {
                if (!changeKind) {
                    console.warn("No change kind was returned.");
                    return;
                }
                
                console.log("get change kind result:", changeKind);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);