DS Server

TableRowCollection Object

Object|Introduced in 28.0

Description

Contains all rows of a table in a Text Control document.

Syntax

TableRowCollection

Examples

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

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

function inspectTableRowCollection(tableRows) {
    tableRows.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 count of rows before or after the first or last selected row.
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 row can be inserted at the current input position.
getCanRemoveGets a value indicating whether the selected rows can be removed. Rows can be removed, if either the current text input position is in a row, or if a part of a table is selected.
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets the table row at the current input position or the table row with the specified number.
removeRemoves the table row at the current text input position or all selected rows when a text selection exists.