TX Text Control .NET Server

Javascript: TableCell.getFormula Method

Method|Introduced in 28.0

Description

Gets the table cell's formula. For each table cell a formula can be defined which is used to calculate the cell's text. The formula can contain references to other table cells in the same table. When the text of a referenced cell changes, the cell which references it is automatically updated.

Syntax

<void> TableCell.getFormula(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the cell's formula.

errorCallback

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

Examples

The following example demonstrates TableCell.getFormula in a practical document-editing workflow. It gets the table cell's formula. For each table cell a formula can be defined which is used to calculate the cell's text. The formula can contain references to other table cells in the same table. When the text of a referenced cell changes, the cell which references it is automatically updated.

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

function inspectFormula(tableCell) {
    tableCell.getFormula(
        function(result) {
            console.log("get formula result:", result);
        },
        onTxError
    );
}