DS Server

Javascript: FormattedText.selection Property

Property|Introduced in 28.0

Description

Gets the current selection.

Syntax

<Selection> FormattedText.selection

Examples

The following example demonstrates FormattedText.selection in a practical document-editing workflow. It gets the current selection.

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

TXTextControl.textParts.getMainText(function(formattedText) {
    const selection = formattedText.selection;
    console.log("selection:", selection);
}, onTxError);

Limitations

Read Only.