columns.render periodic recall?

columns.render periodic recall?

SpudsSpuds Posts: 1Questions: 1Answers: 0
edited June 2016 in Free community support

Hi,

in my table, i have a column which contains "waiting time" since a timestamp (thats the raw data).
So i used the columns.render option, to calculate elapsed time in minutes.
Something like this:

columns:
[
   {
      data:    'timestamp',
      render:  function (data, type, row) {
          return Math.floor((Date.now() -  data) / 60000) + " min");
      }
   },
   ...
]

It works, but obviously, it must be incremented every minute.
I tried to call table.draw(), but that didn't worked.

Any hint, how coud i trigger the columns.render() and redraw it (besides removing and adding every row)?

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin
    Answer ✓

    Use rows().invalidate() to have DataTables re-read that data from the data source (including rerunning the renderer).

    Allan

This discussion has been closed.