TX Text Control .NET Server

Javascript: TrackedChangeCollection.remove Method

Method|Introduced in 28.0

Description

Removes a tracked change from the collection. Depending on the accept parameter the change is either accepted or rejected. When a change is rejected, inserted text is removed and deleted text is reinserted.

Syntax

<void> TrackedChangeCollection.remove(<TrackedChange> trackedChange, <boolean> accept, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
trackedChange

The removing tracked change.

accept

Specifies the tracked change to remove.

callback

Optional. Receives as parameter whether the change could be removed.

errorCallback

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

Examples

The following example resolves the tracked change at the input position and accepts it.

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

TXTextControl.textParts.getMainText(function(mainText) {
    mainText.trackedChanges.getItem(function(change) {
        if (!change) {
            console.warn("Place the input position in a tracked change.");
            return;
        }

        mainText.trackedChanges.remove(change, true, function(removed) {
            console.log("Tracked change accepted:", removed);
        }, onTxError);
    }, onTxError);
}, onTxError);

Further Reading

  • Track Changes: Show 'Original' and 'No Markup' –