infinite-table / infinite-react

The modern React DataGrid for building apps — faster
https://infinite-table.com
73 stars 5 forks source link

How do I flash cell contents #250

Closed devmentor-js closed 1 month ago

devmentor-js commented 1 month ago

I'm trying to implement cell flashing when data changes in cells. I'm using the updateData method, but I don't see a way to flash the updated cell for 1s when the value changes.

Do you plan to provide flashing or can you help me figure it out? Thanks!

radubrehar commented 1 month ago

Hi @devmentor-js

we have just released v5.0.0 and it does include flashing - we're just about to update the docs to show how to do it.

But in short, you have to provide a custom ColumnCell component to the column you want to flash - namely import the FlashingColumnCell component from Infinite and pass it to the column


import { FlashingColumnCell } from '@infinite-table/infinite-react'

const columns = {
  // ...other cols
  stockValue: {
    field: 'stockValue',
    type: 'number',
    components: {
      ColumnCell: FlashingColumnCell,
    },
    defaultWidth: 200,
  }
}

Then whenever the value for a cell is updated (for example because of an updateData call), the respective cell flash

radubrehar commented 1 month ago

We just released our blogpost on flashing cells, hope it helps

https://infinite-table.com/blog/2024/10/15/how-do-i-flash-cells

devmentor-js commented 1 month ago

Thanks @radubrehar!

That's plenty of details there, I think I'm good. Great to see Infinite delivering flashing.