Hi all,
Is there a way in Ignition Script to retain Background Color Mapping of a Table?
Here is the scenario, I created a table in Ignition with a background color mapping depending on "priority" value of a row where "priority" is one of its columns.
Then, I created a script in one of the components (a button) where the table's dataset will be replaced with new a dataset (but having its column names retained) when the script is ran. When I did that, the table's dataset is replaced but the background color mapping is gone! Is there a way to retain the background color mapping when the dataset is replaced?
Here is part of my script:
table = event.source.parent.getComponent('Debug Table')
headers = list(table.data.getColumnNames()) #to retain the column names
dataOut = []
table.data = system.dataset.toDataSet(headers, dataOut)
tableData = table.data
for i in range(len(datetimeList)): #datetime, priority, and message lists are defined earlier
tableData = system.dataset.addRow(tableData, i, [datetimeList[i], priorityList[i], messageList[i]])
table = event.source.parent.getComponent('Debug Table')
table.data = tableData
This question is related to my earlier post: https://inductiveautomation.com/forum/viewtopic.php?f=50&t=14191
Many thanks!