Changing Cell Background Color

Good afternoon all,

I'm currently trying to discover a way to highlight certain row/column coordinates when a value is reached. I will attach a picture below for easier referencing as to what I'm looking for:

What I am attempting to do is take the "Time" column and use that as an identifier. If M >= Time, I want it to be green. If M < Time, I want it to be red. If M is empty and it's still Monday, I want it to be yellow. If M is empty and it's past Monday, I want it to be red. Essentially, the M, Tu, W, Th, F is all operator input. If the operator meets their time they're good, if they don't it flags it, otherwise it is yellow.

Has anyone done anything similar to this before? Thanks in advance for taking the time to read and lend a helping hand.

The manual gives some good examples.

Show your code if you get stuck.

In case the example doesn't sink in, a Perspective table's behavior can be summarized as needing the styling with the data. If your data binding doesn't have styling, and most won't, you need a transform, or separate binding, to deliver data to the component with all of that style information pre-computed.

This is fundamentally different from typical behavior of Vision's tables, where the component "asks" for styling information (via custom method) while the unstyled data is displayed. Vision has the luxury of working this way because the code is right there in the client, and can perform the task with little or no latency.

In Perspective, the browser needs to have all styling delivered with data, to avoid time-wasting round-trips to the gateway. So too with other Perspective components that handle significant quantities of data, like charts.

1 Like