问题描述
代码如下,对数据操作后刷新无效functionSave(){vartypeid=$("#ddlContract").combobox('getValue');vartypename=$("#ddlContract").combobox('getText');varddlBreedsid=$("#ddlBreeds").combobox('getValue');varddlBreedsname=$("#ddlBreeds").combobox('getText');if($('#hid1').val()=="1"){$.ajax({type:"post",url:"../BaseInfo/BaseInfo.ashx?action=add",dataType:"text",async:false,data:{txtFileName:$("#txtFileName").textbox('getValue'),txtDesc:$("#txtDesc").textbox('getValue'),zas:"新增模板信息",tableName:"FileTemplate",typeid:typeid,typename:typename,ddlBreedsid:ddlBreedsid,ddlBreedsname:ddlBreedsname,},dataType:"text",success:function(text){alert(text);$("#tbUsers1").datagrid('load');$('#ADD').window("close");}});}elseif($('#hid1').val()=="2"){$.ajax({type:"post",dataType:"text",url:"../BaseInfo/BaseInfo.ashx?action=udapte",async:false,data:{id:$("#did").val(),txtFileName:$("#txtFileName").textbox('getValue'),txtDesc:$("#txtDesc").textbox('getValue'),zas:"修改模板信息",tableName:"FileTemplate",typeid:typeid,typename:typename,ddlBreedsid:ddlBreedsid,ddlBreedsname:ddlBreedsname,},dataType:"text",success:function(text){if(text=="修改成功!"){$("#tbUsers1").datagrid('load');$('#ADD').window("close");}else{alert(text);}}});}}
解决方案
解决方案二:
$("#tbUsers1").datagrid('reload');//试试,另外注意一下jqueryeasyui的版本是否支持你的浏览器,换个浏览器再试试
解决方案三:
$("#tbUsers1").datagrid('reload');试过无效。火狐360IE都没用