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

Binding with array, can't select first tab

1 Answer 87 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 25 Apr 2012, 02:53 AM
Code:
<ul class="kendo-tabstrip" runat="server" style="visibility:hidden">
    <li class="k-state-active">First Tab</li>
    <li>Second Tab</li>
    <li>Third Tab</li>
</ul>
<div>Tab1</div>
<div>Tab2</div>
<div>Tab3</div>

//Create the tab data
        for (var i = 0; i < subtabcontainer.length; i++) {
            tabdata[i] = {
                text: tabs[i].innerHTML,
                content: subtabcontainer[i].innerHTML
            };
        }
 
        var tabstrip = $(this).kendoTabStrip({
            dataTextField: "text",
            dataContentField: "content",
            dataSource: tabdata
        }).data("kendoTabStrip").select(1);



So it loops though some elements on the page, and builds up an array to bind to the tabstrip.  This all works great, however no tabs are selected when the page renders...if I manually click one all is good.

I've even tried setTimeout after the tabstrip initialization to do the .select as well, but no dice.

See here: http://screencast.com/t/Y22BMw27jsJ

1 Answer, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 27 Apr 2012, 02:40 PM
Hi Steve,

I wasn't able to reproduce your issue - a tab is always selected here. Can you reproduce this problem in a jsFiddle or on a sample page?

Regards,
Kamen Bundev
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
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Kamen Bundev
Telerik team
Share this question
or