EventStore
A store holding all the events to be rendered into a Scheduler.
This store only accepts a model class inheriting from EventModel.
An EventStore is usually connected to a project, which binds it to other related stores (AssignmentStore, ResourceStore and DependencyStore). The project also handles normalization/calculation of the data on the records in the store. For example if a record is added with a startDate and an endDate, it will calculate the duration.
The calculations happens async, records are not guaranteed to have up to date data until they are finished. To be certain that calculations have finished, call await project.commitAsync() after store actions. Or use one of the xxAsync functions, such as loadDataAsync().
Using commitAsync():
eventStore.data = [{ startDate, endDate }, ...];
// duration of the record is not yet calculated
await eventStore.project.commitAsync();
// now it is
Using loadDataAsync():
await eventStore.loadDataAsync([{ startDate, endDate }, ...]);
// duration is calculated
Using recurring events
When recurring events are in the database, all recurring event definitions which started before the requested start date, and have not yet finished recurring MUST be loaded into the EventStore.
Only the base recurring event definitions are stored in the EventStore. You do not need to calculate the future occurrence dates of these events. This is all handled by the EventStore.
When asked to yield a set of events for a certain date range for creating a UI through getEvents, the EventStore automatically interpolates any occurrences of recurring events into the results. They do not occupy slots in the EventStore for every date in their repetition range (that would be very inefficient, and might be infinite).
See also
- EventModel - Event data model
- ResourceStore - Resource store
- AssignmentStore - Assignment store
- Scheduler - Scheduler widget
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Class used to represent records
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of EventStore class, or subclass thereof.
-
Identifies an object as an instance of EventStore class, or subclass thereof.