DS Server

TableCollection Object

Object|Introduced in 28.0

Description

Contains all tables of a Text Control document or part of the document.

Syntax

TableCollection

Examples

The following example demonstrates TableCollection in a practical document-editing workflow. It contains all tables of a Text Control document or part of the document.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const tables = mainText.tables;
    tables.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
    );
}, onTxError);

Members

Methods

MethodDescription
addAdds a table at the current input position.
getCanAddGets a value indicating whether a new table can be inserted at the current input position.
getGridLinesGets a value indicating whether table's gridlines are shown or not.
getItemGets the table at the current input position or the first table in the collection with the given id.
getItemGets the first table in the collection with the given id. (Inherited from TableBaseCollection.)
removeAtInputPositionRemoves the table at the current input position. (Inherited from TableBaseCollection.)
removeByIdRemoves the first table with the passed id. (Inherited from TableBaseCollection.)
setGridLinesSets a value indicating wether table grid lines are shown or not.