TableRowCollection Object
Description
Contains all rows of a table in a Text Control document.
Syntax
TableRowCollectionExamples
The following example demonstrates TableRowCollection in a practical document-editing workflow. It contains all rows of a table in a Text Control document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTableRowCollection(tableRows) {
tableRows.getCanAdd(
function(result) {
if (result) {
console.log("get can add is available.");
} else {
console.warn("get can add is not available in the current document state.");
}
},
onTxError
);
}Members
Methods
| Method | Description |
|---|---|
| add | Adds a count of rows before or after the first or last selected row. |
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCanAdd | Gets a value indicating whether a new row can be inserted at the current input position. |
| getCanRemove | Gets a value indicating whether the selected rows can be removed. Rows can be removed, if either the current text input position is in a row, or if a part of a table is selected. |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets the table row at the current input position or the table row with the specified number. |
| remove | Removes the table row at the current text input position or all selected rows when a text selection exists. |