0

I have an JSP, servlet application where I am using a java dashboard to display the grid data. For a specific project, I want to use the editable slickgrid. I have successfully integrated the grids to display data. But now, I need to send/post the data back to the servlet for processing. I referred to the question here Saving changes in SlickGrid and tried using the solution. But the script doesn't send any data to the servlet. At the servlet, when I collect the parameters passed and print them, I get:

In Test Data Input event.

   1)event : TestDataInput
   2)data :  

If I modify the script line: $("input[name='data']").val($.JSON.stringify(grid.getData())); to $("input[name='data']").val(grid.getData()); a lot of [object, object] variables are posted and collected in the servlet.

Can you tell me where am I making a mistake? Thanks all in advance.

Community
  • 1
  • 1
Saurabh
  • 19
  • 2
  • any wrong with `$("input[name='data']").val($.JSON.stringify(grid.getData()));`? `grid.getData()` is an array. You have to translate it to string using `JSON.stringify(array||object)`. if `$.JSON.stringify()` dont work – winghei Sep 13 '16 at 18:20
  • It worked. All I did was assign the array returned by `grid.getData()` to a variable `var strdata=grid.getData();` and then passed it to the function. Don't understand why though? – Saurabh Sep 17 '16 at 08:53

0 Answers0