TableOfContentsCollection Object
Description
Contains all tables of contents in a certain part of the document.
Syntax
TableOfContentsCollectionExamples
The following example demonstrates TableOfContentsCollection in a practical document-editing workflow. It contains all tables of contents in a certain part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTableOfContentsCollection(tableOfContentss) {
tableOfContentss.getItem(
function(toc) {
if (!toc) {
console.warn("No table of contents was returned.");
return;
}
console.log("get item result:", toc);
},
onTxError,
25
);
}Members
Methods
| Method | Description |
|---|---|
| add | Adds a new table of contents to the document at the current text input position. |
| 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.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets the table of contents at the current input position or the table of contents with the specified identifier. |
| getItemByName | Gets the table of contents with the specified name. |
| remove | Removes a table of contents from the collection including all its text and including all DocumentTargets to where the table's links point. |