Is there an event I can use in a change script for when a user sorts a table?

I have a Perspective table with a defined column and the sortable property set to true.

When the user selects the table to sort to ascending or descending is there some event I can look out for to trigger a custom script?

As far as I can tell the answer is no but thought I'd ask anyways.

I don't think so, but what problem are you trying to solve?

I had originally asked the question in this thread:

but never got a clear answer on whether there was an event triggered by sorting a table.

I suppose what I am trying to do is style rows in a table before CSS sheets were introduced (v8.1.21).

I can do this using the striped color even / odd properties when there is a single color however when I want to color some rows red and others green based off data criteria that doesn't work anymore.

I think I can use the markdown component to inject html but I haven't convinced myself that is worth my time yet so I am looking for a quicker way to solve the problem :slight_smile:

I suggest that you be much more discrete and put a colored icon on each row to indicate good and bad and let the table apply the alternate banding. A simple view rendering in one column would do the trick.

I would also make sure that it is clear to someone with red-green color-blindness by either changing the icon or changing the shape (circle good, square bad). It will make the application appear much more professional and be a lot easier on the eye. (Your sample screengrab isn't either to me - but what do I know?)

1 Like

My hands are [metaphorically] tied by the customer on this one.

I am constrained to pre-css sheets and specific user colors.