Javascript: Table.getCanSplitCells Method
Description
Checks whether previously merged table cells in this table can be split. Only selected table cells can be split.
Syntax
<void> Table.getCanSplitCells(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives whether the selected cells can be split. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Table.getCanSplitCells in a practical document-editing workflow. It checks whether previously merged table cells in this table can be split. Only selected table cells can be split.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const tables = mainText.tables;
tables.getItem(function(table) {
if (!table) {
console.warn("No table is available at the current input position.");
return;
}
table.getCanSplitCells(
function(result) {
if (result) {
console.log("get can split cells is available.");
} else {
console.warn("get can split cells is not available in the current document state.");
}
},
onTxError
);
}, onTxError);
}, onTxError);