Javascript: TrackedChange.getNumber Method
Description
Gets the change's number.
Syntax
<void> TrackedChange.getNumber(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives this change's number. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TrackedChange.getNumber in a practical document-editing workflow. It gets the change's number.
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.getNumber(
function(result) {
console.log("get number result:", result);
},
onTxError
);
}, onTxError);
}, onTxError);