jqGrid的使用触发器做一个AJAX调用后不能重装('重装') [英] jqgrid not reloading after making a ajax call using trigger('reload')

查看:169
本文介绍了jqGrid的使用触发器做一个AJAX调用后不能重装('重装')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重新加载新的数据网格这是刚刚被改变,从而使用户可以看到新的数据并进行修改。

I am trying to reload the grid with new data which is just been changed , so that user can see the new data with modification .

我的方法:

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"
   });

   jQuery("#list10").setGridParam({rowNum:10,datatype:"json"}).trigger('reloadGrid');
}); 

当我点击这个按钮..我正确地发送数据,但是当我重装了不更新新的数据....我真的AP preciate如果有人能帮助..

when I am clicking this button.. I am sending the data correctly but when I am reloading its not updated with new data....I will really appreciate if someone can help ..

推荐答案

我在这里看到的是一个Ajax调用后,另一个以重新加载网格。这里的问题是哪一个Ajax调用会先完成?你不知道。你最好的选择是使用成功的回调函数在阿贾克斯后。这将刷新网格当且仅当成功发布。

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'); 
     }
  }); 
});  

这篇关于jqGrid的使用触发器做一个AJAX调用后不能重装('重装')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆