v7.3.0
SupportExamplesFree Trial

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.

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Configure with true to also remove the event when removing the last assignment from the linked AssignmentStore. This config has no effect when using EventStore in legacy resourceId-mode.

  • Configure with true to force single-resource mode, an event can only be assigned to a single resource. If not provided, the mode will be inferred from

    1. presence of an assignment store (i.e. multi-assignment)
    2. presence of resourceId in the event store data (i.e. single assignment mode)
  • loadPriority : Number
    private

    CrudManager must load stores in the correct order. Lowest first.

  • syncPriority : Number
    private

    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 startDate and endDate parameters passed to the load request querystring. Defaults to YYYY-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 true to load events, assignments and/or resource time ranges for all resources with every load request.

    • useResourceIds : Boolean

      Set to true to always provide resourceIds in the request params, instead of a resource startIndex and count

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isEventStoreMixin : Booleantrue
    READONLY
    ADVANCED
    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
    • requestData( options )
      ASYNC

      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 data property containing the records from startDate to endDate for a range of resources starting at startIndex and with the length specified in the count param.

      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 records params with the resources and startDate and endDate params.

    Source path

    Scheduler/data/mixin/EventStoreMixin.js

    Contents