Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Collection<T> Class

Serves as a base for classes maintaining a collection of items.

#Declaration

TypeScript
export abstract class Collection<T>

#Type Parameters

Name Description
T

The type of items.

#Properties

#count Property

Gets the number of items contained in the collection.

#Declaration

TypeScript
get count(): number

#Property Value

Type Description
number

The number of items.

#Methods

#getByIndex(index) Method

Gets an item with the specified index.

#Declaration

TypeScript
getByIndex(
    index: number
): T | null

#Parameters

Name Type Description
index number

The index of an item in the collection.

#Returns

Type Description
T

An object that is the item at the specified index. null if an item with the specified index is not found.

#Remarks

// Gets URLs of all hyperlinks in the main sub-document
var hyperlinks = richEdit.document.hyperlinks;
var hyperlinkUrls = [];
for(var i = 0, hyperlink; hyperlink = hyperlinks.getByIndex(i); i++)
    if (hyperlink.hyperlinkInfo.url)
        hyperlinkUrls.push(hyperlink.hyperlinkInfo.url);