TX Text Control .NET Server

Javascript: SectionFormat.setBreakKind Method

Method|Introduced in 26.0

Description

Sets the kind of the section break the section starts with.

Syntax

<void> SectionFormat.setBreakKind(<SectionBreakKind> breakKind, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
breakKind

The kind of the section break the section starts with.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates SectionFormat.setBreakKind in a practical document-editing workflow. It sets the kind of the section break the section starts with.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function configureBreakKind(sectionFormat) {
    sectionFormat.setBreakKind(
        TXTextControl.SectionBreakKind.BeginAtNewLine,
        function() {
            console.log("set break kind completed.");
        },
        onTxError
    );
}