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

SubDocumentCollection<T> Class

A collection of SubDocument objects.

#Declaration

TypeScript
export class SubDocumentCollection<T extends SubDocument> extends Collection<T>

#Type Parameters

Name Type Description
T SubDocument

The type of sub-documents in the collection.

#Inherited Members

#Inheritance

#Properties

#main Property

Returns the main sub-document.

#Declaration

TypeScript
get main(): T

#Property Value

Type Description
T

The main sub-document.

#Remarks

Tip

You can access the main sub-document’s properties directly at the document level.

var mainSubDocumentLength = richEdit.document.length;
// or 
var mainSubDocumentLength = richEdit.document.subDocuments.main.length; 
See Also

#Methods

#forEach(callback) Method

Performs the specified action on each element of the current sub-document collection.

#Declaration

TypeScript
forEach(
    callback: (subDocument: T) => void
): void

#Parameters

Name Type Description
callback (subDocument: T) => void

The action to perform on each element of the collection.

#getById(id) Method

Gets a sub-document with the specified ID.

#Declaration

TypeScript
getById(
    id: number
): T

#Parameters

Name Type Description
id number

The sub-document identifier.

#Returns

Type Description
T

A sub-document with the specified identifier.