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

Initially selected tab (data-selected-index) not working

1 Answer 94 Views
TabStrip (Mobile)
This is a migrated thread and some comments may be shown as answers.
Maxim
Top achievements
Rank 2
Maxim asked on 20 May 2014, 11:38 AM
Hello,

I saw several related questions, but none of them have a working answer.

I have a tabstrip defined like this:

<div data-role="tabstrip" data-selected-index="1">
<a data-icon="home" href="/">Home</a>
<a data-icon="action" href="/ActionManager">Actions</a>
<a data-icon="search" href="/Search">Search</a>
</div>

I'm expecting "Actions" tab to be selected initially.  But it is not. "Home" tab is always selected no matter what number I put into data-selected-index. Looks like this attribute is ignored.

Is selectedIndex working in tabStrip?
Is there any other way to select tab from HTML markup?

Thank you,
Alex



1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 20 May 2014, 11:56 AM
Hi Maxim,

The first view is being selected, because when the views are initialized the index view has an ID of "\" which matches the href attribute in your TabStrip and selects the corresponding item. If you do not use the "\" href attribute, then it works as expected:

http://jsbin.com/panex/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 (Mobile)
Asked by
Maxim
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Share this question
or