i am very new in java. i am trying to display total in footer but can`t. and trying to total sum wi

i am very new in java. i am trying to display total in footer but can`t. and trying to total sum wi

azizulkhnazizulkhn Posts: 1Questions: 1Answers: 0
edited December 2018 in Free community support
<script type="text/javascript"> 
$( document ).ready(function() {
$('#employee_grid').DataTable({
         "processing": true,
        "sAjaxSource":"response.php",
         "dom": 'lBfrtip',
         "buttons": [
            {
                extend: 'collection',
                text: 'Export',
                buttons: [
                 //   'copy',
                 //   'excel',
                //    'csv',
                    'pdf',
               //    'print'
                ]
            }
        ]
 
"footerCallback": function( tfoot, data, start, end, display ) {
           var api = this.api(), data;
           var intVal = function ( i ) {
               return typeof i === 'string' ?
                   i.replace(/[\$,]/g, '')*1 :
                   typeof i === 'number' ?
                       i : 0;
           };

           var amtTotal = api
               .column( 5 )
               .data()
               .reduce( function (a, b) {
                   return intVal(a) + intVal(b);
               }, 0 );
        $(tfoot).find('th').eq(1).html(amtTotal );
      },
    
     } );
} );

</script>

EDIT: Updated to use Mardown code formatting

Answers

This discussion has been closed.