close
1. 要先下$.fn.dataTable.ext.errMode = 'none';
2. 再加入
.on('error.dt', function(e, settings, techNote, message) {
console.log( 'An error has been reported by DataTables: ', message);
})
function 裡頭加入自訂內容
--
See the documentation -> http://datatables.net/reference/event/error
-
error.dt
was first introduced in 1.10.5 !! So you must use at least 1.10.5. Proof of concept : works not, 1.10.4 example / works, 1.10.5 example. -
The correct option to target is
$.fn.dataTable.ext.errMode
. -
A working example would be using >1.10.4 and
$.fn.dataTable.ext.errMode = 'none';
$('#example').on('error.dt', function(e, settings, techNote, message) {
console.log( 'An error has been reported by DataTables: ', message);
})
--
轉自 https://stackoverflow.com/questions/30283140/datatable-custom-error-handling-not-working
--
全站熱搜