updating datatables cells

updating datatables cells

ali_junaidiali_junaidi Posts: 2Questions: 1Answers: 0

I have a very simple dom table that is used as data source for my datatables. You can view it on this link http://live.datatables.net/kaqacubi/1/edit?html,js,output

The table has only three columns. The 3rd column is derived by summing the 1st and 2nd column. The problem is that 3rd column isn't updating its data or display them despite using 'table.draw()' .. thanks in advance for your help and advice :)

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    So the problem is that row().invalidate() without any parameters is reading from the DOM in this case, since your table is DOM sourced. However, your updated data is in the cached data structure.

    You can override the default and have row().invalidate() read from the data source using the parameter passed in. Updated example.

    Allan

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Realised that the docs don't actually say what values the parameter can take at the moment. I've just updated the docs and will deploy them to the site soon!

    Allan

  • ali_junaidiali_junaidi Posts: 2Questions: 1Answers: 0

    Thank you allan. That was really helpful :) . I appreciate it.

This discussion has been closed.