mantine-datatable icon indicating copy to clipboard operation
mantine-datatable copied to clipboard

Is it possible to change the line color dynamically?

Open ronaldaraujo opened this issue 1 year ago • 0 comments

I currently have the following table

<DataTable
  fetching={isValidating && !records.length}
  loaderBackgroundBlur={1}
  rowStyle={({ paid }) =>
  (theme) => ({
    backgroundColor: paid ? theme.colors.green[0] : theme.colors.white
  })}
....

When the data comes from the database this works perfectly. The line turns green if the paid status is true.

Screenshot from 2024-04-03 12-15-38

However, when the user marks it as paid or not paid, the line does not change color. It only changes color if I reload the data and I don't want to do that for usability reasons, since the default ordering is by paid status. In other words, if I reload the data, the item goes down, causing the user to lose sight of it.

Screenshot from 2024-04-03 12-17-14

Is it possible to control the lines externally?

ronaldaraujo avatar Apr 03 '24 15:04 ronaldaraujo