0

I have a jqGrid grid with an editable checkbox. I'm using cell editing mode.

When text fields are modified, the server is notified automatically. However, when the checkbox is checked or unchecked, the server is not notified. This answer suggests implementing the notification myself.

I can do that, but I'd rather not duplicate the logic already implemented in jqGrid - figuring out the update URL, building the POST data, etc...

Has anything changed in the years since that answer was given? Can a checkbox notify the server automatically?

Community
  • 1
  • 1
zmbq
  • 38,013
  • 14
  • 101
  • 171
  • There are many implementation options, but you should describe more detailed what you do (jqGrid option like `datatype`, `loadonce` etc, do you use cell editing of *local* data and you use local paging) and what behavior you want to have (do you want to have "save to server" button for example which get *current* values of `checkbox` column and send it to the server per one Ajax call). Why you don't want to post changes on one column immediately? It's default behavior and it's the best from the concurrency point of view if of editing data are possible by *multiple users*. – Oleg Apr 11 '14 at 22:54
  • @Oleg, I want all changes to be sent to the server as they are made, and this is what happens. I'm using celledit: true and cellsubmit: remote. datatype: json. I don't change loadonce from the default. Text changes are sent to the server immediately, my problem is having to send checkbox changes myself. – zmbq Apr 12 '14 at 20:32
  • Do you have grid with both text fields and checkbox? You wrote "When text fields are modified, the server is notified automatically". It's not absolutely correct. The user should press `Enter` at the end of modification of the text or one should click on another cell to send modification to the server. The same is for checkboxs or any other field type: if the user clicks on the cell it will be selected and cell editing will be started. If the user changed the value and then press `Enter` or click any other cell then the data will be sent to the server. – Oleg Apr 14 '14 at 14:30
  • If you need another behavior you should first described detailed what you need. jqGrid have `beforeSelectRow` and `onCellSelect` callbacks which allows to trace clicking on the cell. One can call `editCell` or `saveCell` to force starting cell editing or finishing sending with sending the data to the server. So you can implement any behavior which you need. One need just first specify exactly what you need. – Oleg Apr 14 '14 at 14:35

0 Answers0