TX Text Control .NET Server

Javascript: TXTextControl.setSelectObjects Method

Method|Introduced in 28.0

Description

Sets a value controlling the selection of objects which are inserted behind the text. When the property is set to true, a mouse click selects the object behind the text. Otherwise, when this property is set to false, text in front of the object can be selected.

Syntax

<void> TXTextControl.setSelectObjects(<boolean> selectObjects, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
selectObjects

Specifies whether the option is active.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates TXTextControl.setSelectObjects in a practical document-editing workflow. It sets a value controlling the selection of objects which are inserted behind the text. When the property is set to true, a mouse click selects the object behind the text. Otherwise, when this property is set to false, text in front of the object can be selected.

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

TXTextControl.setSelectObjects(
    true,
    function() {
        console.log("set select objects completed.");
    },
    onTxError
);