Sum over rendered data

Sum over rendered data

rangaranga Posts: 31Questions: 12Answers: 2
edited September 2018 in Free community support

Hello

Can somebody help me with How to add columns().render() option to below code to get the sum of a rendered column with sum plugin ?

{data: null,
                                 "render": function (data, type, row)
                                 { return (data["a1"] * data["b1"]) }},


 "footerCallback": function () {
                                    var api = this.api(),
                                            columns = [4, 5]; // Add columns here

                                    for (var i = 0; i < columns.length; i++) {
        $('tfoot th').eq(columns[i]).html(+api.column(columns[i], { filter: 'applied' }).data().sum() + '<br>');
                                    }

I saw that as a recommended method by Allen but now cannot find it and no idea how to use it here.

Thank You for the Help

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.