Javascript: DocumentLinkCollection.remove Method
Description
Removes the link from the collection.
Syntax
<void> DocumentLinkCollection.remove(<DocumentLink> documentLink, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| documentLink | Specifies the link to remove. |
| callback | Optional. Receives whether the remove was succesful. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates DocumentLinkCollection.remove in a practical document-editing workflow. It removes the link from the collection.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function remove(documentLink) {
TXTextControl.textParts.getMainText(function(mainText) {
const documentLinks = mainText.documentLinks;
documentLinks.remove(
documentLink,
function(result) {
if (result) {
console.log("remove is available.");
} else {
console.warn("remove is not available in the current document state.");
}
},
onTxError
);
}, onTxError);
}