Javascript: TableOfContents.setMinimumStructureLevel Method
Description
Sets the minimum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10.
Syntax
<void> TableOfContents.setMinimumStructureLevel(<number> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| value | The property value. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TableOfContents.setMinimumStructureLevel in a practical document-editing workflow. It sets the minimum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function configureMinimumStructureLevel(tableOfContents) {
tableOfContents.setMinimumStructureLevel(
1,
function() {
console.log("set minimum structure level completed.");
},
onTxError
);
}