How do I update cell value without rewriting completely the td elements.

How do I update cell value without rewriting completely the td elements.

ludiofinesludiofines Posts: 1Questions: 1Answers: 0
edited April 2017 in Free community support

Hi all,

I initialize my datatable (DataTables 1.10.13) using an array of objects and named columns with defined functions in the columns property. My data updates on fixed interval and i just use cell().invalidate() to update the dom from the underlying data.invalidate() function, when updating the dom, removes the whole td element and creates a new one with the data from the defined functions in columns property. A simplified example of my scenario: http://live.datatables.net/baqihadu/1/edit?js,output So far so good.

Another application is clicking on a td element which is removed and added due to invalidate(). Sometimes this application cannot click because invalidate() has generated another element which for some reason is unknown to the internals of the application and throws an exception. I tried to handle this exception but doesn't seem to be an easy task, if at all possible. So the question is:

  1. Is there a way to update cell value without rewriting the innerhtml (done in invalidate()) property?
  2. What about when your cell contains more complex values as html code? You can see the live example i provided. I have control on the server side where mydata comes from.
This discussion has been closed.