这真的让我抓我的头。也就是说,它只发生在IE,而不是Firefox,我的印象是,jQuery是有效的浏览器中立。我在过去几个小时里一直在这个东西开裂,并且已经钉住了,至少,发生了什么。
这个jqGrid:
$("#DocumentListByPartRecordsGrid").jqGrid(
{
datatype: 'local',colNames: ['Id','Document Name','Document Type','Effective Date','Expiration Date','Delete'],colModel: [
{ name: 'ASSOCIATION_ID',Index: 'ASSOCIATION_ID',resizable: true,align: 'left',hidden: true,sortable: false },{ name: 'FILE_NAME',Index: 'FILE_NAME',sortable: false,width:'20%' },{ name: 'DOCUMENT_TYPE',Index: 'DOCUMENT_TYPE',{ name: 'EFFECTIVE_DATE',Index: 'EFFECTIVE_DATE',{ name: 'EXPIRATION_DATE',Index: 'EXPIRATION_DATE',{ name: 'Delete',Index: 'Delete',align: 'center',],rowNum: 15,rowList: [15,50,100],imgpath: '/Drm/Content/jqGrid/steel/images',viewrecords: true,height: 162,loadui: 'block',forceFit: true
});
填写此功能:
var mydata = '';
var mydata = ;
for (var i = 0; i <= mydata.length; i++){
jQuery("#DocumentListByPartRecordsGrid").addRowData(i,mydata[i],"last");
}
这是从模型干净地填充。这不是问题。使用删除功能时会出现此问题,它在控制器中格式化为:
function PCDocumentDelete(id,pcid) {
if (confirm("Are you sure you want to delete this document?")) {
$.blockUI({
message: "Working...",css: {
background: '#e7f2f7',padding: 10
}
});
$.ajax(
{
url: '/DRM/Pc/DeleteAssociation?associationId=' + id + '&pcid=' + pcid,async: true,dataType: "json",success: function(result) {
if (result.Success == true) {
//Reload grid
$.ajax({ async: false });
$("#DocumentListByPartRecordsGrid").setGridParam({ url: "/Drm/Pc/DeAssociatePartRecordsWithDocument?pcid=" + pcid,datatype: 'json',myType: 'GET',page: 1 });
$("#DocumentListByPartRecordsGrid").trigger("reloadGrid");
$.unblockUI();
$.showGlobalMessage('Specified document has been successfully disassociated from this part record.');
}
else {
$.unblockUI();
$.showGlobalMessage('An error occurred deleting the attachment.');
}
},error: function(res,stat) {
alert(res.toString());
alert(stat.toString());
}
});
return false;
}
else {
return false;
}
}}
(showGlobalMessage是一个内部函数,创建一个特别格式化的blockUI)
ajax在控制器中调用一个方法,但是在我们把它做得很远之前就出现了问题,所以除非有人认为它很重要,否则我不会发布该代码。发生什么,经常由于莫名的原因,调用PC / DeleteAssociation的第一个ajax突发返回304(未修改)响应。我知道发生在一个get当没有什么改变,需要刷新。但这不是一个get,它应该被视为一个职位,我的印象是,jquery.ajax设计,除非另有指示,不产生304反应。我显然缺少这里的东西,并一直盯着它太长时间赶上自己。任何人看到我错过了什么?谢谢。
716

被折叠的 条评论
为什么被折叠?



