By Michael Bradley, CorasWorks Professional Services Consultant
While not a complete game stopper since you can simply select “No” and let the script continue running, most users would select “Yes” to stop the script and return to the report. Of course the report would be incomplete since the recalculation function had not finished its job of updating the report. Add to this the delays and apparent slow performance of the report and a new strategy needed to be applied to the recalculation function of the report.
var t = setTimeout (recalcFunction(tbodyID),0);
or, more generically:
var id = setTimeout (fn, delay);
What’s going on here is that I am assigning the setTimeout() function to a variable ‘t’, that will store the unique ID for the timer. Within the setTimeout() function I tell it to run my recalcFunction() with the id of the tbody tag that I want the recalc to update as a parameter and that I want to wait “0” milliseconds before doing so. Adding this one line of code to the logic of the report after a user applies a filter to narrow the report’s results, greatly improved the performance of the report within IE8 resulting in a “win” for this solution.