Power table row colour

Hello,

I’m trying to change the row colour of my table.

The table logs start and end of sequences. Sometimes sequences are aborted and will show up “Yes” in column nammed “Aborted”.

So I have a column named “Aborted” that can only contain data “Yes” or “No”. When this column is “Yes” I want to change that specific row colour to “Red”.

Is there a way to do this via scripting with the configure cell option or any other ideas?

I can’t use the option background mapping because I’m using V7.7.2 of igntion

Power tables never have a background mapping, and you always need to use scripting.

The “configureCell” script is indeed the correct script. It loops over all cells and you get information on that cell.

So what you need to do is get the row number of the cell (it’s given to you as an argument), and query the table value of that row and the “Aborted” column.

self.data.getValueAt(rowIndex, "Aborted")

Then compare this to “Yes” or “No”, and return a style object like this:

return {"background": "#FF0000"}

Note that one problem is that you can no longer see selected rows. If you want to take that into account, you need to define a separate color for every selected+aborted combination (whether the cell is selected is also given as an argument).

1 Like

Thank you Sanderd17!

This worked prefectly like I wanted.