1.1. Quick start
Minimal configuration
Scheduler context
First, we need to create a context object for the scheduler. Below are the minimum attributes required in most situations.
When creating a context only the StartDate is required. The widget will automatically set the end date based on the current view.
Optional
You can also specify a view on the SelectedView attribute (this should be the ID of the view defined in the widget later on). If no SelectedView is set the first view in the list will be used.
Â
Defining views
Once you have placed the scheduler widget inside a page with the scheduler context you can start defining some views.
You must fill in the context StartDate and EndDate here and define at least one view.
For now, you can choose one of the default views, or read up on how to define views in depth here. Only a unique view id and a name for the view are required, for now.
Adding resources
Resources are shown on the left of the widget and for each resource a new row is created. Only a resource data source and the resource id attribute (must be unique!) are required for now. Defining the content of your resources can be done with regular Mendix widgets.
Adding events & configuring last moved/new attributes
Multiple event data sources are supported. This is convenient when you want to use different event entities or if you have vastly different requirements for your various events in the scheduler. For now, let’s just define a single event data source.
The required attributes are a data source, a resource id, and a start and end date.
Under UI only the event content is required.
Finally, we want to define the actions to call when a user interacts with an event. All actions are supported for double-click action, and the scheduler context and event will be passed as an object parameter. There is however a little more to it for the on-change action.
Creating an on-change microflow
Mendix currently does not support editing list values from a widget (like the event data source we defined).
Because of this, we have to use a workaround to apply the potentially changed start date, end date, and resource id. This is why we need to define attributes for these values on the scheduler context, lie shown in the screenshot below:
Whenever an event is changed or created by the scheduler the New/Last moved event data will be updated on the scheduler context object. Since the on-change action will receive the scheduler object as a parameter it can be used to update the event.
In the example above you can see a sample of changed microflow. This example simply sets the updated values of the SchedulerContext object on the Event object and commits the changes.
Â
License
To try out the scheduler locally on your pc or even in a Mendix sandbox environment doesn’t require a license. However, a production build will.
It is also not required to have a license when the app is in production and the scheduler is not used on any pages.
Â