v7.3.0

EventModelMixin
Mixin

Mixin that holds configuration shared between events in Scheduler and Scheduler Pro.

No results

Fields

Fields belong to a Model class and define the Model data structure
  • The unique identifier of a task (mandatory)

  • Id of the resource this event is associated with (only usable for single assignments). We recommend using assignments in an AssignmentStore over this approach. Internally any Event using resourceId will have an assignment in AssignmentStore generated.

  • Ids of the resources this event is associated with (can be used for multiple assignments). Any event using resourceIds will have assignments in AssignmentStore generated automatically. It only applies if is configured with persist: true.

      class CustomEventModel extends EventModel {
          static $name = 'CustomEventModel';
    
          static get fields() {
              return [
                  { name : 'resourceIds', persist : true }
              ];
          }
      };
    
      const
          resources   = [
              { id : 'r1', name : 'Celia' },
              { id : 'r2', name : 'Lee' },
              { id : 'r3', name : 'Macy' },
              { id : 'r4', name : 'Madison' }
          ],
          events      = [
              {
                  id          : 1,
                  resourceIds : ['r1', 'r2']
                  ...
              },
              {
                  id          : 2,
                  resourceIds : ['r3', 'r4']
                  ...
              }
          ];
    
      const scheduler = new Scheduler({
          ...
          eventStore : {
              modelClass : CustomEventModel,
              data       : events
          },
          ...
      });
    
  • The array of resources which are assigned to this event.

  • Specify false to prevent the event from being dragged (if EventDrag feature is used)

  • Specify false to prevent the event from being resized (if EventResize feature is used). You can also specify 'start' or 'end' to only allow resizing in one direction

  • A field marking event as all day(s) spanning event. For example, a holiday day may be represented by a startDate, and the allDay flag.

  • Controls the primary color of the event. For available standard colors, see EventColor.

  • eventStyle : 'plain'/'border'/'colored'/'hollow'/'line'+ 7 more

    Controls this events appearance, see Schedulers eventStyle config for available options.

  • Width (in px) to use for this milestone when using Scheduler#milestoneLayoutMode 'data'.

  • Set this field to false to opt out of sticky event content (keeping event text in view while scrolling).

Properties

Properties are getters/setters or publicly accessible variables on this class
  • persistableData : Object
    private
    READONLY

    Override persistable getter to prevent sending resourceId when using multiple resource assignment mode https://github.com/bryntum/support/issues/1345

  • Returns all assignments for the event. Event must be part of the store for this method to work.

  • Returns the first assigned resource, or assigns a resource

  • Returns all resources assigned to an event.

  • isEventModelMixin : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of EventModelMixin class, or subclass thereof.
  • Returns all predecessor dependencies of this event

  • Returns all successor dependencies of this event

  • isDraggable : Boolean
    READONLY

    Returns true if event can be drag and dropped

  • Returns false if the event is not persistable. By default it always is, override this getter if you need custom logic.

Functions

Functions are methods available for calling on the class
    • forEachResource( )
      private

      Iterate over all associated resources

    Type definitions

    Source path

    Scheduler/model/mixin/EventModelMixin.js

    Contents