DS Server

Javascript: ParagraphFormat.getTabTypes Method

Method|Introduced in 26.0

Description

Gets the tab types in a paragraph.

Syntax

<void> ParagraphFormat.getTabTypes(<RequestTabTypesCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the tab types in a paragraph.

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.getTabTypes in a practical document-editing workflow. It gets the tab types in a paragraph.

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

TXTextControl.paragraphFormat.getTabTypes(
    function(section) {
        if (!section) {
            console.warn("No section was returned.");
            return;
        }
        
        console.log("get tab types result:", section);
    },
    onTxError
);

Remarks

The default type is TabType.LeftTab. The property returns an array with common values when the text selection contains multiple paragraphs with mixed types. The remaining not common values are set to zero. If all values are different, the Selection.IsCommonValueSelected method returns false.