Answer the question
In order to leave comments, you need to log in
Code example: filtered table using Thymeleaf and Spring (can be Boot), how to find?
I really want to study someone else's code for learning purposes. any filtering is needed, except for the Search bar, everywhere I find filtering only through it.
And I would really like to look at a table where there is sorting (a simple click on the table header or the like) and filtering (for example, buttons, a drop-down list, checkboxes, whatever).
Here is something like this:
At least in the most minimal implementation, I can’t find it on github, I’ve been sitting full time for the second day.
Please advise, I would be extremely grateful for your help.
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Well, here you should pay attention to 2 implementation options:
1) filtering / sorting on the client side using js. Those. data is sent from the server, and then this data is sorted on the client side
2) filtering / sorting on the server side. And the data is already given in a sorted form
. Sorting and filtering on the client side can be achieved using js.
Here is the finished product:
Data Tables -
sorting - https://datatables.net/examples/basic_init/table_s...
filtering - https://datatables.net/extensions/fixedheader/exam...
If you need server-side filtering and sorting in DataTables, then:
https://datatables.net/examples/data_sources/serve...
And here is a ready-made lib for Spring to work with DataTables. Filtering is also supported:
https://github.com/darrachequesne/spring-data-jpa-...
Here is a custom js sorting example
simple click on the table header
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question