TX Text Control .NET Server

Javascript: Collection.getCount Method

Method|Introduced in 28.0

Description

Gets the number of elements contained in the collection.

Syntax

<void> Collection.getCount(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the result as a parameter.

errorCallback

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

Examples

The following example demonstrates Collection.getCount in a practical document-editing workflow. It gets the number of elements contained in the collection.

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

function inspectCount(s) {
    s.getCount(
        function(result) {
            console.log("get count result:", result);
        },
        onTxError
    );
}