Programmatic selection of a Tabstrip Item shows wrong TabItem content

2 posts, 0 answers
  1. Sarah
    Sarah avatar
    4 posts
    Member since:
    Apr 2013

    Posted 18 Jun 2013 Link to this post

    Using the ASP.NET MVC wrappers, I have a tabstrip that loads it's respective tabitems contents from Html actions

           .Items(tabstrip => {
                tabstrip.Add().Text("Details").Content(@<text>@Html.Action("InstitutionDetails", "InstitutionSetup")</text>);
                tabstrip.Add().Text("Locations").Content(@<text>@Html.Action("ServiceLocations", "InstitutionSetup")</text>);
                tabstrip.Add().Text("Devices").Content(@<text>@Html.Action("Printers", "InstitutionSetup")</text>);
                tabstrip.Add().Text("Users").Content(@<text>@Html.Action("UserList", "InstitutionSetup")</text>);
    This process works fine.  However, there is one case where when the page loads, the Users tab should be loaded by default rather than the Details tab.    

    The following snippet will change the rendered state of the tabstrip to show the Users tab as selected, but will not switch to its corresponding contents (instead continues to show the Details tab content)

    var tabstrip = $("#inst_details_tabstrip").data("kendoTabStrip");':contains("Users")'));
    var item = tabstrip.items()[3];
    is there something simple I am missing?
  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 20 Jun 2013 Link to this post


    The following selector:':contains("Users")'));

    matches two elements. One of them is the LI the other is the anchor inside.

    You need to use the LI element.

    Change your logic like this:'.k-item:contains("Users")'));

    Also on the fourth line of JavaScript you typed the tabStrip with capital S and you do not actually need to call that reload.

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top