0

I want to refresh table data on ajax form submit how to do without reloading page . I'm using data table 1.7.6

I;m using datatable 1.7.6 in below is initiation

Offir
  • 3,252
  • 3
  • 41
  • 73

3 Answers3

0

Use ajax.reload

 $('#table-id').DataTable().ajax.reload();
Ghanshyam Singh
  • 1,361
  • 2
  • 15
  • 27
0

Destroy the datatable

$('#teamTable').dataTable().fnDestroy();

update contents. then ,

Reinitalize it ..

 $('#teamTable').dataTable();
Atul Sharma
  • 9,397
  • 10
  • 38
  • 65
  • ive update my question with my current code. pls check and advice me –  Dec 07 '16 at 10:28
-1

Since, you are working with Datatable 1.7.6 ajax.reload() will not work for you. Luckily, the author created a plugin before he introduced ajax.reload You need this plugin called fnReloadAjax

Implementation is there on the page too.

It'd go something along the lines of:

var oTable = $("#usertable").dataTable ({ 
     //your options
     //more options
});

And then to reload:

oTable.fnReloadAjax();

Though, if you can, try to upgrade to 1.10.

Use this and this

philantrovert
  • 9,904
  • 3
  • 37
  • 61