Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigate via (First | < Prev | Next > | Last) 1

Status
Not open for further replies.

feshangi

MIS
Nov 24, 2004
265
US
I would like to have navigational links above my site to navigate between "pages" (not rows).

"First" should take the visitor to the first page.
"Last" should take the visitor to the last page.
and so on...

I have part of the code which is not designed for per page purposes and is designed for per row.

Can someone please help me to modify it and make it for per page usage?

For instance if I click on "Last", instead of taking me to the last page (which should have 3 rows in there), it takes me directly to the last row (with 1 row in there).

Code:
<!--- set next back variables --->
					    <CFSET RowsPerPage = 10>
					    <CFPARAM NAME="URL.StartRow" DEFAULT="1" TYPE="numeric">
						<!--- We know the total number of rows from query   --->
						<CFSET TotalRows = GetResult.RecordCount>
						<!--- Last row is 10 rows past the starting row, or --->
						<!--- total number of query rows, whichever is less --->
						<CFSET EndRow = Min(URL.StartRow + RowsPerPage - 1, TotalRows)>
						<!--- Next button goes to 1 past current end row  --->
						<CFSET StartRowNext = EndRow + 1>
						<!--- Back button goes back N rows from start row --->
						<CFSET StartRowBack = URL.StartRow - RowsPerPage>
						<!--- end set next back variables --->
						<CFSET DisplayingCount = TotalRows-URL.StartRow>
						<CFIF DisplayingCount GT 10>

						</CFIF>
 
Have you checked the Macromedia exchange for such display codes?

 
great suggestion. i'll check it out and let you know.

thanks for the reply.

mike
 
i found CF_RecordSetBrowser but this one doesn't help me with last and first navigation.
 
these are great. i think cf_pagelist would work for me. i'll keep you posted. thx again.
 
unfortunately none of them have last and first function
 
CF_PageList worked exactly how I wanted it. thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top