Exporting Data to Excel When on-demand paging is enabled
Exporting Data to Excel When on-demand paging is enabled
I've implemented the jQuery Datatable in my MVC web application.
Currently I have enabled **on-demand paging ** for the datatable( Hence initially if I've set the datatable to show 10 records than it would fetch only the first 10 records intead of fetching the entire data from database).
I'm using the default HTMLExcel button provided for datatable. But the obvious problem in my case is that it exports only those data which are visible on the datatable and not all of the data (which are not yet loaded due to on-demand paging).
Here's my JS code for it:
```$('#searchResult').DataTable(
{
"dom": '<"top"B>rt<"bottom"lip><"clear">',
buttons: [
{
extend: 'excel',
exportOptions:
{
columns: ':visible'
}
},
'colvis'],
"processing": true, // to show progress bar
"serverSide": true, ```
Is there any way to send entire data to the excel when on-demand paging is implemented?? Thanks in advance.
Replies
See this FAQ:
https://datatables.net/faqs/#buttons