This is a migrated thread and some comments may be shown as answers.

Kendo MVC TabStrip Disable Animation; Animation getting reenabled on javascript select of tab.

3 Answers 412 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Mahendra
Top achievements
Rank 1
Mahendra asked on 03 Jun 2015, 01:33 PM

Hi Tlerik Team,

 

I'm trying to disable the animation for the Kendo MVC TabStrip and I did like 

 @{ Html.Kendo().TabStrip()     
        .Name("tabxyz")
         .Events(events => events.Select("onSelect"))
          .Animation(animation =>
          {
              animation.Enable(false);
          })

And its working as expected; But when I change the tab using the java script code, the animation is enabled again!!!!

Here is the code that I used.

  var tabstrip = $("#tabxyz").kendoTabStrip().data("kendoTabStrip");  
  var myTab = tabstrip.tabGroup.children("li").eq(selectedTab);
   tabstrip.select(myTab);

 

Please let me know what i'm doing wrong!! 

Thanks in advance.

Mahendra.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 05 Jun 2015, 07:34 AM

Hello Mahendra,

By looking at the code you have pasted, I suspect that the issue is caused by the fact that a new TabStrip widget is created in the "somemethod". In order to get the already existing instance of the TabStrip from a given element, you should call the .data("kendoTabStrip") directly on the element:

$("#tabxyz").data("kendoTabStrip");

 

Regards,
Rosen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
jerry
Top achievements
Rank 1
answered on 07 Sep 2017, 07:55 AM

I came across the same issue.

 @(Html.Kendo().TabStrip()
          .Name("racks")
          .Animation(false)
          .Items(tabstrip =>
          {

     ......
           }

 

after doing in javascript:

var tabStrip = $("#racks").kendoTabStrip().data("kendoTabStrip");

the animation is enabled again.

I tried Rosen's suggestion, but 

$("#racks").data("kendoTabStrip");  is undefined

can you help please?

Thanks,

Jerry

 

 

0
Ivan Danchev
Telerik team
answered on 08 Sep 2017, 11:39 AM
Hello Jerry,

You should get a reference to the TabStrip in a document.ready handler:
$(document).ready(function () {
    $("#racks").data("kendoTabStrip");
});

The call to the kendoTabStrip() method initializes the TabStrip again with default settings so it should be omitted:
$("#racks").kendoTabStrip().data("kendoTabStrip");


Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TabStrip
Asked by
Mahendra
Top achievements
Rank 1
Answers by
Rosen
Telerik team
jerry
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or