remo
remo

Reputation: 3484

jqgrid : Validate on serverside for editing a row

I am using Jqgrid with MVC2. It looks like the grid doesn't care for server side validation, say we need to save the data to Database and there is a error while inserting data.

We need to be able to show an error message saying there is error while edit at server level, is it like possible? Any examples/comments?

Upvotes: 0

Views: 2312

Answers (1)

Oleg
Oleg

Reputation: 221997

I recommend you that the server return allays an error HTTP code in case of validation error or any other errors (see for example here for more information). In the case you should use errorfunc parameter of the editRow function and not the succesfunc. It is the common rule. So I recommend you to define loadError event handler in every jqGrid which get any data from the server. In the same way you should use errorTextFormat in case of form editing and errorCell in case of cell editing.

Upvotes: 2

Related Questions