DS Server

Javascript: TableRowCollection.remove Method

Method|Introduced in 28.0

Description

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

Syntax

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

Parameters

ParameterDescription
callback

Optional. Receives whether the row could removed.

errorCallback

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

Examples

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

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

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