Skip to main content
All docs
V26.1
  • SubDocumentCollection<T> Class

    A collection of SubDocument objects.

    Declaration

    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

    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

    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

    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.