Solved

Page preloader when large amounts of data are loading.

Posted on 2007-11-26
2
530 Views
Last Modified: 2013-12-24
I have several complicated report with large <Cfquery's
I need a page preloader, as they can take several seconds to load.
i have tried the java ones, however they start after the CFQuerys

any ideas how to get  a preloader to work
0
Comment
Question by:kleigh
2 Comments
 
LVL 23

Expert Comment

by:debuggerau
ID: 20355579
display a page with a query to load the report into the next page would just require javascript.

After a few seconds load this page........
http://www.tizag.com/javascriptT/javascriptredirect.php
0
 
LVL 9

Accepted Solution

by:
digicidal earned 500 total points
ID: 20370267
What I have done is created a <DIV> that contains the loading page display, and then a second div that contains the rest of the page with the report in it.  Use CFFLUSH in between to force the first part of the page to display immediately... that will cause the loading DIV to display... and the rest of the page to process... then at the bottom of the page (the very bottom) add a javascript function to make that display div invisible.

I haven't actually used it for queries, but there are examples of this in the CFFLUSH documentation, however I have used it where I had a great deal of DHTML being done for a huge record set that had collapseable/expandable regions in the output.  Essentially I made an expand and collapse function for each header row as well as 4 dynamic functions controlling inline calls for each record to popup images of invoices, purchase history, stats, etc..  Since this because a HUGE page on large record sets it would appear that the browser had timed out - but it was actually still downloading the page text itself.   Because this took 20secs to 2mins depending on the browser and machine used to view the page, I added the loading div.  Here's a (truncated) example:
<div id="pleaseWaitMsg" align="center" style="padding:10px; border:2px solid #FFCC00; font-size:12px;">Please be patient... Preparing Display.</div>

<div class="label_2">Billing Documents</div>

	<div style="margin-top:3px; margin-bottom:3px;">

	<script language="javascript">

	// HERE I DO ALL OF MY TOP LEVEL FUNCTIONS.

	</script>

	<cfoutput query="qMyQuery.BillingData" group="CustomerName">

		<script language="javascript">

		// HERE I DO ALL OF MY SECOND LEVEL DYNAMIC JAVASCRIPT FUNCTIONS.

		</script>

		<div>

			<!--- Header (Cust) Grouping Data Output--->

		</div>

		<cfoutput>

			<script language="javascript">

			// HERE I DO ALL OF MY RECORD LEVEL DYNAMIC JAVASCRIPT FUNCTIONS.

			</script>

			<div>

				<!--- Individual ROW output for this group--->

			</div>

		</cfoutput>

	</cfoutput>

	</div>

<script language="javascript">

	document.getElementById('pleaseWaitMsg').style.display="none";

</script>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CGI takes almost 2 minutes to load using thttpd 20 44
Running Guacamole on port 80 5 156
Systems talking to each other 5 125
How code a 301 redirect for folder files -> 1 file 2 21
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now