0

I am a relative JavaScript beginner. I am comfortable working with documents (document.getElementById(...) and document.getElementsByTagName(...).. and other document querying functions.

I have been asked to create some sort of a table pagination library for my team. We don't use jQuery or any other third party libraries. So I would have manipulate the table dom or something like that to make it work. In this library, I would have to be able to

  1. set up flexible pagination (Number of rows to be displayed per page may be configured by using some sort of a text box) I took a look at some of the sources jQuery Pagination Plugin. But I can not understand it.
  2. The user should be able to navigate back and forth using some icons. The page number changed should be reflected in the configuration box.

I am not asking for solutions because I would learn to do this on my own. How can I start working on this issue?

Update after observations from nnnn

I am not sure what approach to take, as I had not considered that possibility. Most of the times, we have only about 2000 records to display. I guess if the load does not take too much memory, I would prefer to load before hand and then try to paginate it. Although, I will go with whatever is recommended.

halfer
  • 19,824
  • 17
  • 99
  • 186
Kartik
  • 2,541
  • 2
  • 37
  • 59
  • This might be a bit too big for Stack Overflow. Anyway, one design decision to make up-front: will the webserver return _all_ data up-front, and the your JavaScript will handle all paging with no further requests to the server, or will the paging scheme be front- and backend? If you will be requesting individual pages of data from the server each time the user clicks your icons will you do so with full page reloads or Ajax (or both depending on whether a user has JS enabled)? – nnnnnn Sep 09 '11 at 00:01

2 Answers2

0

If you want to implement your UI and just need an Object to handle pagination logic please see this library: https://github.com/pagino/pagino-js

Behnam
  • 6,244
  • 1
  • 39
  • 36
0

I would highly recommend taking a look at the jquery datatables plugin http://datatables.net/

frostmatthew
  • 3,260
  • 4
  • 40
  • 50