So I have gotten a little stuck in scripting for changing the background color of entire rows in a table (I am using a standard table not a Power table).
I would like it to iterate through the rows of my existing table and change the background of specific rows using conditional statements. This code is executed using a button.
I am uncertain how to go about this, but this is my best guess about how I think the code might go
event.source.parent.getComponent('TableT3').data = dataOut
for row in dataOut:
rowData = list(row)
if row[4] == "11/9/2018":
event.source.getComponent("TableT3").background = system.gui.color("Red")
if row[4] == "11/8/2018":
event.source.getComponent("TableT3").background = system.gui.color("Yellow")
if row [4] == "11/7/2018":
event.source.getComponent("TableT3").background = system.gui.color("Green")
An error message appears for the for loop: Object is not able to iterate
I am having a new problem however. When a input all of the same date in, it turns them the correct color. However if I mix and match dates it defaults to the yellow color. Does anyone know why this is?
For what I can tell its taking the last date in the table then making the rest of the rows correspond to the date color.