• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Google style record navigation

LEGEND ,
Sep 05, 2007 Sep 05, 2007

Copy link to clipboard

Copied

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







TOPICS
Advanced techniques

Views

454

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 06, 2007 Sep 06, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 09, 2007 Sep 09, 2007

Copy link to clipboard

Copied

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>






"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fbp032$fsk$1@forums.macromedia.com...
> 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.
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 10, 2007 Sep 10, 2007

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 10, 2007 Sep 10, 2007

Copy link to clipboard

Copied

LATEST
Grizzly, thats exactly what i was looking for. thanks so much

not I just have to give it a go!!


"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fc3qsp$n6p$1@forums.macromedia.com...
> Perhaps you'll find this article useful:
> http://www.webveteran.com/blog/index.cfm/2007/2/22/Pagination-with-ColdFusion-and-MSSQL-faux-MySQLs-...
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation