Table Of Contents
RecycleView Data Model¶
New in version 1.10.0.
The data model part of the RecycleView model-view-controller pattern.
It defines the models (classes) that store the data associated with a
RecycleViewBehavior. Each model (class)
determines how the data is stored and emits requests to the controller
RecycleViewBehavior) when the data is
Fired when the data changes. The event may dispatch keyword arguments specific to each implementation of the data model. When dispatched, the event and keyword arguments are forwarded to
When data changes this class currently dispatches on_data_changed with one of the following additional keyword arguments.
- none: no keyword argument
- With no additional argument it means a generic data change.
- removed: a slice or integer
- The value is a slice or integer indicating the indices removed.
- appended: a slice
- The slice in
dataindicating the first and last new items (i.e. the slice pointing to the new items added at the end).
- inserted: a integer
- The index in
datawhere a new data item was inserted.
- modified: a slice
- The slice with the indices where the data has been modified. This currently does not allow changing of size etc.
Stores the model’s data using a list.
The data for a item at index i can also be accessed with
A dictionary instance, which when modified will trigger a data and consequently an on_data_changed dispatch.