Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

show large data in grid view on jsp page  RSS feed

 
sanket jani
Ranch Hand
Posts: 47
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone
i am working on one web application and it contain the 50000 data into the database .

i have tried jquery data table to show data but no help from it .

is there any way to display such large amount of data ??
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use DataTables for this purpose all the time. It can be tricky to use but it works great once you get it setup correctly. Tell us exactly what went wrong and what you expected. Show us some code.
 
sanket jani
Ranch Hand
Posts: 47
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
following is the code .
and it also crashed cause of the list contain 50000 data inside it



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really think that it is useful to show that much data to a user at a time?
 
sanket jani
Ranch Hand
Posts: 47
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it is .
we can use pagination but still it is crashed
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, get rid of the scriplets and use JSTL. Second, use DataTables in server-side mode so it only returns the records that need to be displayed. It's crazy to try and display 50,000 records.

Since you are not letting DataTables build the table for you, does the plain html table load without attempting to apply DataTables formatting to it?

In my opinion, you are going about this backwards. You are building the html table and then applying DataTables formatting. That works fine for small tables of a few hundred records. In this case, you should let DataTables build the table for you from a JSON response.

When I use DataTables, the jsp file looks like this:

Then the JavaScript looks something like this:

Note that this is an older version of DataTables. The naming of options and such has changed in the lastest version, but it's still backwards compatible with this style with the Hungarian notation.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not intended to be a solution for your problem. It's just an example of how DataTables is used in server mode. You still have to write the servlet and dao to return the data and so on. This is just a starting point. Barely.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!