阻止 ui 运行得太快
下面是我在 asp.net MVC 应用程序中调用操作的 Jquery 函数。在控制器操作中,我正在加载部分视图,该视图加载在 div“结果”中。在控制器操作中,我正在执行数据库操作并使用这些数据加载网格...但是我们有大量记录,这需要时间(例如,对于不同的情况,需要 1-10 分钟)。
为了更好的用户体验,我们决定在加载数据之前阻止 UI 并显示微调器...
下面的 blockui 插件对我有用,但它太快了..它只显示几秒钟,然后就消失了...
如何避免这种情况..任何想法..请帮助....
function RenderPartialView() {
//block the UI until partial view is rendered
$.blockUI({ message: '<h3><b><img src="/content/images/loading.gif" /> Please wait while the request is being processed...</b></h3>' });
//load the partial view
$('#result').load('@Url.Action("Grid", "Home")', { flip: false });
//unblock the UI
$.unblockUI();
}
Below is Jquery function through I'm calling a action in my asp.net MVC application. In controller action I'm loading a partial view, which is loaded in div "result". In controller action I'm performing a database operation and load a grid with these data...but we having huge records whick takes time (say for different situation it is 1-10 minute).
For better user experience, we decide to block the UI and show spinner before data loaded...
below blockui plugging works for me, but it is too fast..it show only for few seconds and then disappier...
how to avoid this..any idea..please help....
function RenderPartialView() {
//block the UI until partial view is rendered
$.blockUI({ message: '<h3><b><img src="/content/images/loading.gif" /> Please wait while the request is being processed...</b></h3>' });
//load the partial view
$('#result').load('@Url.Action("Grid", "Home")', { flip: false });
//unblock the UI
$.unblockUI();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Load 有一个您可以访问的回调
提供的回调在执行后处理后执行(当检测到成功的响应时)
尝试这个而不是最后两个命令:
Load has a callback you can access
The provided callback is executed after post-processing has been performed (When a successful response is detected)
Try this instead of your last two commands: