Javascript: ParagraphStyle.setFollowingStyle Method
Description
Sets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key.
Syntax
<void> ParagraphStyle.setFollowingStyle(<String> styleName, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| styleName | Specifies the name of the style that TextControl automatically selects for the following paragraph after the user has pressed the ENTER key. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates ParagraphStyle.setFollowingStyle in a practical document-editing workflow. It sets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function configureFollowingStyle(paragraphStyle) {
paragraphStyle.setFollowingStyle(
"Heading 1",
function() {
console.log("set following style completed.");
},
onTxError
);
}