Javascript: TXTextControl.getCanCopy Method
Description
Informs whether a part of a Text Control document has been selected and can be copied to the clipboard. The value depends on whether the formatting is allowed and the currently set edit mode.
Syntax
<void> TXTextControl.getCanCopy(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| 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.getCanCopy in a practical document-editing workflow. Informs whether a part of a Text Control document has been selected and can be copied to the clipboard. The value depends on whether the formatting is allowed and the currently set edit mode.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.getCanCopy(
function(result) {
if (result) {
console.log("get can copy is available.");
} else {
console.warn("get can copy is not available in the current document state.");
}
},
onTxError
);