0

Using jqGrid (4.4) with Grails (2.0.3).

I have a grid with checkbox columns. Data is local and not using Grails editUrl property to submit data. I'm submitting the entire page to the backend controller using a regular submit button.

Here's the rub ... Say the grid contains 5 rows and the 5 checkboxes (indexes 0-4) have values of (true, false, true, true, false). What gets to the controller via the params map is an array of 3 checkbox values, all true with indexes 0, 1, 2. So, only the 'true' values are passed to the controller, but I have no idea which row they belong to.

Please advise. Thanks in advance.

emiles
  • 739
  • 1
  • 10
  • 17

1 Answers1

0

Not specific to grails, this is just a common html/webdevelopment question.

  1. Unchecked checkboxes aren't sent to the server when form is submitted.
  2. And you dont have to keep the submitted value of a checkbox to true, you can use any custom value (the value attribute) and then on server you can identify which checkboxes where checked based on the values

See this thread as well

Community
  • 1
  • 1
Sudhir N
  • 4,008
  • 1
  • 22
  • 32
  • Thanks. Makes sense, now. The grails tag renders an html checkbox input as well as a hidden tag (with a '_' prefix) to submit the 'off' value. So, you get values in both cases. However, I'm not using the tag in this case, so what I was used to was not happening. Thanks again. – emiles Aug 16 '12 at 20:27