我正在使用数据表在我的管理面板上显示一些数据.
但是,当我使用搜索选项过滤结果时,它不会影响页脚总和金额,金额保持不变?任何想法如何解决?
<?php if(isset($data_tables)) { ?>
jQuery('#<?php echo $data_tables_name ?>').DataTable({
"filter": "applied",
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ?
i.replace(/[\$,]/g, '')*1 :
typeof i === 'number' ? i : 0;
};
// Total over all pages
if (api.column(2).data().length) {
total_revenue = api
.column( 2 )
.data()
.reduce( function …Run Code Online (Sandbox Code Playgroud)