Constructs a new CollectionViewDataSource with initial rows.
The initial rows to load.
Private
defaultDefault style key for error rows.
Unique ID for this data source instance.
Private
onList of callbacks to notify when the data source changes.
Private
pendingList of pending changes to be applied.
Private
rowsArray to maintain the rows directly.
Private
rowsMap of rows by ID for efficient access.
Private
rowMap to track the version of each row.
Private
styleInjected style registry for resolving row styles.
Private
viewInjected view manager for error reporting.
Appends items to a row by row ID.
The ID of the row.
The items to append.
Whether to apply the change immediately.
Appends rows to the data source at the specified index.
The rows to append.
Optional
index: numberThe index to insert at (optional).
Whether to apply the change immediately.
Private
applyApplies the default error style to a row if style resolution fails.
The row to apply the error style to.
Applies all pending updates and notifies registered callbacks.
Changes the enabled state of a row.
The ID of the row.
Whether the row should be enabled.
Whether to apply the change immediately.
Changes the visibility of a row.
The ID of the row.
Whether the row should be visible.
Whether to apply the change immediately.
Clears all rows from the data source.
Whether to apply the change immediately.
Gets a row by its index.
The index of the row.
The row at the specified index.
Gets a row by its unique ID.
The ID of the row.
The row with the specified ID, or undefined if not found.
Gets all rows in the data source.
The array of rows.
Private
incrementIncrements the version number for a row.
The ID of the row.
Private
loadLoads initial data into the data source.
The rows to load.
Marks a row as invalid, triggering a change event.
The ID of the row.
Whether to apply the change immediately.
Moves a row to a new index in the data source.
The ID of the row to move.
The new index to move the row to.
Whether to apply the change immediately.
Registers a callback to be called when the data source changes.
The callback function.
Removes items from a row by row ID and item index range.
The ID of the row.
The start index of items to remove.
The end index of items to remove.
Whether to apply the change immediately.
Removes a row from the data source by ID.
The ID of the row to remove.
Whether to apply the change immediately.
Private
reportReports an error to the view manager.
The error message.
The type of error.
Sets an error object for the data source (not implemented).
The debug error object.
Sets the initial data for the data source, clearing any existing rows.
The rows to set as initial data.
Private
triggerTriggers a change event and optionally applies updates immediately.
The change event to trigger.
Whether to apply the change immediately.
Updates an item in a row by row ID and item index.
The ID of the row.
The index of the item to update.
The new item to set.
Whether to apply the change immediately.
CollectionViewDataSource manages the data for a collection view. Handles row and item management, change tracking, and notifies listeners of data changes.