Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

Google style record navigation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bj - 06 Sep 2007 05:45 GMT
hi,

I have a previous / next record navigation on my coldfusion pages. Id like
to create a navigation tool similar to the google format where users can
jump around records. eg:   Result Page: 1 2 3 4 5 6 7 8 9 10 Next

Does anybody have good code or a tutorial with advice on how to create this?

Thanks
GArlington - 06 Sep 2007 09:41 GMT
> hi,
>
[quoted text clipped - 5 lines]
>
> Thanks

"coldfusion pagination" is good search phrase for Google, will give
you a lot of hits.
Grizzly9279 - 06 Sep 2007 14:41 GMT
The problem is there are a hundred different ways to go about doing this.  How
are you currently querying your data, and what DBMS are you working with?  
Each DBMS has its own best-practices on paginating queries.
bj - 09 Sep 2007 23:52 GMT
I currently use a MS SQL Database, with a << previous | next >> reocord
navigator. But the problem is users cant jump back to the start or end
without paging through all the results. heres my current code

<!------Number of records to display---------->
<cfparam name="StartRow" default="1">
<cfparam name="MaxRows" default="8">

<cfset Previous=Val(StartRow)-Val(MaxRows)>
<cfset Next=Val(StartRow)+Val(MaxRows)>

<!---------Calculate variable for display  xx-xx of total records-------->

<cfset display=StartRow+MaxRows-1>
<cfif #display# gt query.recordcount>
<cfset display=query.recordcount>
</cfif>

<!----- Previous/next buttons--------->

<cfoutput>Products #StartRow# - #display# of
#query.recordcount#</cfoutput><br />
<cfoutput><cfif Previous GT 0>
<a
href="#client.URLtemplates#/security_locks.cfm/hurl/StartRow=#Previous#/security_locks.cfm">??
BACK</a>
</cfif></cfoutput><cfoutput>
<cfif Next LTE query.recordcount>
 <a
href="#client.URLtemplates#/security_locks.cfm/hurl/StartRow=#Next#/security_locks.cfm">|
NEXT ??</a>
</cfif></cfoutput>

> The problem is there are a hundred different ways to go about doing this.
> How
> are you currently querying your data, and what DBMS are you working with?
> Each DBMS has its own best-practices on paginating queries.
Grizzly9279 - 10 Sep 2007 17:20 GMT
Perhaps you'll find this article useful:
http://www.webveteran.com/blog/index.cfm/2007/2/22/Pagination-with-ColdFusion-an
d-MSSQL-faux-MySQLs-LIMIT-XY

bj - 10 Sep 2007 23:11 GMT
Grizzly, thats exactly what i was looking for. thanks so much

not I just have to give it a go!!

> Perhaps you'll find this article useful:
> http://www.webveteran.com/blog/index.cfm/2007/2/22/Pagination-with-ColdFusion-an
d-MSSQL-faux-MySQLs-LIMIT-XY

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.