DS Server

Javascript: TXTextControl.getAllowDrag Method

Method|Introduced in 32.0

Description

Gets a value indicating whether the view generator can be a source of a Drag&Drop operation.

Syntax

<void> TXTextControl.getAllowDrag(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

The callback function that receives the requested value.

errorCallback

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

Examples

The following example demonstrates TXTextControl.getAllowDrag in a practical document-editing workflow. It gets a value indicating whether the view generator can be a source of a Drag&Drop operation.

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

TXTextControl.getAllowDrag(
    function(result) {
        if (result) {
            console.log("get allow drag is available.");
        } else {
            console.warn("get allow drag is not available in the current document state.");
        }
    },
    onTxError
);