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"))
)
In Javascript I get theSelected Item:
function tabstrip_select(e) {
var x = e.item;
}
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.
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();
}
Demo using JSFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With