Javascript: Selection.setUnderline Method
Description
Sets the underlining styles for the selected text.
Syntax
<void> Selection.setUnderline(<FontUnderlineStyle> underline, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| underline | The underlining styles for the selected text. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Selection.setUnderline in a practical document-editing workflow. It sets the underlining styles for the selected text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.selection.setUnderline(
TXTextControl.FontUnderlineStyle.Single,
function() {
console.log("set underline completed.");
},
onTxError
);