How to access row background color?

Basically, is it possible to reapply this…

…after the data has been sorted?

Hi @EdG,

Normally, it should apply this automatically after sorting, and from what I see it does.

You can see for yourself by doing this:

When initialized, it will log:

image

As expected, the rows with be alternating between 111111 and 333333:

Now, when I sort a random column, it will log:

image

And accordingly, you can see in the table that the 4th and 5th rows are the same background color:


If you want the background color always to alternate between the two values, you need to use the index of the sorted data:

image

{{ui.table.filteredValue.findIndex(e => e.id === row.id) % 2 ? `333333` : `111111`}}
1 Like

Ahhh I really should read the docs first! Thanks Max it works perfectly :slight_smile:

1 Like