EventStoreMixin
Mixin
This is a mixin, containing functionality related to managing events.
It is consumed by the regular EventStore class and the Scheduler Pro's EventStore class.
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Configure with
trueto also remove the event when removing the last assignment from the linked AssignmentStore. This config has no effect when using EventStore in legacyresourceId-mode. -
Configure with
trueto force single-resource mode, an event can only be assigned to a single resource. If not provided, the mode will be inferred from- presence of an assignment store (i.e. multi-assignment)
- presence of
resourceIdin the event store data (i.e. single assignment mode)
-
CrudManager must load stores in the correct order. Lowest first.
-
CrudManager must sync stores in the correct order. Lowest first.
-
If set to
true, or a config object, this makes the store load new records when needed. When a record that is not already loaded is requested, the requestData function is called. Please read the guide to learn more on how to configure lazy loading.Parameters
- bufferUnit : DurationUnit
Used together with bufferAmount to calculate the start and end dates of each load request. The value is added to the current visible start or end date. Defaults to the visible time span length.
- bufferAmount : Number
See
bufferUnit - dateFormat : String
The format used to convert
startDateandendDateparameters passed to the load request querystring. Defaults toYYYY-MM-DD(e.g. 2024-03-11). Only used if a readUrl is configured on the store. See DateHelper for details about formatting dates. - loadFullResourceRange : Boolean
If the ResourceStore is not lazy loaded, set this to
trueto load events, assignments and/or resource time ranges for all resources with every load request. - useResourceIds : Boolean
Set to
trueto always provideresourceIdsin the request params, instead of a resourcestartIndexandcount
- bufferUnit : DurationUnit
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of EventStoreMixin class, or subclass thereof.
-
Identifies an object as an instance of EventStoreMixin class, or subclass thereof.
-
Class used to represent records. Defaults to class EventModel.
Functions
Functions are methods available for calling on the class-
In an EventStore or ResourceTimeRangeStore which is configured with lazyLoad, the function provided here is called when a combination of the visible date range and the visible range of resources has not yet been loaded. If the ResourceStore is not configured with lazyLoad, the resource range will include all the loaded resources. When implementing this, it is expected that what is returned is an object with a
dataproperty containing the records fromstartDatetoendDatefor a range of resources starting atstartIndexand with the length specified in thecountparam.Base implementation does nothing, either use AjaxStore which implements it, or create your own subclass with an implementation.
class MyEventStore extends EventStore { async requestData(params){ const response = await fetch('https://api.bryntum.com/events/?' + new URLSearchParams(params)); return await response.json(); } } -
unload( options )
Only available if the store is configured as lazyLoad.
The records matching the provided parameters will be removed from the Store and reloaded the next they are needed.
Provide an array of records or record ids, or provide a combination of resource records (or ids) and/or a date range. Do not combine the
recordsparams with theresourcesandstartDateandendDateparams.