DS Server

TableCellCollection Object

Object|Introduced in 28.0

Description

Contains all cells of a table.

Syntax

TableCellCollection

Examples

The following example demonstrates TableCellCollection in a practical document-editing workflow. It contains all cells of a table.

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

function inspectTableCellCollection(tableCells) {
    tableCells.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
    );
}

Members

Methods

MethodDescription
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCanRemoveGets a value indicating whether table cells can be removed. Table cells can be removed, if either the current text input position is in a table, or if a part of a table is selected.
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets the cell with the specified row and column number.
getItemAtInputPositionGets table's cell at the current input position.
removeRemoves the table cell at the current text input position or all selected table cells when a text selection exists.