jqgrid not reloading after making a ajax call using trigger('reload')

让人想犯罪 __ 提交于 2019-12-01 07:17:37

What I see here is an Ajax call to post and another to reload the grid. The problem here is Which ajax call will finish first?. You dont know. Your best bet would be to use the success call back function in the Ajax post. This will reload the grid if and only if the post was successful.

jQuery("#relCasePick").click( function(){ 

  var ids =jQuery("#list10").jqGrid('getGridParam','selarrrow'); 

   $.ajax({ 
     type: "POST", 
     url: "/cpsb/unprocessedOrders.do?method=releaseToCasePick&orderNumbers="+ids, 
     data: JSON.stringify(ids),  
     dataType: "json",
     success: function(data) {
       jQuery("#list10").setGridParam({rowNum:10,datatype:"json" }).trigger('reloadGrid'); 
     }
  }); 
});  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!