DS Server

Javascript: TableColumnCollection.add Method

Method|Introduced in 28.0

Description

Adds a new table column at the current text input position.

Syntax

<void> TableColumnCollection.add(<TableAddPosition> tableAddPosition, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
tableAddPosition

Specifies where to add the column in the collection.

callback

Optional. Receives whether the table could added.

errorCallback

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

Examples

The following example demonstrates TableColumnCollection.add in a practical document-editing workflow. It adds a new table column at the current text input position.

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

function add(tableColumns) {
    tableColumns.add(
        TXTextControl.TableAddPosition.After,
        function(result) {
            if (result) {
                console.log("add is available.");
            } else {
                console.warn("add is not available in the current document state.");
            }
        },
        onTxError
    );
}