DataTable Export Not showing Loader

DataTable Export Not showing Loader

TejaswinijTejaswinij Posts: 2Questions: 2Answers: 0

I wanted to show the Export button on different location as per my UI requirement, so I have customized the location of Export button of DataTable. using below code.
Export takes some time, so I want to show loader image while Exporting takes place. Export takes time but loader image not getting displayed.
But If I debug the JS loader image gets displayed.
Can someone guide me here.
`$(function () {

        $('.Export').on('click', function () {
            $("#loaderImage").show();
            $("div#divExportButton button").click();
            $("#loaderImage").hide();
        }); /* Export Grid */

});`

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Tejaswinij ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • allanallan Posts: 63,468Questions: 1Answers: 10,466 Site admin

    You most likely need to use a setTimeout immediately after the show to break the thread and let the browser render the loader image, before it then processes the click action. But as Colin says, we'd need a test to be certain.

    Allan

This discussion has been closed.