Can someone help me loop through all the rows in a datatable column and update the data in it? So far I've found a way to loop through a column:
var table = $("#my_table").DataTable();
table.column(2)
.data()
.each(function(value, index) {
console.log(value);
value = 'abc123'; //this does not work
});
However, I'm not sure how to update that value.. Can someone help?
Thanks in advance!
column
returns aggregated data for the entire table. Loop through rows instead. There is aevery()
helper function that makes life easier :Demo -> http://jsfiddle.net/qx84jw55/