Magnar Myrtveit Magnar Myrtveit - 1 year ago 85
jQuery Question

Prevent loading data for the initial page when using server-side processing

Is there a way to prevent loading the rows for the initial page via

when using
with server-side processing?

When the page is loaded, the rows for the first page are already available in the
. I would like
to use the rows already available in the
for the initial page. When sorting/searching/paging, the data to be shown must of course be loaded using
, but this is not necessary for the initial page, in my case.

Answer Source

Use deferLoading option which is there to delay the loading of server-side data until second draw. You just need to provide total number of records in your dataset.

$('#example').dataTable( {
  "serverSide": true,
  "ajax": "scripts/server_processing.php",
  "deferLoading": 57
} );