Javascript 尝试在MVC中关闭微调器
我试图找到一种方法,一旦动作方法弹出excel电子表格,即按钮单击完成其工作后,关闭微调器。我不能使用jQueryAjax来实现这一点,因为我的操作方法是返回FileContentResult。问题是,是否存在一个javascript事件,我可以挂接它来关闭微调器?如果你能为我指出正确的方向,我将不胜感激:)我已经在下面发布了一些代码 谢谢Javascript 尝试在MVC中关闭微调器,javascript,c#,model-view-controller,Javascript,C#,Model View Controller,我试图找到一种方法,一旦动作方法弹出excel电子表格,即按钮单击完成其工作后,关闭微调器。我不能使用jQueryAjax来实现这一点,因为我的操作方法是返回FileContentResult。问题是,是否存在一个javascript事件,我可以挂接它来关闭微调器?如果你能为我指出正确的方向,我将不胜感激:)我已经在下面发布了一些代码 谢谢 @model WorkflowSLAChaser_Search_Model @{ Layout = "~/Views/Shared/_L
@model WorkflowSLAChaser_Search_Model
@{
Layout = "~/Views/Shared/_LayoutReport.cshtml";
ViewBag.Title = "SLA Chaser Report";
}
<h2 id="title">@ViewBag.Title</h2>
<div>
@using (Html.BeginForm("SLAChaserReport", "Report", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
<br />
<p>Change Request Report in Microsoft Excel.</p>
<br />
<div id="spinner-target-area">
<div class="row">
<div class="form-group" style="padding:5px">
<div class="col-sm-2 col-md-2 col-lg-2">
<input type="submit" id="btnsearch" name="searchButton" value="Download SLA Chaser Report" class="btn btn-primary btn-xxxlge" />
</div>
</div>
</div>
</div>
}
</div>
@section scripts {
<script type="text/javascript">
$(document).ready(function () {
$('#btnsearch').click(function () {
$.fn.RunSpinner();
});
}
});
//$.fn.StopSpinner();
</script>
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SLAChaserReport(WorkflowSLAChaser_Search_Model model)
{
return new FileContentResult();
}
@model WorkflowSLAChaser\u Search\u model
@{
Layout=“~/Views/Shared/\u LayoutReport.cshtml”;
ViewBag.Title=“SLA追逐者报告”;
}
@视图包。标题
@使用(Html.BeginForm(“slacheserreport”、“Report”、FormMethod.Post、new{enctype=“multipart/formdata”}))
{
@Html.AntiForgeryToken()
Microsoft Excel中的更改请求报告
}
@节脚本{
$(文档).ready(函数(){
$('#btnsearch')。单击(函数(){
$.fn.RunSpinner();
});
}
});
//$.fn.StopSpinner();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult SlaChaser报告(工作流SlaChaser\u搜索\u模型)
{
返回新的FileContentResult();
}
让我们知道您使用的是什么“微调器”会很有帮助。例如,有一个spin.js和大量不同的微调器库。您提供的信息越多,我们就可以更快地帮助您。谢谢安德鲁,感谢您的回复。显然,我已经接管了某人的代码,所以请参见下面(function($){$.fn.RunSpinner=function(){$('#overlay').addClass(“show”)};$.fn.StopSpinner=function(){$('#overlay').removeClass(“show”)}(jQuery);我认为这有点像你隐藏和显示的CSS。@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}让我们知道你使用的是什么“微调器”会很有帮助。例如,有一个spin.js和大量不同的微调器库。您提供的信息越多,我们就可以更快地帮助您。谢谢安德鲁,感谢您的回复。显然,我已经接管了某人的代码,所以请参见下面(function($){$.fn.RunSpinner=function(){$('#overlay').addClass(“show”)};$.fn.StopSpinner=function(){$('#overlay').removeClass(“show”)}(jQuery);我认为这有点像你隐藏和显示的CSS。@关键帧旋转{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}