How to use Data Tables #JAVA #CODERS

in code •  7 years ago 

Hey steemitians, today I want to provide some information regarding use of Data Tables in our Java Code to those who never used that before but want to use it.

1.png

From Data Tables you can get the view of your jsp page as above and all these features by using data table's inbuilt properties.What we can do in that:

  1. global search
  2. filters to filter from the list through data tables
  3. number of entries you want to see on a page
  4. showing number of first and last entry on page that you opened
  5. you can go to any number of page by click on the page button below
  6. sorting data, and many more.

There are two types of tables we want to create on client side:

  1. Static data (static table>: Client requests for a table, server returns a Json contains definition for table and data (rows). This type is usually suitable if the database doesn't contain too many records.

2.Dynamic data (dynamic table): Client requests for a table, server returns only the definition of the table, and then the table itself will make an Ajax request to retrieve data, to serve this request server only returns a limited amount of data from database. This type is the best choice for the database which has thousand records.

The project requires dependencies:

datatableswapper-1.0.jar,
jackson-annotations-2.2.3.jar,
jackson-core-2.2.3.jar,
jackson-databind-2.2.3.jar

Require the following JavaScript and CSS libraries:

  1. js/data_table/reset-min.css
  2. js/data_table/complete.css
  3. js/data_table/jquery.dataTables.min.js
  4. js/data_table/jquery.dataTables.plugins.js
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!