d512
d512

Reputation: 34113

jqGrid Enter key before save handler

I am using jqGrid 3.8.1 with inline edit mode. Users are currently allowed to hit the Enter key in order to save a row. I would like to let them continue to do this, but I need to do some data validation (including a call to the server) before they can be allowed to save the row. Is this possible? I don't see anything like a "beforeSaveRow" function that gets called in this case.

Upvotes: 0

Views: 279

Answers (1)

Oleg
Oleg

Reputation: 221997

Server side validation is the part of saving the changes. The server get the modified data and it can send back HTTP response with some error HTTP code (some value higher or equal to 400). One can include the description of the error in the body of the HTTP response. jqGrid will display the error message and the user can continue the editing. One can use additionally errorfunc callback of inline editing to decode the server response holding the error and to convert it to some another HTML fragment.

Upvotes: 1

Related Questions