I am using a datatable and allow records to be deleted from the database. After deletion, I reload the table to display the recent changes. However, if I delete the last record from the database, null is returned by the AJAX call and does not update the datatable (it still displays the record that was just deleted).
My Call after the delete function is performed:
oTable.fnDraw();
oTable.fnReloadAjax();
The console error here is:
json.aaData is null
[Break On This Error] for ( var i=0 ; i<json.aaData.length ; i++ )
Is there a way to detect when nothing is returned from AJAX so that the datatable can detect that there are no records and display the 'datatable empty' message (i.e. No data available in table)?