Sum of the values of a column identified by data-column-index
Sum of the values of a column identified by data-column-index
Gramanox
Posts: 2Questions: 1Answers: 0
Hello,
I would like to calculate the sum of a specific column with "data-column-index" of 16.
The name of the datatable is report_table.
This is my attempt:
$('#report_submit').click (function()
{
var theTotal = 0;
$("#report_table [data-column-index = '16']").each(function () {
theTotal += parseFloat($(this).val());
});
alert(Thetotal);
});
But nothing happens, I never got an alert window.
Sorry, as you can see I'm really noob in this field.
Please help me to correct my code.
Thank you in advance.
This discussion has been closed.
Answers
Any help is appreciated...
Thanks!