datatable check if data is empty code example
Example: if datatable is null js
var table = $('#idTable').DataTable();
if ( ! table.data().any() ) {
alert( 'Empty table' );
}
var table = $('#idTable').DataTable();
if ( ! table.data().any() ) {
alert( 'Empty table' );
}