When using fnReloadAjax does not stay on the current page

0

I'm using the fnReloadAjax for when the user does some action on the table that is mounted using datatables already reloads the data again, it just does not stay on the current page.

It keeps filtering, sorting, number of records per page, but always returns to the first page.

Does anyone know of anything to fix this?

    
asked by anonymous 29.08.2016 / 21:34

1 answer

0

For this issue I opened a issue in github about this issue in Datatables plugin page also and there I was suggested to use the ajax.reload () and that was what solved my problem, but remembering that this function is only available from version 1.10 of datatables and for it to work I had to do it like this:

var oTable = $('#example').DataTable( {
    ajax: "data.json"
});

// na chamada de uma ação, qdo precisar recarregar o conteúdo da tabela fiz assim
oTable.api().ajax.reload(null, false);
    
31.08.2016 / 13:35