• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to do pagination properly in jsp

 
Nikhitha Pai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have around 2000 records in mysql database which i need to display while loading the page in a table. I did pagination for that(5 records per page). But i get all the page nos listed below on the page which looks ugly. I want to display as 123...Next .How to do this logic?
The logic which displays the page numbers is as below:

 
Frederik Nielsen
Greenhorn
Posts: 14
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should take a look at https://datatables.net/

I am using that on my table in JSP.
There is tons of nice features like:
- sorting (asc/desc with icons for them and you can disable it for columns you dont want it on)
- dropdown with number of threads displayed on each page
- label that displays message like "Showing 1 to 10 of 69 entries" and when you go to next page it will show "Showing 11 to 20 of 69 entries"
- search (you can choose which fields sould be searchable and it can search in multiple)

You can also customise the look of it.
Takes a little time to learn to use, but when you have it under control you will never go back to a non jQuery powered table

The sky is the limit.
I have also added images and update and delete buttons in mine that works perfectly fine.

jQuery for the win!
 
Nikhitha Pai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much for replying.. I was not even aware of Data Tables.Definitely i am going to give it a shot..
Will post queries after doing that..
Thank you .

 
Nikhitha Pai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Fredrick for the suggestion. I have used Datatables feature in my project and it is wonderful. Thank you so much
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!