Click here to Skip to main content
16,004,574 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am calculating interest so it takes time more than 10 minutes to 1 hour, so i want to show the pop up with image rotating with text details till the calculation is complete.
After the calculation is complete auto close the popup.

Also during the popup is loading i want to update the popup text from database too if posible with showing remaining and calculated detai.

What I have tried:

I could not complete. Please help me with sample code or example.
Posted
Updated 20-Jan-17 1:15am
Comments
PeejayAdams 20-Jan-17 6:47am    
I'd start by addressing the issue of why it's taking so long to perform the calculation.
[no name] 20-Jan-17 12:37pm    
It takes long time because there are more than 30000 saving account and we have to calculate the the interest for the period of 3 months with daily balance.
Richard Deeming 20-Jan-17 9:11am    
Users on the web are fickle. There's no way anyone's going to wait 10 minutes for your site to "calculate interest", let alone an hour!

As Peejay said, why is your calculation taking so long?
[no name] 20-Jan-17 12:37pm    
It takes long time because there are more than 30000 saving account and we have to calculate the the interest for the period of 3 months with daily balance.
PeejayAdams 23-Jan-17 4:31am    
That really is ridiculously slow, such things should be measured in milliseconds rather than minutes. Tempting as it might be to paper over the cracks, it really is unreasonable to expect the user to wait for that long - someone really needs to address the performance issue or you won't have 30,000 accounts for very long.

1 solution

Okay,so your requirement is:
Display popup while calculation is going on with the remaining calculation detail.
Well, this code is just showing the popup with a message before ajax progress starts.And show the calculated details at success.And on completion of ajax call,hides the popup.
showPopup("Calculation is under process!");
$.ajax({
    type: "POST",
    url: "url of the web service where you are calculating",
    data: //data goes here
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (response) {
        if (response.d.Code == globalItem.WebServiceStatus.Success) {
         showPopup(response.d.ResponseItem[0]);
        }
    },
    error: function (jqXHR, exception) {
      //your exception message code here
    },
    complete: function () {
      hidePopup();
    }
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900