Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finalizing editing in jqgrid

I using jqgrid with great succes in the following way:

  1. The data is loaded from the server as JSON
  2. The user do inline editing
  3. When a save-button is clicked all the data is serialized using:

    var data = $("#mygrid").getRowData();

    var datajson = JSON.stringify(data);

The problem with this aproach is that I will get the input elements in my json-data if the user has not pressed return or moved away from the edited cell. Is there any way to end edit mode i jqgrid?

like image 395
Bebben Avatar asked Jan 26 '11 13:01

Bebben


1 Answers

You can use saveRow to save the data.

To use saveRow you have to know the row id of the current editable row. You can for example save the rowid of the current editing in a variable (before you call editRow) and use the value for calling of the saveRow method.

UPDATED: see the demo. First select some row, modify the values and then click on the "Save current editing row" button. You will see that the changes will be saves.

like image 161
Oleg Avatar answered Sep 20 '22 13:09

Oleg