Sum of selected rows

Sum of selected rows

hsenmshhsenmsh Posts: 1Questions: 1Answers: 0

Hi ,
i need to get the sum of selected rows : on key-focus and row select trigger

thats my code :

var table = $('#mytable').DataTable({
                ajax:{
                    url: "jsonTable.php", // Change this URL to where your json data comes from
                    type: "POST", // This is the default value, could also be POST, or anything you want.
                    data: function(d) {
                        d.payment_type = $("#payment_type").val() 
                    }

                }, 
                select: true,
                keys: true,
                processing : true , 
            });

table
.on('key-focus', function (e, datatable, cell) {
datatable.row( cell.index().row ).select();
// here i need to get the sum of selected row when i use the keyboard shortcut
});

Answers

This discussion has been closed.