TX Text Control .NET Server

Javascript: MisspelledWordCollection.getItemAtLocation Method

Method|Introduced in 28.0

Description

Gets the misspelled word at a certain geometrical location. If there is no misspelled word, null is returned.

Syntax

<void> MisspelledWordCollection.getItemAtLocation(<number> x, <number> y, <RequestMisspelledWordCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
x

Horizontal location.

y

Vertical location.

callback

Receives the misspelled word.

errorCallback

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

Examples

The following example demonstrates MisspelledWordCollection.getItemAtLocation in a practical document-editing workflow. It gets the misspelled word at a certain geometrical location. If there is no misspelled word, null is returned.

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

function inspectItemAtLocation(misspelledWords) {
    misspelledWords.getItemAtLocation(
        1,
        1,
        function(result) {
            if (!result) {
                console.warn("No misspelled word was returned.");
                return;
            }
            
            console.log("get item at location result:", result);
        },
        onTxError
    );
}