0
我與功能footercallback數據表和它運作良好 ,我想補充的出口數據表使用HTML5這樣數據表錯誤:缺少}在DOM
$('#example').DataTable({
dom: 'Bfrtip',
buttons: [
'copyHtml5',
'excelHtml5',
'csvHtml5',
'pdfHtml5'
]
"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
total = api
.column(6)
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// Total over this page
pageTotal = api
.column(6, { page: 'current'})
.data()
.reduce(function (a, b) {
return intVal(a) + intVal(b);
}, 0);
// Update footer
$(api.column(6).footer()).html(
'Rp'+pageTotal +' (Rp'+ total +' total)'
);
}
});
,但顯示錯誤
`SyntaxError: missing } after property list
dom: 'Bfrtip',`
能你幫我? 我想念什麼?