Help coderanch get a
new server
by contributing to the fundraiser
  • 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Unable to do pagination properly in jsp

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Greenhorn
Posts: 14
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic