tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

delGridRow errorTextFormat option wont effect when del option returns 500 error #1062

Open lonelystellar opened 5 months ago

lonelystellar commented 5 months ago

Since v5.8.2,the del operation button click event in delGridRow function wont effect when server returns 500 error.

In v5.8.1 delGridRow function code sinppet like bellow:

$("#dData","#"+dtbl+"_2").click(function(){
...
var ajaxOptions = $.extend({
  url: rp_ge[$t.p.id].url || $($t).jqGrid('getGridParam','editurl'),
  type: rp_ge[$t.p.id].mtype,
  data: $.jgrid.isFunction(rp_ge[$t.p.id].serializeDelData) ? rp_ge[$t.p.id].serializeDelData.call($t,postd) : postd,
    **complete**:function(data,status){
...

Works fine with any server error returns.

But since v5.8.1, this ajax complete funciton became to success. And that will not effect when server returns error. Based on jquery ajax function definition, the server errors occured will only calls error function instead of success.

tonytomov commented 5 months ago

Hello,

We changed this because of server latency. In most times the complete event causes a lot of delay which is not acceptable in certain situation. For this purpose in jqGrid code we changed to use only success event in all ajax requests.

As you say server errors should be catch in error ajax request, which we do.