Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change the line color dynamically? #565

Open
ronaldaraujo opened this issue Apr 3, 2024 · 0 comments
Open

Is it possible to change the line color dynamically? #565

ronaldaraujo opened this issue Apr 3, 2024 · 0 comments

Comments

@ronaldaraujo
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant