How to change backgrounds with Grid Cell Styler

1
Hi all, I’m currently using Grid Cell Styler (https://marketplace.mendix.com/link/component/106254) to change certain rows of my data grid based on the value of one of the variables within the grid. When a certain variable contains “COMPLETE” the row should be normal, when it doesn’t, it should be a different color.  I’ve managed to get the text color to change to “warning” using the below settings.  However when I try to do the same thing but for the background, nothing happens.  The above code changes nothing about how the grid looks.  Note: I am not trying to apply both of these things at the same time, I am deleting the first rule before I attempt the second. I only want to change the background of the cells in the selected rows.  I would assume that I should be able to put any of the Mendix styles (https://docs.mendix.com/howto/front-end/styles) into the “class to apply” box and have them work, but none of the background related ones work, and only a few of the text ones work. Is there an additional setting I need to change?  Many thanks
asked
1 answers
2

Hi Hartley,

You’re indeed correct on the behavior. I’d suggest raising a query on the github to see if this is how the widget is expected to behave.

For now, you can try the following workaround:

  1. Create your own custom class as following:

.mycustombackground-warning {

    td {

        background-color: orange !important;

    }

}

  1. Do remember to compile the class (if you don’t know how take a look at this documentation: https://docs.mendix.com/howto8/front-end/calypso)
  2. Add this class name in the widget and it should work.

 

Hope this helps!

 

answered