Javascript: SubTextPart.getData Method
Description
Gets additional data of the subtextpart.
Syntax
<void> SubTextPart.getData(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the additional data of the subtextpart. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates SubTextPart.getData in a practical document-editing workflow. It gets additional data of the subtextpart.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const subTextParts = mainText.subTextParts;
subTextParts.getItem(function(subTextPart) {
if (!subTextPart) {
console.warn("No sub text part is available at the current input position.");
return;
}
subTextPart.getData(
function(result) {
console.log("get data result:", result);
},
onTxError
);
}, onTxError);
}, onTxError);