TX Text Control .NET Server

AddSubTextPartCallback Function

Function

Description

Callback function for functions which add a subtextpart.

Syntax

function(<SubTextPartCallbackData> response, <SubTextPartCollection.AddResult> addResult)

Examples

The following example demonstrates AddSubTextPartCallback in a practical document-editing workflow. Callback function for functions which add a subtextpart.

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

function addSubTextPartCallback(response, addResult) {
    console.log("Callback values:", { response, addResult });
}

TXTextControl.textParts.getMainText(function(mainText) {
    const subTextParts = mainText.subTextParts;
    subTextParts.add("InvoiceAddress", 25, 1, 5, addSubTextPartCallback, onTxError);
}, onTxError);