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

Select a tab with a button click

1 Answer 1029 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kimberly
Top achievements
Rank 1
Kimberly asked on 02 Aug 2012, 07:53 PM
Hi All,
    I would like a button click on my page to programattically open a tab.

  // bind event for button

$("#btnShowMyTab").click( function(e) { 

var tabstrip = $("#informationTabstrip").kendoTabStrip().data("kendoTabStrip");

var myTab = tabstrip.tabGroup.children("li").eq(2);

// activate fact tab

    tabstrip.select(myTab);

});

The problem I am having is that for a split second, the tab I want to see shows up, but it is immediately replaced by whichever tab was open before I clicked the button.  The open tab I want does not stay open.

Does anyone see anything wrong with my click event ?

Thank you,
Kim

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 07 Aug 2012, 07:10 AM
Hello Kimberly,

At the click event of the btnShowMyTab button the tapStrip component is initialized again, which is causing the unexpected behaviour that you have described. The widget client object is preserved in the jQuery data store for the corresponding element. The following code snippet shows how to get the client object of the tabStrip.
var tabstrip = $("#informationTabstrip").data("kendoTabStrip");

For convenience I prepared a small example where you can see a working version of your code.
I hope this helps.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip
Asked by
Kimberly
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or