Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Info

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

...

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.

Info

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.

...

When creating a context entity TaskId, ResourceId, TaskParentId, TaskName, SyncRequest and SyncResponse are required.

Getting tasks

Once you have placed the Gantt widget inside a page with the context you can start customizing the widget.

Firstly you must configure a data source to retrieve the tasks that you want to show in the widget. You can define some actions when a item is double clicked, and configure settings whether or not the items are deletable, moveable, resizable.

...

Configuring the mapping

Configuring the mapping is where the business entity comes into play. Notice there is task name and the context for that attribute. The task name is in this example the data source you defined in the tasks tab, the context is the underlying dataview context entity.

Good to note is the task phantom id is relevant for creating new tasks. The widget will assign a temporary id which will be used to assign an actual id from the server. So we can match the client and server side.

Constraint date and constraint type can be configured. By default each task will start as soon as the project start, setting a constraint date and type can alter this behaviour (check out ENUM_TaskConstraintType for the types)

Dependencies

This is needed to create dependencies between the tasks, so you can view the Gantt widget. Associations in dependencies and assignments are purely for Mendix and not needed for widget.

...

...

Synchronisation

Lastly to configure is synchronisation within the Gantt tab. Request and response are both strings in JSON format, make sure you set the access rights to read-write. These contain the response from the server which can be mapped in the synchronisation microflow.

...

First thing you need to do is call the BizzomateGantt.JAVA_Request_Import action and configure it accordingly with the SyncRequest attribute. Use the returned object to retrieve TaskCrudList, DependencyCrudList and AssignmentCrudList. For each list you need to process the CRUD-data back to business data (example shown below).

...

. 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.

Info

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.

...