Set font-style on data-grid based on attribute value

In a Mendix 5.19 application we need to set the font-style of a cell, based on the attribute value of the previous column. Data of the entity: How can we get this result, where the value of previous column is used as Font-style?
1 answers

You could achieve this per row using the datagrid extension widget. It unfortunately does not currently support styling per cell.

So, I believe you would need a custom widget to achieve this functionality. I believe the easiest way would be to automatically apply classes to cells with specific content. So, you would code the widget to set the class of the JanStyle cell to something like "boldMonth".

In the modeler, you could manually set the width of your style columns to 0% so they won't appear.

Then, you could use that class in your custom styling to select the next sibling cell and apply a style to it. I think the CSS would look something like this:

.boldMonth + td {
   font-weight: bold;