I’ve got a power table that gives me a list of orders and material needed for assembly. I’d like to use configurecell to change the color of a cell that is different from the value immediately above that, but I cannot figure out how to do it. I see rowIndex and columnIndex, but I haven’t figured out how to do value at rowIndex-1.
Any pointers?
Thanks!
What you want is something like this?
If so, you could use something like this:
Column_I_Want_to_Monitor = 3
#Defines what column will be configured
if colIndex == Column_I_Want_to_Monitor and rowIndex > 0:
#Checks if the column is the right one and that it's not the first row
previousCellValue = self.data.getValueAt(rowIndex-1,colIndex)
#On the Power Chart's dataset, finds the value at the previous cell
if previousCellValue != value:
return {'background': 'red'}
I hope this helps!
That was perfect, thanks!
I tweaked slightly due to using text column;
Column_I_Want_to_Monitor = 5
#Defines what column will be configured
if colIndex == Column_I_Want_to_Monitor and rowIndex > 0:
#Checks if the column is the right one and that it's not the first row
previousCellValue = self.data.getValueAt(rowIndex-1,colIndex)
#On the Power Chart's dataset, finds the value at the previous cell
if previousCellValue != textValue:
return {'background': 'red'}
1 Like