check datatables is null jquery 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' );
}