我正在使用具有两个选项卡的kendo选项卡。
选项卡I:添加用户。标签II:它具有一个下拉菜单,每次从Tab1添加用户时都会刷新
每次调用Tab II时,我都需要调用一个javascript方法来刷新Tab II的下拉菜单。我使用过Tabstrip“激活”,“选择”,“显示”事件,但单击该选项卡时仅触发一次。
@(Html.Kendo().TabStrip()
.Name("CWUserTabStrip")
.Events(events => events
.Activate("onActivate")
.Select("onSelect")
.ContentLoad("onContentLoad")
)
.Items(tabstrip =>
{
tabstrip.Add().Text("User Creation")
.Selected(true)
.LoadContentFrom("_CWUserCreationTab", "User");
tabstrip.Add().Text("User Allocation")
.LoadContentFrom("_CWUserAllocationTab", "User");
})
)
每次单击选项卡时触发选项卡单击事件的任何技巧?
我认为您可以使用jQuery附加自己的事件:
$(function () {
$("div#CWUserTabStrip ul li:nth-child(2)").on("click", function () {
alert('clicked');
});
});
您可以将其放在标签条所在的视图中,只需确保设置与标签条中标签号相对应的子元素。我测试了它,效果很好。看看这个。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句