Data backgroundColor style

I want a table to colour rows based on the priority and acknowledgement status of the alarm. I’m unable to use an Alarm Status Table because I want to set the headings.

I have implemented a Table with a script to populate data. The script gives each row a background colour. Data populates successfully, and an example is below.

However, the rows don’t change colour. I’m unable to find that colour listed anywhere in my external debugger. Why isn’t it coming through?

Thank you for your time.

Hi @james.beeley, the format of the data is slightly incorrect. You need to put all your values into a “value” object and then have a style object as it’s sibling. Something like this:

[
  {
    "value": {
      "displayPath": "FK",
      "id": 1,
      "someCol": 3
    },
    "style": {
      "backgroundColor": "#FF8000"
    }
  },
  {
    "value": {
      "displayPath": "FK",
      "id": 2,
      "someCol": 5
    }
  }
]
1 Like

I have almost the same table)) I mean I don’t use the Ignition Alarm Table.
So… this is how I append data to the Table (this is a part of my Script… this is for You to see how I did it):

data = []
data.append({"selected":{'value':False,'style':{'background':'#FFFFFF'}}, "Group":group, "style":style,"id":id_item, "displayPath": displayPath_item, "priority":priority_item, "priorityOrdinal":priorityOrdinal_item, "state":state_item, "stateOrder":stateOrder_item, "timestamp":timestamp_item, "timestampMS":timestampMS_item, "value":eventValue_item, "ack":ack_item})

Matthew is right)

1 Like

Both great answers, thank you for your time

2 Likes