Pagination

Hello Everybody,

I am very new to javascript could any one helpme out. I am retrieving data from data base and displaying data in 15 columns and i also sorted those columns in javascript but now i need to do the pagination

to display 20 records in each page and i have to useJavaScript only. Can any one help me by sending one example on this type of Pagination ....

[393 byte] By [raj80a] at [2007-10-2 9:24:50]
# 1
U can make a function passing the no. of records per page and one index(total num of records/number of rec. per page) increase the index in each call.Hope this will help u.
shk.screena at 2007-7-16 23:31:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

You need to think carefully about this...

Lets say you have 10,000 x 1KB records in your database that need to be paged. If you retrieve them all and attempt to sort them / paginate them using only Java Script, then that's 10 MB you need to drag across the internet, load into the clients web browser, paginate and sort. That's going to be one unusable web site!

The common alternative is to do the sorting / pagination on the server based on URL parameters and send only the data for a single page back to the client. This can prove faster, but could require a more powerful server, and means the user has to make an HTTP request each time they want a different view of the data.

The latest trend for solving this type of problem is something called AJAX. Unfortunately I can't help with this, since the only thing I really know about AJAX is how to spell it!

Good luck.

SteveNaivea at 2007-7-16 23:31:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...