Document toolboxDocument toolbox

1.3.4. Event menu

Overview

The event menu is a dropdown that appears when the user right-clicks on an event in the scheduling component. The menu can be customized with custom actions and icons, allowing users to easily perform actions related to the event.

This feature provides a convenient way for users to interact with events in the scheduling component, allowing them to quickly perform actions such as editing, deleting, or duplicating events. The ability to customize the menu with custom actions and icons adds flexibility to the component, allowing developers to tailor it to the specific needs of their application.

For an example see: event menu

Implementation

To create an event menu, begin by enabling the feature under the "features" tab. Once enabled, you can add one or more menu items.

On click action

Due to certain limitations in the pluggable widget API, we are unable to send the event object as a parameter to the "on click" action defined here. As a workaround, the event can be retrieved from the event ID in the scheduler context.

If you have specified an event ID attribute, you can retrieve the event like this:

[EventId = $SchedulerContext/EventId]

 

If you haven't set an event ID attribute, the scheduler will populate the scheduler context's eventId attribute with the GUID of the object. Since Mendix doesn't provide an option to retrieve by a GUID string, you can use the provided Java action "JAVA_Get_Object_ByGuid" to accomplish this.

[EventId = $SchedulerContext/EventId]

 

Icon class

If an icon class is supplied it will be added to the HTML like so:

<i class="b-fa b-fa-arrows-alt" role="presentation"></i>

You can use regular Mendix glyphicons in the icon class, but you can also utilize the Font Awesome 4 library that comes bundled with the scheduler. However, it's important to read up on how to use it properly in:1.5.2. Icons - Fontawesome 4

 

Enabled

This expression will allow you to dynamically enable or disable event menu items. Disabled items will not be show in the menu.