DS Server

TextPartCollection Object

Object|Introduced in 28.0

Description

Contains all text parts in a TX Text Control document.

Syntax

TextPartCollection

Examples

The following example demonstrates TextPartCollection in a practical document-editing workflow. It contains all text parts in a TX Text Control document.

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

TXTextControl.textParts.getItem(
    function(subTextPart) {
        if (!subTextPart) {
            console.warn("No sub text part was returned.");
            return;
        }
        
        console.log("get item result:", subTextPart);
    },
    onTxError
);

Members

Methods

MethodDescription
activateSets the input focus to the specified text part. If the activated text part is not in the visible part of the document, the document is scrolled.
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets the text part with the input focus.
getMainTextGets the main text part of the document.