TX Text Control .NET Server

Javascript: TextPart.removeSubTextPart Method

MethodDeprecated|Introduced in 26.0

Description

Obsolete. This method will be removed in one of the next versions. Removes a SubTextPart from the TextPart.

Syntax

<void> TextPart.removeSubTextPart(<function> callback, [<boolean> keepText], [<boolean> keepNested], [<SubTextPartInfo> subTextPart])

Parameters

ParameterDescription
callback

A function with one parameter. Is called with a boolean value as parameter, which indicates whether the SubTextPart was succesfully removed, as soon as the information has been retrieved from the server.

keepText

Optional. If this parameter is set to true, the subtextpart is removed without deleting its visible text. Otherwise, the visible text is also removed.

keepNested

Optional. If this parameter is set to true, nested subtextparts are preserved. When the keepText parameter is set to false, this parameter is ignored.

subTextPart

Optional. Specifies which SubTextPart should removed from the TextPart. If this parameter is undefined then the SubTextPart at the current input position will be removed.

Examples

The following example demonstrates TextPart.removeSubTextPart in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Removes a SubTextPart from the TextPart.

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

function removeSubTextPart(subTextPart) {
    TXTextControl.textParts.getMainText(function(textPart) {
        textPart.removeSubTextPart(
            function() {
                console.log("remove sub text part completed.");
            },
            true,
            true,
            subTextPart
        );
    }, onTxError);
}