xxxxxxxxxx
// table.ajax.reload(callback, resetPaging)
table.ajax.reload(null, false)
xxxxxxxxxx
var refreshedDataFromTheServer = getDataFromServer();
var myTable = $('#tableId').DataTable();
myTable.clear().rows.add(refreshedDataFromTheServer).draw();
xxxxxxxxxx
$('#table').dataTable().fnClearTable();
$('#table').dataTable().fnAddData(data);
xxxxxxxxxx
Javascript12345var table = $('#example').DataTable(); table.ajax.reload( function ( json ) { $('#myInput').val( json.lastInput );} );
xxxxxxxxxx
//declare this var
dtElement: DataTableDirective;
//create method and call it where ever you want to refresh your table
reload(): void {
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
dtInstance.draw();
});
}