JQuery / AJAX / ASP MVC 3 - 对 PartialView OnSuccess 进行动画处理
我希望能够使用 Ajax.ActionLink 的 OnSuccess 回调做一些奇特的动画:
@foreach(var item in Model)
{
@Ajax.ActionLink(Html.Action("GetOpenEnquiriesNum", new { id = item.ACCOUNTNUM }).ToString(), "GetOpenEnquiries", new { id = item.ACCOUNTNUM }, new AjaxOptions()
{
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "daybook-result-" + item.ACCOUNTNUM + "",
OnSuccess = "LoadAjaxSuccess"
})
}
如您所见,我的 UpdateTargetId 将根据模型的 item.ACCOUNTNUM 的不同而有所不同,因此我可以完全执行以下操作
$("#daybook-result-123").slideDown("slow");
: 123 零件对于我的模型中的每个项目都会有所不同。那么我是否可以将调用者作为参数传递给 LoadAjaxSuccess 函数?然后做类似的事情:
function LoadAjaxSuccess(mycaller)
{
$(mycaller).slideDown("slow");
}
任何帮助将不胜感激,谢谢。
I want to be able to do some fancy animation using the OnSuccess callback of the Ajax.ActionLink:
@foreach(var item in Model)
{
@Ajax.ActionLink(Html.Action("GetOpenEnquiriesNum", new { id = item.ACCOUNTNUM }).ToString(), "GetOpenEnquiries", new { id = item.ACCOUNTNUM }, new AjaxOptions()
{
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "daybook-result-" + item.ACCOUNTNUM + "",
OnSuccess = "LoadAjaxSuccess"
})
}
As you can see, my UpdateTargetId will be different depending on the item.ACCOUNTNUM of my model, so I can exactly do something like:
$("#daybook-result-123").slideDown("slow");
as the 123 part will be different for every item within my model. So is there anyway I can pass the caller as a parameter to the LoadAjaxSuccess function? Then do something like:
function LoadAjaxSuccess(mycaller)
{
$(mycaller).slideDown("slow");
}
Any help would be appreciated, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
进而:
and then:
做这样的事情:
Do something like this: