hosanna-ui-docs - v0.9.0
    Preparing search index...

    CollectionViewDataSource manages the data for a collection view. Handles row and item management, change tracking, and notifies listeners of data changes.

    Index

    Constructors

    Properties

    defaultErrorRowStyle: string = 'rows.regularError'

    Default style key for error rows.

    id: string = ...

    Unique ID for this data source instance.

    onChangeCallbacks: ((change: IDataSourceChange[]) => void)[] = []

    List of callbacks to notify when the data source changes.

    pendingChanges: IDataSourceChange[] = []

    List of pending changes to be applied.

    Array to maintain the rows directly.

    rowsById: Map<string, ICollectionViewDataSourceRow<any, IIdentifiable>>

    Map of rows by ID for efficient access.

    rowVersions: Map<string, number> = ...

    Map to track the version of each row.

    Injected style registry for resolving row styles.

    Injected view manager for error reporting.

    Methods

    • Appends items to a row by row ID.

      Parameters

      • rowId: string

        The ID of the row.

      • items: any[]

        The items to append.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Changes the enabled state of a row.

      Parameters

      • rowId: string

        The ID of the row.

      • isEnabled: boolean

        Whether the row should be enabled.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Changes the visibility of a row.

      Parameters

      • rowId: string

        The ID of the row.

      • isHidden: boolean

        Whether the row should be visible.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Marks a row as invalid, triggering a change event.

      Parameters

      • rowId: string

        The ID of the row.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Moves a row to a new index in the data source.

      Parameters

      • rowId: string

        The ID of the row to move.

      • newIndex: number

        The new index to move the row to.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Removes items from a row by row ID and item index range.

      Parameters

      • rowId: string

        The ID of the row.

      • startIndex: number

        The start index of items to remove.

      • endIndex: number

        The end index of items to remove.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void

    • Updates an item in a row by row ID and item index.

      Parameters

      • rowId: string

        The ID of the row.

      • itemIndex: number

        The index of the item to update.

      • newItem: IIdentifiable

        The new item to set.

      • applyNow: boolean = false

        Whether to apply the change immediately.

      Returns void