I am designing an intranet application with Spring MVC3. I have to create a JSP page which has a data grid which is populated form the database and user and can add rows in the JSP data grid. I was considering the following two options:
- To use javascript function to add a row on an "Insert Row" button
- To submit the form on "Insert Row" button, go to Controller and return a model attribute with an extra row.
I am more bent towards the controller approach, as I feel I have better control on the datatable in the controller.
Can you please suggest which would be a better approach considering some of cells of the new row may need to be set with some default value.
Please note that I cannot use jQuery or any other javascript library.