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

Dynamically select tab after creation

1 Answer 251 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 10 Jan 2014, 07:48 PM
I use this HTML:
<div id='test'>
    <ul>
        <li>Tab1</li>
        <li>Tab2</li>
        <li>Tab3</li>
    </ul>
    <div>
       Content 1
    </div>
    <div>
        Content 2
    </div>
    <div>
        Content 3
    </div>
</div>

Then convert it to TabStrip:
$('test').kendoTabStrip({
    animation: {
        open: {
            effects: effet
        }
    }
});
 
 
var tabs = $elem.data("kendoTabStrip");        //Get Kendo element
tabs .select("li:contains('Tab1')");

The tab is selected, but containt not visible.  If I trig the same code with a button click, all is working good.
If I use the class="k-state-active" in the HTML the tab is selected and the containt is visible.
Thanks

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Jan 2014, 08:03 AM
Hi Pierre,

I have created a working example, showing a possible implementation of the feature that you are looking for. Please check it out and let me know if you have any questions:

http://jsbin.com/ULOziToC/1/edit

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