Dynamic columns for the datagrid 2 widget - Mendix Forum

Dynamic columns for the datagrid 2 widget


It would be great to allow the developer to dynamically generate the amount of columns at runtime in the datagrid2 widget.

In our use-case, we create a dashboard table entry and associate a one to many table to it, to configure the columns. This would allow us, and many others, to create generic pages that can be configurable in the app for the needs of the people.

First dashboard:
A dashboard entry called “Production” can be made. Associated to it are 5 column entries, named P1 through P5.
Second dashboard:
A dashboard entry called “Logistics” can be made. Associate to it are 3 column entries named L1 through L3.

Now people from the production floor and people from logistics can use the same page layout with a data grid that allows for a dynamic number of columns because of their different needs and the developer only has to make 1 page instead of X pages, each tailored to the needs of each department.

2 answers

Upvoted… but…
If this is option is implemented or not, it would be great if the columns can be given a unique, “technical” name.

The personalization configuration is now saved using the Caption and is thus depending on the user's language.

I already have logic in place to hide or display columns but had to do it for each possible language.

Changing the caption means that also the MF logic must be changed (whic is often forgotten).

But changing the caption also means that users loose their personalization.


Hi Arne,


There is a Matrix widget that lets you dynamically set columns you might want to look into: