标签:method page port false cti style one message pos
$("#CreateReport").click(function () {
// RptID,Template,TemplateType,FileName
var RptID = $("#gridList").jqGridRowValue().RptID;
var Template = $(‘#‘ + RptID + "_Template").val();
var TemplateType = $(‘#‘ + RptID + "_TemplateType").val();
var FileName = $("#gridList").jqGridRowValue().FileName;
if (Template == "" || Template == undefined) {
$.modalAlert("报告模版还未选择,请点击报告模版选择", ‘error‘);
return false;
} else if (Template == "请选择报告模版") {
$.modalAlert("请选择正确的报告模版", ‘error‘);
return false;
} else {
$.ajax({
url: "#",
data: {
RptID: RptID,
Template: Template,
TemplateType: TemplateType,
FileName: FileName
},
async: true,//必须是异步加载的
method: "POST",
beforeSend: function () {
$(‘#loadingPage‘, parent.document).css("display", "block");
},
success: function (result) {
var result = JSON.parse(result);
if (result["state"] == "success") {
$.modalAlert("成功生成报告,请在已出报告查看", ‘success‘);
$.currentWindow().$("#gridList").trigger("reloadGrid");
} else {
$.modalAlert(result.message, ‘error‘);
}
},
complete: function () {
$(‘#loadingPage‘, parent.document).css("display", "none");
},
error: function () {
$.modalAlert("出错了", ‘error‘);
}
})
}
})
ajax 未加载出数据时,显示oding,数据显示后,隐藏loading
标签:method page port false cti style one message pos
原文地址:https://www.cnblogs.com/quitpoison/p/9802044.html