Document toolboxDocument toolbox

2.1. Quick start

 

To kick off your experience, we highly recommend diving into our Quick Start application. The Gantt widget, by its nature, involves quite a bit of setup but with our quick start you can get started within minuted (link).

Minimal configuration

image-20240209-085008.png

We highly recommend getting started from the quick start application (link). Here the domain model is already configured. You can copy this to modify it to your needs.

A note on ID’s. The quickstart application uses Autonumbers for Id's but you can use a other attribute types as well. This might be preferable if you plan to import and export data for example.

Gantt context

First, we need to create a context object for the Gantt widget. Below are the minimum attributes required in most situations.

image-20240209-084950.png

When creating a context entity TaskId, ResourceId, TaskParentId, TaskName, SyncRequest and SyncResponse are required. Make sure the SyncRequest and SyncResponse attributes are set to unlimited.

Make sure the widget is in a dataview that contains a context object with these attributes.

Tasks

Define the datasource for you tasks and set appropriate edit rights. Please note that disabling edit/reorder rights here will only disable the widget interaction. Real validation should always be done server side.

Task settings

Edit rights can also be specified on a task level under task settings (e.g. by an expression with the task as input). But they can also simply be set to true or false. Global task edit rights will have precedence over these specific deletable, movable and resizable rights that can be set on a task level.

Please not that you will need to refresh the task entity to update any changes made in Mendix to the deletable, moveable and resizable properties. It’s good practice to refresh the entity only when needed. Especially when dealing with large amounts of data.

Task Styling

Use this expression to set global or conditional CSS classes to style your tasks.

Task mapping

In the mapping tab you need to map the right attributes of your task entity to the widget.

Dependencies

For optimal performance it’s recommended to use an from and to id attribute on the dependency object it self however this is not required.

Synchronisation

A Gantt widget is a complex component. One change can trigger a scala of updates. Furthermore You might want to rollback a change based on several factors. To allow this kind of behavior and to get around some of the Mendix pluggable widget API limitations the Gantt widget employs a custom sync. This has various implications. For one you do not need to refresh the entire list of objects just to refresh a single value in that list (which is the case for other Mendix widgets). As you can imagine, this greatly improves performance for large datasets. It might however take some getting used to so we recommend you take a look at our quick start application to see this in action.

License

To try out the Gantt widget 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 Gantt widget is not used on any pages. You can simply supply an empty variable or constant, etc. in this case.

Â