Back to Devexpress

Collection<T> Class

aspnetcore-js-devexpress-dot-richedit-dot-collection-1.md

latest2.0 KB
Original Source

Collection<T> Class

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

Declaration

ts
export abstract class Collection<T>

Type Parameters

NameDescription
T

The type of items.

|

Inheritance

Collection<T> FontCollection

ParagraphCollection

BookmarkCollection<TBookmark>

RangePermissionCollection

FieldCollection

HyperlinkCollection

SubDocumentCollection<T>

SectionCollection

ListCollection

Properties

count Property

Gets the number of items contained in the collection.

Declaration

ts
get count(): number

Property Value

TypeDescription
number

The number of items.

|

Methods

getByIndex(index) Method

Gets an item with the specified index.

Declaration

ts
getByIndex(
    index: number
): T | null

Parameters

NameTypeDescription
indexnumber

The index of an item in the collection.

|

Returns

TypeDescription
T

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

|

Remarks

javascript
// 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);