TX Text Control .NET Server

Javascript: TableRowCollection.getItem Method

Method|Introduced in 28.0

Description

Gets the table row at the current input position or the table row with the specified number.

Syntax

<void> TableRowCollection.getItem(<RequestTableRowCallback> callback, [<ErrorCallback> errorCallback], [<number> row])

Parameters

ParameterDescription
callback

Receives the table row.

errorCallback

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

row

Optional. The 1-based row index.

Examples

The following example demonstrates TableRowCollection.getItem in a practical document-editing workflow. It gets the table row at the current input position or the table row with the specified number.

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

function inspectItem(tableRows) {
    tableRows.getItem(
        function(row) {
            if (!row) {
                console.warn("No table row was returned.");
                return;
            }
            
            console.log("get item result:", row);
        },
        onTxError,
        3
    );
}