Solved

Page preloader when large amounts of data are loading.

Posted on 2007-11-26
2
520 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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

24 Experts available now in Live!

Get 1:1 Help Now