Javascript: TableCellCollection.getCanRemove Method
Description
Gets a value indicating whether table cells can be removed. Table cells can be removed, if either the current text input position is in a table, or if a part of a table is selected.
Syntax
<void> TableCellCollection.getCanRemove(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives whether the cells can be removed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TableCellCollection.getCanRemove in a practical document-editing workflow. It gets a value indicating whether table cells can be removed. Table cells can be removed, if either the current text input position is in a table, or if a part of a table is selected.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectCanRemove(tableCells) {
tableCells.getCanRemove(
function(result) {
if (result) {
console.log("get can remove is available.");
} else {
console.warn("get can remove is not available in the current document state.");
}
},
onTxError
);
}