I got a table with columns
When I transform the Named Query with a script to style the cells...
def transform(self, value, quality, timestamp):
if quality.isGood() and value is not None:
output = []
py_data = system.dataset.toPyDataSet(value)
for row in py_data:
newRow = {}
for col in py_data.getColumnNames():
cell_value = row[col]
if cell_value == 1:
bgColor = "#FF555588"
fontColor = "#ffffff"
display_value = ""
elif cell_value == 0:
bgColor = "#50BE8788"
fontColor = "#FFFFFF"
display_value = ""
else:
bgColor = ""
fontColor = ""
display_value = cell_value
newRow[col] = {
"value": display_value,
"style": {
"backgroundColor": bgColor if bgColor else "transparent",
"color": fontColor,
"fontWeight": "bold" if bgColor else "normal",
"textAlign": "center",
"borderLeft": "1px solid #FFFFFF" if bgColor else "none",
"borderRight": "1px solid #FFFFFF" if bgColor else "none"
}
}
output.append(newRow)
return output
else:
return value
...the order of the columns change:
No idea why this happen