TX Text Control .NET Server

Javascript: Selection.isCommonSelectionValueSelected Method

Method|Introduced in 24.0

Description

Informs about whether an attribute from the Selection.Attribute enumeration has the same value for the complete selection.

Syntax

<void> Selection.isCommonSelectionValueSelected(<Selection.Attribute> selectionAttribute, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
selectionAttribute

Specifies a possible value from the enumeration.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Selection.isCommonSelectionValueSelected in a practical document-editing workflow. Informs about whether an attribute from the Selection.Attribute enumeration has the same value for the complete selection.

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

function isCommonSelectionValueSelected(selectionAttribute) {
    TXTextControl.selection.isCommonSelectionValueSelected(
        selectionAttribute,
        function() {
            console.log("is common selection value selected completed.");
        },
        onTxError
    );
}

Further Reading

  • Format Painter in ASP.NET Core: Building Custom Text Formatting with TX Text Control –