剑道TabStrip控件:获取所选事件选定指数(MVC 4) [英] Kendo TabStrip: Getting the Selected Index on the Selected event (MVC 4)

查看:318
本文介绍了剑道TabStrip控件:获取所选事件选定指数(MVC 4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的TabStrip控件如下:

My TabStrip is as follows:

        @(Html.Kendo().TabStrip()
              .Name("tabApplications")
              .Items(items =>
                  {
                      items.Add().Text("Online").Selected(true);
                      items.Add().Text("Trading");
                  })
              .Animation(false)
              .Events(e=>e.Select("tabstrip_select"))
              )

在Javascript中我得到theSelected项目:

In Javascript I get theSelected Item:

     function tabstrip_select(e) {
         var x = e.item;
     }

:我如何获得此功能的选择的索引(即1)。我看着在项目对象,但没有看到任何明显的。

Question: How do I get the Selected Index (ie "1") from this function. I looked over the Item object but didn't see anything obvious.

推荐答案

您可以与调用获取当前选定的指数指数() $(e.item)

You can get the currently selected index with calling index() on the $(e.item)

function tabstrip_select(e) {
    var x = e.item;
    var selectedIndex = $(e.item).index();
}

示范使用的jsfiddle

这篇关于剑道TabStrip控件:获取所选事件选定指数(MVC 4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆