Calendar#

The calendar component is a type of segment component that can be used to create, view and edit event objects in M-Files. The configuration for the calendar has 5 options:

  • EventTypes: The main attraction of the Calendar, each EventType determines which objects should be displayed in the calendar as events.

  • Height: How much vertical space the calendar should take up in pixels.

  • Width: How wide the calendar should be in custom units.

  • AdvancedWidth: Extra width settings for responsive design.

  • Show when: A predicate defined from PortalRules used to determine when the calendar should be displayed in the Portal.

Event Type#

Event types are the representation that is required for CtrlPortals’ Calendar module to interact with M-Files objects, both for displaying them as events, but also for creating/editing them.

The each event type is configured with 11 options:

  • Name: The name of the event type.

  • ObjType: The object type that this event type.

  • Class: The object class used for this event type.

  • FromDate: A property definition for a datetime property that determines when this event starts.

  • ToDate: A property definition for a datetime property that determines when this event ends.

  • AllDay: A Boolean property determining if the event takes place for an entire day.

  • Cancelled: A Boolean property that indicates if an event is cancelled. If this is true, the title of the event will have a strike-through.

  • Hours: A number property used to count up how many hours this event takes up. This is used for e.g. reporting purposes.

  • RelatedVia: A property that the event type uses to refer to the Portal’s subject object.

  • BackgroundColor: A property that determines the background color of each event. Optional.

  • TextColor: A property that determines the text color of the event. Optional.

  • PersonalType: Used to signify if the Event type should only be visible to the user who created the events.

  • PersonalRelationship: The property that the event uses to point to the person if the event type is personal. Be sure to set the ‘Personal Type’ according to the type of the property. If selecting from user accounts, the Personal Type should be UserAccount, otherwise EmployeeObject.

  • IsBackgroundEvent: Used to signify if the Event type should be shown as a background event, allowing other events to be stacked on top of it and disabling the context menu for the event.

  • NoCollision: Determines if the event is not allowed to collide with other events of any type.

  • EventTitle: Optional property that determines the title of the event as shown in the calendar. If this is not specified, the default ‘Name or Title’ is displayed. Note that it does not impact the actual name of the event, just how it appears in the calendar.

  • EventHover: This placeholder is an optional text that is shown when hovering over an event with the mouse. HTML and multi-line values are supported. If this is not specified, the Event Title placeholder is displayed, and it that is not specified, the default ‘Name or Title’ is displayed.

In order to add a calendar, you would need to create one or more objects representing events and add the required properties to those objects.