DS Server

Javascript: TableCellCollection.remove Method

Method|Introduced in 28.0

Description

Removes the table cell at the current text input position or all selected table cells when a text selection exists.

Syntax

<void> TableCellCollection.remove([<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Receives whether the cell could removed.

errorCallback

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

Examples

The following example demonstrates TableCellCollection.remove in a practical document-editing workflow. It removes the table cell at the current text input position or all selected table cells when a text selection exists.

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

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