A Mendix widget for styling cells or rows a data grid. You can achieve highlighting on rows or columns of a datagrid like this:
See a demo of the cell styler in action here.
The cell styler widget requires a little bit of JavaScript knowledge to configure. Here's how it is done:
<td>
), grab the name of the cell's column and enter it here. If you'd prefer to apply a style to the whole row (<tr>
), leave this blankrowObj
and contextObj
See below for examples.Note: you must include the attributes you'll be comparing in your grid. You can do this and avoid displaying them by setting their column's width to 0% from the data grid properties window
Note2: The name you want is the name of the attribute on the entity, and not the grid column or caption names. Use this name:
return rowObj.get("Name") === "Scooter";
return rowObj.get("IsReallyFast") === true;
Boolean attributes of true/false may display as "Yes"/"No" in a grid. In your javascript code, you should match the true/false, not the "Yes"/"No".
return rowObj.get("Name") === contextObj.get("Name");
var now = new Date();
var oneYrAgo = new Date();
oneYrAgo.setYear(now.getFullYear() - 1);
return rowObj.get("DateOfBirth") < oneYrAgo;
var store = rowObj.getChildren("MyFirstModule.Pet_Store")[0];
return store.get("Name").includes("Emporium");
This widget is a perfect use case for Nanoflows. As soon as they become runnable from a custom widget, they should be used here instead of JS.