Poll

How to hide the loader(Hide Loading) after file was exported when data is huge

$( ".selector" ).pqGrid( "showLoading" )
0 (0%)
$( ".selector" ).pqGrid( "hideLoading" )
0 (0%)

Total Members Voted: 0

Author Topic: How to hide the loader(Hide Loading) after file was exported when data is huge  (Read 4528 times)

fuljoyment

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Hello Admin,

When I clicked on 'Export' button there is a significant delay before the file was downloaded.  I want to show the loading message to the user so that user will understands that some action is going on.  So, I added $( ".selector" ).pqGrid( "showLoading" ) on Export button click.  I used 'setTimeout' to stop the Loader and used $( ".selector" ).pqGrid( "hideLoading" ) but it was not working as expected.

Code: [Select]
listeners: [{
                    "click": function (evt) {
                        var grid = this;
                        grid1.pqGrid("showLoading");
                        setTimeout(function () {
                            grid.exportData({
                                url: "CustOrdTable/exportData",
                                format: $("#export_format").val(),
                                render: true
                            })
                        });
                        grid1.pqGrid("hideLoading");
                    }
                }]

Note: I think here setTimeout works when we want to export the local data.  This is not working with round trip to remote server.

    So, My question is
  • How we can show the loading message while data is getting ready for download with round trip to remote server?

Could you please suggest me what am doing wrong and if possible show me a demo on Exporting the Remote data with 'showLoading' and 'hideLoading'.

PS:-I am using ParamQuery Pro v6.2.4 in my ASP.net MVC project.

Thanks in advance,

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4642
    • View Profile
[ Only Pro members may read this post. ]
« Last Edit: November 29, 2019, 11:55:41 pm by paramvir »

fuljoyment

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Hi Again,

Even after using the above suggested listener code it was not working as expected.  After sometime(maximum 5 seconds) the loader is hiding before the file downloaded. I have tried to increase the interval time in the listener but no use. 

As I told you before I want to show the "Loader" image while data is getting ready to download and once file was downloaded I want to hide the "Loader".

PS:Currently I have 693238 records in my table.  I want to export all of them to different formats(csv/excel/json/html).  It would be very grateful for us if you suggest me better solution for this because it was an urgent fix for us.

Thanks in advance,

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4642
    • View Profile
[ Only Pro members may read this post. ]
« Last Edit: December 03, 2019, 08:04:14 pm by paramvir »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4642
    • View Profile
[ Only Pro members may read this post. ]

fuljoyment

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Hi there,
 :(

Again, even after using the above suggested listener code it was not working as expected.  Please let us know if you found the best fit solution (Or) if you implement any grid event for download complete . Mean while I will also try to find the best possible solution for this.

Thanks and waiting for the positive reply,

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4642
    • View Profile
[ Only Pro members may read this post. ]

fuljoyment

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Sorry we don't need Local Export. But I tried with one of your demo's.