jqGrid , SpringMVC integration by : Mark Serano
Mark Serano has two good tutorials about integration spring with jqGrid . They are the best tutorial that I have ever seen.
The first one is simpler and it uses an array list for its persistence layer:
krams::: jqGrid and Spring 3 MVC Integration Tutorial
The second one is a more sophisticated and it uses Spring Data to implement DAO classes faster and it implements pagination feature effectively.
krams::: Spring MVC 3.1, jqGrid, and Spring Data JPA Integration Guide
Following is the code analysis of the first tutorial; you can click on each links in table below to view code.
The main idea of both tutorials is to convert data to JSON and then in the client we uses jqGrid component to show them in a nice grid.
|
1 |
Output |
|
|
|
|
What happens in background (we can use RESTClient utility to test what happen in the background) |
|
2 |
Model |
|
|
3 |
Service |
|
|
|
|
|
|
4 |
Configuration |
|
|
|
|
|
|
|
|
|
|
5 |
JSON |
|
|
|
|
|
|
6 |
Controller |
Controller :: Main |
|
|
|
Controller :: List |
|
|
|
Controller :: Edit |
|
|
|
Controller :: Add |
|
|
|
Controller :: Delete |
|
7 |
View |
|
|
|
|
|
|
|
|
JQuery :: Edit |
|
|
|
JQuery :: Add |
|
|
|
JQuery :: Delete |
RESTClient is a simple Desktop application for talking to RESTful web services. You can download this utility from this link: REST Client
Especial Thanks to Mark Serano
امیر حسین میثمی