There is very nice web component for tabular data - jqGrid http://www.trirand.com/blog/
When I had to use it with Spring and Hibernate, I found several tutorials on how to do that.
http://krams915.blogspot.com.au/2012/01/spring-mvc-31-jqgrid-and-spring-data_8761.html
http://krams915.blogspot.com.au/2010/12/jqgrid-and-spring-3-mvc-integration.html
http://nisargpathak.blogspot.com.au/2014/02/spring-mvc-with-jqgrid-simplified.html
But neither of them can make use of filtering jqGrid feature. So I will decribe how to add filtering to abovementioned example of krams915.
First, we introduce JqGridSearchField class. It is fairly simple POJO that represents one filtering condition and has method criterion() that returns condition as org.hibernate.criterion.Criterion
( Read more... )
Now, we can add JqGridSearch template.
( Read more... )
We use it as parent for classes like JqGridSearchUser.
( Read more... )
Now JqGridSearchStaffPositionElem has class info on User. User is hibernate Entity and we can easily map it on DB.
JqGridSearch will take care of both transient and non transient fields.
Now all filtering is done by this snippet
( Read more... )
When I had to use it with Spring and Hibernate, I found several tutorials on how to do that.
http://krams915.blogspot.com.au/2012/01/spring-mvc-31-jqgrid-and-spring-data_8761.html
http://krams915.blogspot.com.au/2010/12/jqgrid-and-spring-3-mvc-integration.html
http://nisargpathak.blogspot.com.au/2014/02/spring-mvc-with-jqgrid-simplified.html
But neither of them can make use of filtering jqGrid feature. So I will decribe how to add filtering to abovementioned example of krams915.
First, we introduce JqGridSearchField class. It is fairly simple POJO that represents one filtering condition and has method criterion() that returns condition as org.hibernate.criterion.Criterion
Now, we can add JqGridSearch template.
We use it as parent for classes like JqGridSearchUser.
Now JqGridSearchStaffPositionElem has class info on User. User is hibernate Entity and we can easily map it on DB.
JqGridSearch will take care of both transient and non transient fields.
Now all filtering is done by this snippet