Enable Datatable Warning Alert
I wanted to stop the datatable warning alert before my js script start filling the datatable with data. So i added this line: //hide the warning $.fn.dataTable.ext.errMode
Solution 1:
You need to use error event after specifying errMode = 'none'
Error event
DataTables provides this event to allow you to hook your application's own error handling into DataTables. For example you could trigger an Ajax call that will log an error for investigation, or use the error event to show a custom error message to the end user.
To use this event, first specify errMode
to none
$.fn.dataTable.ext.errMode = 'none';
and to trigger this event, append .dt
namespace with this event as follow:
$('#example')
.on( 'error.dt', function ( e, settings, techNote, message ) {
console.log( 'An error has been reported by DataTables: ', message );
} )
.DataTable();
Post a Comment for "Enable Datatable Warning Alert"