Kendo Tabstrip select method set

1.7k views Asked by At

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.

This is all working great, although I am having an issue, by trying to set the select function from my MVC view.

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.

1

There are 1 answers

0
Nic On

I think what you need is to define the select event in your tabstrip configuration, as explained here and here.

Example:

Define the select event function

var onSelect = function(e) {
    alert('tab has been changed');
};

Javascript

var tabStrip = $("#edit").kendoTabStrip({
    select: onSelect,
    // etc
}).data("kendoTabStrip");

Kendo MVC

@(Html.Kendo().TabStrip()
    .Name("edit")
    .Events(events => events.Select("onSelect"))
    //etc
)