DS Server

TableColumnCollection Object

Object|Introduced in 28.0

Description

Contains all columns of a table in a Text Control document

Syntax

TableColumnCollection

Examples

The following example demonstrates TableColumnCollection in a practical document-editing workflow. It contains all columns of a table in a Text Control document.

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

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

Members

Methods

MethodDescription
addAdds a new table column at the current text input position.
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCanAddGets a value indicating whether a new column can be inserted at the current input position.
getCanRemoveGets 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.
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets the table column with the specified index or the column at the current input position.
removeRemoves the table column at the current text input position or all selected columns when a text selection exists.