pdf download indicator ?
pdf download indicator ?
alka
Posts: 4Questions: 3Answers: 0
when there is a huge amount of data in datatable dataset, then on clicking the pdf button it takes few seconds to make pdf while that time I need to show a loader i.e (pdf is in processing) or its not possible...Please Help...... Someone very urgent
$(document).ready(function() { var hidden_startdate_avail = $(".hiddendate_avail1").val(); var hidden_enddate_avail = $(".hiddendate_avail2").val(); var table = $('#table_id').DataTable({ paging: false, scrollY: 647, dom: 'Bfrtip', "bProcessing": true, buttons: [{ extend: 'csvHtml5', text: '', titleAttr: 'Download CSV', extension: '.csv', exportOptions: { modifier: { page: 'current' } } }, { extend: 'pdfHtml5', text: '', titleAttr: 'Download PDF', alignment: 'center', title: 'Resource Utilization Report', orientation: 'landscape', pageSize: 'LEGAL', message: 'Start Date:: ' + hidden_startdate_avail + ' - End Date:: ' + hidden_enddate_avail, pageSize: 'A4', exportOptions: { modifier: { page: 'current' } } }], }); $('#table_id tbody') .on('mouseenter', 'td', function() { var colIdx = table.cell(this).index().column; $(table.cells().nodes()).removeClass('highlight'); $(table.column(colIdx).nodes()).addClass('highlight'); }); });
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There is no option for that at the moment I'm afraid.
If it is very urgent, the priority support options are available and I can put together an example of how it might be done by providing your own
action
method that displays a processing message and then calls the original PDF create action method to build the PDF.Allan
Hey Allan thanx for your quick response and suggestion.. But I did it myself :)
Hi alka, I'm looking for this exact thing.
Are you able to provide the code for you got the Loading Message to appear when the user clicks the PDF button?
May be you already find a way. i was facing the same problem yesterday and i find an hack and i would like to share it with you. Before your own action method overide the default one i just save it, then set yours and inside it you can call the method that you saved earlier.
for saving the default do something like :
var default_action_pdf=$.fn.DataTable.ext.buttons.pdfHtml5.action ;
and your action mehod could be :
action :function ( e, dt, button, config ) {
showLoader();
default_action_pdf( e, dt, button, config ) ;
setTimeout(function() {
hideLoader();
}, 500);