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

2 posts, 1 answers
  1. Maxim
    Maxim avatar
    16 posts
    Member since:
    Jun 2008

    Posted 20 May 2014 Link to this post


    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>

    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,

  2. Answer
    Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 20 May 2014 Link to this post

    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:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top