columns.render periodic recall?
columns.render periodic recall?
 Spuds            
            
                Posts: 1Questions: 1Answers: 0
Spuds            
            
                Posts: 1Questions: 1Answers: 0            
            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
This discussion has been closed.
            
Answers
Use
rows().invalidate()to have DataTables re-read that data from the data source (including rerunning the renderer).Allan