Accessing the data from rendered column in another rendered column<
Accessing the data from rendered column in another rendered column<
Khalid Teli
Posts: 251Questions: 71Answers: 0
HI,
I was just wondering if it is possible to use data from one rendered column in another rendered column:
For example: data generated in target:6 , can that be use in target:7 so that we don't have to do some calculations in column 7 again?
Thank you
{
targets: 6,
data: null,
render: function(data, type, row) {
return 1;
}
},
{
targets: 7,
data: null,
render: function(data, type, row) {
var summ = table.cells(null,6).render('display').toArray();
console.log(summ)
return summ;
}
}
This discussion has been closed.
Answers
See this thread for a way to access the Datatables API in
columns.render
. Whether value in column 6 is rendered in time for column 7 to use it is another question. You can test it to see if it works for your case as I can see it might not in all cases.Kevin