TX Text Control .NET Server

Javascript: TableBaseCollection.removeById Method

Method|Introduced in 28.0

Description

Removes the first table with the passed id.

Syntax

<void> TableBaseCollection.removeById(<number> id, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
id

The table's id.

callback

Optional. Receives whether the table could removed.

errorCallback

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

Examples

The following example demonstrates TableBaseCollection.removeById in a practical document-editing workflow. It removes the first table with the passed id.

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

function removeById(tableBases) {
    tableBases.removeById(
        25,
        function(result) {
            if (result) {
                console.log("remove by id is available.");
            } else {
                console.warn("remove by id is not available in the current document state.");
            }
        },
        onTxError
    );
}