DS Server

Javascript: TextPart.getSubTextParts Method

MethodDeprecated|Introduced in 25.0

Description

Obsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

Syntax

<void> TextPart.getSubTextParts(<function> callback, [<boolean> atInputPosition])

Parameters

ParameterDescription
callback

A function with one parameter. Is called with an array of subtextparts as a parameter containing the requested text fields as soon as the information has been retrieved from the server.

atInputPosition

Optional. A boolean value indicating that only the SubTextPart containing the input position should be retrieved. If there is no subtextpart at the input position, an empty array is received.

Examples

The following example demonstrates TextPart.getSubTextParts in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

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

TXTextControl.textParts.getMainText(function(textPart) {
    textPart.getSubTextParts(
        function() {
            console.log("get sub text parts completed.");
        },
        true
    );
}, onTxError);