How to use Data Tables #JAVA #CODERS
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.
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:
- global search
- filters to filter from the list through data tables
- number of entries you want to see on a page
- showing number of first and last entry on page that you opened
- you can go to any number of page by click on the page button below
- sorting data, and many more.
There are two types of tables we want to create on client side:
- 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:
- js/data_table/reset-min.css
- js/data_table/complete.css
- js/data_table/jquery.dataTables.min.js
- js/data_table/jquery.dataTables.plugins.js