Javascript: TXTextControl.HighlightMode Enumeration
Description
Contains all possible highlight mode values.
Members
| Member | Description |
|---|---|
| Never | The element is never highlighted. |
| Activated | The element is only highlighted, when it contains the current text input position and when the control has the input focus. |
| Always | The element is always highlighted. |
| Auto | The element's highlight mode is governed by the global highlight mode property. |
Examples
The following example uses TXTextControl.HighlightMode.Always (the element is always highlighted.) in a document-editing workflow.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const comments = mainText.comments;
comments.getItem(function(commentedText) {
if (!commentedText) {
console.warn("No commented text is available at the current input position.");
return;
}
commentedText.setHighlightMode(
TXTextControl.HighlightMode.Always,
function() {
console.log("set highlight mode completed.");
},
onTxError
);
}, onTxError);
}, onTxError);