TX Text Control .NET Server

Javascript: Table.getOuterTable Method

Method|Introduced in 28.0

Description

Gets table's outer table.

Syntax

<void> Table.getOuterTable(<RequestTableCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the outer table as parameter.

errorCallback

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

Examples

The following example demonstrates Table.getOuterTable in a practical document-editing workflow. It gets table's outer table.

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

TXTextControl.textParts.getMainText(function(mainText) {
    const tables = mainText.tables;
    tables.getItem(function(table) {
        if (!table) {
            console.warn("No table is available at the current input position.");
            return;
        }
    
        table.getOuterTable(
            function(table) {
                if (!table) {
                    console.warn("No table was returned.");
                    return;
                }
                
                console.log("get outer table result:", table);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);