我正在尝试在数据表页脚中添加多行,是否有可能,当前我在footercallback方法中添加了1行,我想与该行并行添加另一行,我的js代码类似于
jQuery(document).ready( function ($) {
$('#dataTable').DataTable({
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// converting to interger to find total
var intVal = function ( i ) {
return typeof i === 'string' ?
i.replace(/[\$,]/g, '')*1 :
typeof i === 'number' ?
i : 0;
};
//
var Total = api
.column( 5 )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// append the total monthy fine
$( api.column( 0 ).footer() ).html('Total Monthly fine');
$( api.column( 5 ).footer() ).html(Total);
}
});
});
我还要在footer中添加其他行。任何人都可以帮助