Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-27-2013, 06:37 PM   PM User | #1
chellert
New Coder

 
Join Date: Mar 2012
Location: Ontario, Canada
Posts: 47
Thanks: 8
Thanked 0 Times in 0 Posts
chellert is an unknown quantity at this point
Multipage View from Database

Hello

I am pulling information from a database and want to view only 8 items on the page and the have Page 1 of xx so when I click Next it will show the next 8 items.

Does anyone have a good place that I can go and read up on how to achieve this?
chellert is offline   Reply With Quote
Old 02-27-2013, 07:36 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
Google "pagination".
__________________
^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
*
The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
WolfShade is online now   Reply With Quote
Old 02-27-2013, 09:24 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by chellert View Post
Does anyone have a good place that I can go and read up on how to achieve this?
You really ought to populate that information using whichever server side language you are using to create the pages. It is not something you should be considering using JavaScript for.

Basically when you do the query on the database one of the pieces of information that you will have available to you will be the number of entries returned in the results. Alternatively if you are going to limit the query to the number of entries that will be displayed on the page you'd do a second database query specifically to count the total results. You'd only need to do this extra call once. You can then pass the information about which page is to be displayed and how many pages there are in total when the previous or next button is pressed to request a new page.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Tags
database, multiple page

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:18 PM.


Advertisement
Log in to turn off these ads.