Javascript: TableOfContents.getNumber Method
Description
Gets the number of the table of contents in the text. The first table of contents has the number 1. The number is defined through the textflow. A table of contents with a smaller start position has a smaller number.
Syntax
<void> TableOfContents.getNumber(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TableOfContents.getNumber in a practical document-editing workflow. It gets the number of the table of contents in the text. The first table of contents has the number 1. The number is defined through the textflow. A table of contents with a smaller start position has a smaller number.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectNumber(tableOfContents) {
tableOfContents.getNumber(
function(result) {
console.log("get number result:", result);
},
onTxError
);
}