the loading icon never goes away

the loading icon never goes away

maniyamaniya Posts: 78Questions: 13Answers: 0

i am using buttons extentions for loading a podf in a new window using window.open, but the loading icon never goes away, it stayas there

buttons: [
   {
      text: 'Export to PDF',
      className: 'export-to-pdf',
      action: function ( e, dt, button, config ) {
         var query = dt.search();
         window.open('generate_pdf.php?case_id=<?= $case_id? ?>&keyword=' + encodeURIComponent(query), '_blank');
      }
   }
],

i want either the loading icon should not show, but if it show it should hide after window.open

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Is the loading icon shown on the new page opened by window.open()?

    Is it the Datatables loading icon?

    Start by looking at the browser's console for errors. For help debugging please post a link to your page or test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    Thi Happens on the datatables button itself, I can share what happens what i click the buton:
    https://prnt.sc/OdiXI8PgXxlm

    the pdf loads properly in new window, the icon of the parent page where the datatables is, the loading icon never goes away

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Did you look at the browser's console for errors?

    Can you post a link to a test case replicating the error so we can help debug?

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    there is no error on this, it does nothing, i was reading and it says as window.open is async so that is why it is doing that, honestly i have no clue, and if that is the case i would disable that loading icon functionality altogther

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Using window.open() with a button works in this test case:
    https://live.datatables.net/codaxibi/1/edit

    However its not appending parameters nor using variables like your code. Could be something wrong there. Without a test case to debug its impossible to say what the problem is. Maybe update my test case to show the issue.

    Kevin

Sign In or Register to comment.