How can I get JQGrid to recognize server sent Errors?

Viewed 27663

I have a jqgrid that's functionning very well.

I was wondering is it possible to catch server sent errors ? how Is it done ?

8 Answers

You can use the loadError event in jqGrid definition (see documentation). E.g.:

//Catch errors
loadError = function(xhr, textStatus, errorThrown)  {
    var error_msg = xhr.responseText        
    var msg = "Some errors occurred during processing:"
    msg += '\n\n' + error_msg
    alert(msg)
    }
Related