DataTables Responsive Data Cell Doesn't Work For Child When Setting Using JavaScript

DataTables Responsive Data Cell Doesn't Work For Child When Setting Using JavaScript

flafsonflafson Posts: 2Questions: 1Answers: 0

Hi,

First of all, amazing project thanks for that.

My question is like that, I created a table that will have id's, I created a JavaScript tool that will run some calculations and populate each table cell based on the id of that cell. I'm using Responsive by the way.
So the table starts empty (or mostly empty) and when you run the script it will populate all the cells one by one.
That works fine but when I resize the screen and the columns drop (child rows) the data that was already in the cell goes missing.
After a lot of debugging I noticed that if I hardcode it into the HTML then it will be inside the child row but if I used JavaScript to populate that cell, it doesn't drop. I suspect that happens because the id of the cell changes so when the whole thing gets rendered again, that cell id doesn't exist anymore.

This is how I assign the value using JavaScript:
document.getElementById("band1Transactions").innerHTML="300";

I guess the question is, how do I assign values to both parent and child.

I created a sample CodeOpen that illustrates my problem.
http://codepen.io/flafson/pen/QyMOXZ

Thanks for the help!!!

Answers

This discussion has been closed.