In jqGrid do I have to manually call saveRow to trigger an ajax save request

jqgrid

The documentation here is not very clear:

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing&s[]=editurl#saverow

Do I have to manually make a saveRow call after the user finishes editing a table cell/row, or will jqGrid automatically trigger saveRow when the row (cell?) loses focus?

I'm giving jqGrid a editurl value in the initial setup, but I don't see any ajax requests going out when I finish editing a row.

Best Solution

You have two options:

  1. You use editRow with the parameter keys: true. In the case the method saveRow will be called if the user press Enter and the method restoreRow will be called if the user press Esc. In the case you don't need to call saveRow explicitly. Inside of onSelectRow one calls typically restoreRow see here an example.
  2. You can call saveRow instead of restoreRow in the onSelectRow callback. Additionally (or alternatively) you can gives the user an interface to save current editing row. It can be some kind of "Save" button.
Related Question