jqgrid server side error message/validation handling

Viewed 25393

In my json responses, I have 'STATUS' and 'errors' properties. How can use this errors properties with jqGRid. To parse all errors and show them in a dialog box.

Basically just check, if status:'ERROR' then display all errors.

Thanks!

2 Answers

To do what you're describing, the easiest way is to add custom properties to the data json object that is being retrieved by the jqgrid from the server. Then you can capture those custom properties with the loadComplete(data) event.

jQuery('#grid').jqGrid({
    loadComplete: function (data) {
        //access data.propertyname here
    }
});
Related