For only rows selectioned

For only rows selectioned

antoniocibantoniocib Posts: 277Questions: 62Answers: 1
    footerCallback: function ( row, data, start, end, display ) {                                                                                                   // SOMMA PER PEDANE
            var api = this.api(), data;

            var intVal = function ( i ) {
                    return typeof i === 'string' ?
                            i.replace(/[\$,]/g, '')*1 :
                            typeof i === 'number' ?
                                    i : 0;
            };

            // Total over this page
            pageTotal = api
                    .column( 7, { page: 'current'} )
                    .data()
                    .reduce( function (a, b) {
                            return intVal(a) + intVal(b);
                    }, 0 );

            // Update footer
            $( api.column( 7 ).footer() ).html(
                    pageTotal
            );
            pageTotal = api
                    .column( 8, { page: 'current'} )
                    .data()
                    .reduce( function (a, b) {
                            return intVal(a) + intVal(b);
                    }, 0 );

            // Update footer
            $( api.column( 8 ).footer() ).html(
                    pageTotal
            );
            pageTotal = api
                    .column( 9, { page: 'current'} )
                    .data()
                    .reduce( function (a, b) {
                            return intVal(a) + intVal(b);
                    }, 0 );

            // Update footer
            $( api.column( 9 ).footer() ).html(
                    pageTotal
            );
    },

I need to visualize the sums of only rows selected,what i need to add at code for do it?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.