[英]Kendo Tabstrip select method set
I'm using a Kendo TabStrip in my project, and am using an MVC view as the content of a panel, by setting the contentURL for the tab. 我在项目中使用Kendo TabStrip,并通过设置选项卡的contentURL将MVC视图用作面板的内容。
This is all working great, although I am having an issue, by trying to set the select function from my MVC view. 通过尝试在我的MVC视图中设置选择功能,尽管我遇到了问题,但所有这些都很好用。
Within my view I have tried: 在我看来,我尝试过:
$('#edit').kendoTabStrip().select = function(e){alert('tab has been changed');}
And a couple of other ways, however, when I try to set this select method from my view, it doesn't allow me to. 但是,还有其他几种方法,当我尝试从自己的角度设置此select方法时,它不允许我这样做。
I think what you need is to define the select event in your tabstrip configuration, as explained here and here . 我认为您需要的是在tabstrip配置中定义select事件,如此处和此处所述 。
Example: 例:
Define the select event function 定义选择事件功能
var onSelect = function(e) {
alert('tab has been changed');
};
Javascript Java脚本
var tabStrip = $("#edit").kendoTabStrip({
select: onSelect,
// etc
}).data("kendoTabStrip");
Kendo MVC 剑道MVC
@(Html.Kendo().TabStrip()
.Name("edit")
.Events(events => events.Select("onSelect"))
//etc
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.