4

Am using JQUERY DataTable and am loading Data using fnserverdata Ajax calls.

When i click serach button for first time

'fnServerData':function(sSource, aoData, fnCallback) {
    console.log("Called");
    $.ajax({
    .
    .
    .
    })

my console is getting logged for first time.

Second time if i click search 'fnServerData' is not getting called and result is shown using my first time data.

My console in above is not logged in fnServerData as the function is not called

Am i missing any thing or did any one faced similar issues ?

Work around will be helpful.

Thanks

Peru
  • 2,871
  • 5
  • 37
  • 66

1 Answers1

2

For that you have to destroy datatable, and recreate each time.

function dataTableView()
{
   $('#tableID').dataTable({
   "bDestroy": true
   });
}

thanks.

Rishi Jagati
  • 626
  • 1
  • 6
  • 28