buttons-processing not working

buttons-processing not working

cj1005cj1005 Posts: 142Questions: 45Answers: 1

Hi,

My export to excel can take a minute or so with a large dataset, so I wanted to show a progress bar, I found an example from another thread, that I have adapted (see below):

qjobTable.on( 'buttons-processing', function ( e, indicator ) {     
   console.log(indicator);
   if ( indicator ) {
     showLoading();
   }
   else {
     hideLoading();
   }
} );

Then my two functions as below:

function showLoading() {
  console.log("show loading");
  document.getElementById("blackout").style.width = "5%";
}

function hideLoading() {
  console.log("hide loading");
  document.getElementById("blackout").style.width = "0%";
}

I can see in the console log, the functions are called as expected, but the bar does not appear at all.

I use these two functions throughout my web-app and the progress bar appears correctly, it is only when I try to use them with the export to Excel that nothing appears (I've tried the 'excel' and 'excelhtml5' export options, same on both).

Any suggestions appreciated?

Cheers, Chris

Answers

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765

    Its hard to say with seeing the problem occur. Please post a link to your page or a test case showing the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Are the showLoading and hideLoading functions called? If so then you probably need to debug what happens in the functions themselves.

    Do you get errors in the console?

    Kevin

  • cj1005cj1005 Posts: 142Questions: 45Answers: 1

    Hi Kevin,
    Thanks for your reply, I'll try debugging my functions a bit further and if I cannot solve it, I will then post my test page here.
    Cheers, Chris

This discussion has been closed.