Sum of the values of a column identified by data-column-index

Sum of the values of a column identified by data-column-index

GramanoxGramanox Posts: 2Questions: 1Answers: 0
edited July 2016 in Free community support

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.

Answers

  • GramanoxGramanox Posts: 2Questions: 1Answers: 0

    Any help is appreciated...
    Thanks!

This discussion has been closed.