DS Server

Javascript: MisspelledWordCollection.getCountOf Method

Method|Introduced in 28.0

Description

Gets the number of misspelled words with a special meaning from the collection.

Syntax

<void> MisspelledWordCollection.getCountOf(<MisspelledWordKind> kind, <RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
kind

Specifies the word's kind.

callback

Receives the number of misspelled words with a special meaning from the collection.

errorCallback

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

Examples

The following example demonstrates MisspelledWordCollection.getCountOf in a practical document-editing workflow. It gets the number of misspelled words with a special meaning from the collection.

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

function inspectCountOf(misspelledWords) {
    misspelledWords.getCountOf(
        TXTextControl.MisspelledWordKind.All,
        function(result) {
            console.log("get count of result:", result);
        },
        onTxError
    );
}