DS Server

Javascript: TableColumnCollection.getCanRemove Method

Method|Introduced in 28.0

Description

Gets a value indicating whether the selected columns can be removed. Columns can be removed, if either the current text input position is in a column, or if a part of a table is selected.

Syntax

<void> TableColumnCollection.getCanRemove([<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Receives whether the selected columns can be removed.

errorCallback

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

Examples

The following example demonstrates TableColumnCollection.getCanRemove in a practical document-editing workflow. It gets a value indicating whether the selected columns can be removed. Columns can be removed, if either the current text input position is in a column, or if a part of a table is selected.

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

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