Twitter

duminică, 31 iulie 2016

PrimeNG DataTable Lazy pagination (and sorting) and Spring Data Rest (HATEOAS) via Hibernate JPA

We suppose that we have a simple table that contains the products from figure below:


Further, we expose the data from this table via Spring Data REST. So, a request of type: http://localhost:8080/SHPaginating/items/?size=5 will produce a JSON response as below:


Now, we want to use PrimeNG DataTable Lazy to display data using pagination and sorted by item name as below:


And some HATEOAS information that you can use for further implementations:


The complete example is available here. First, you need to run npm install in \SHPaginating\src\main\webapp.  The app is a WAR that can be tested under e.g. Payara.

Niciun comentariu:

Trimiteți un comentariu