• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Pagination

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everybody,
I am very new to javascript could any one help me out. I am retrieving data from data base and displaying data in 15 columns and i also sorted those records in javascript but now i need to do the pagination
to display 20 records in each page and i have to use JavaScript. Can any one help me out, by sending one example on this type of Pagination
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Raj80",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

Thanks,
Eric Pascarello
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to use JavaScript? Sounds strange to me. Where is the paging happening? Does it have all of the records at once or does it have to hit the server?

Eric
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the browser (using Javascript) is entirely the wrong place to doing this sort of thing.
[ February 06, 2006: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Bear Bibeault
, I have implemented pagination in a module at the DB level ... heres a snapshot . I am using DB2.

WITH TEMP (ROWNUM,DIM_VAL_CD, IS_ACTIVE_IND,SEQUENCE_NBR)as
(SELECT ROW_NUMBER() OVER(ORDER BY IS_ACTIVE_IND ,SEQUENCE_NBR ,UPPER(DIM_VAL_CD) ) ROWNUM,
DIM_VAL_CD,IS_ACTIVE_IND,SEQUENCE_NBR FROM
DIMENSIONVALUE WHERE DIM_TYPE_ID = ? ORDER BY IS_ACTIVE_IND ,SEQUENCE_NBR,UPPER(DIM_VAL_CD))
SELECT (SELECT MAX(ROWNUM) FROM TEMP ) TOTALROWS,
DIM_VAL_CD,IS_ACTIVE_IND,IS_APPROVED_IND FROM TEMP WHERE ROWNUM >? AND ROWNUM <=?
[ February 06, 2006: Message edited by: steveo austin ]
 
Bear Bibeault
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For non-DB2 databases, the syntac will be different. PostgreSQL, for example, employs the OFFSET and LIMIT keywords.
 
Venkata Kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,
Sorry for my late response. Let me explain what exactly i am doing.
I have nearly 100 records in my database and i am using JavaScript(client side)to sort these 100 records. Sorting is working fine but now i need to display these sorted records as 20 records per page
(for Ex |< < 1 2 3 4 .. > >|) i hope these explains the problem.
[ February 10, 2006: Message edited by: Gururaj ]
 
Bear Bibeault
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Gururaj", you have already been asked in this very topic to adjust your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are closed.

bear
JavaRanch Sheriff
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic