DS Server

Javascript: SectionFormat.getBreakKind Method

Method|Introduced in 26.0

Description

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

Syntax

<void> SectionFormat.getBreakKind(<RequestSectionBreakKindCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the kind of section break.

errorCallback

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

Examples

The following example demonstrates SectionFormat.getBreakKind in a practical document-editing workflow. It gets 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 inspectBreakKind(sectionFormat) {
    sectionFormat.getBreakKind(
        function(breakKind) {
            if (!breakKind) {
                console.warn("No section break kind was returned.");
                return;
            }
            
            console.log("get break kind result:", breakKind);
        },
        onTxError
    );
}