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

Selecting tab on page load in AngularJS

1 Answer 303 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 30 Aug 2016, 02:52 PM

I have a tab strip in AngularJS where I am saving the user's last viewed tab and then trying to programmatically select that tab when they return to the page using ng-class and a scoped variable. This worked in a previous version of kendo UI, but I recently upgraded to the latest version and it no longer works. Here is how it is setup:

 

 <div kendo-tab-strip="tabStrip" k-content-urls="[null, null]">
        <ul>
            <li ng-class="selectedTab == 'Surveys' ? 'k-state-active' : ''" ng-click="changeSelectedTab('Surveys')">Surveys</li>
            <li ng-class="selectedTab == 'Assigned Surveys' ? 'k-state-active' : ''" ng-click="changeSelectedTab('Assigned Surveys')" >Assigned Surveys</li>          
        </ul>

     <div>Tab1</div>

     <div>Tab2</div>

</div>

 

The tab will show that it is selected, but the div content does not display. Any suggestions on an possible workaround?

 

 

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 01 Sep 2016, 06:38 AM
Hi,

You can use the kendoWidgetCreated event and select the needed tab. Here is some documentation:

http://docs.telerik.com/kendo-ui/AngularJS/global-events#upon-widget-creation-kendowidgetcreated

Regards,
Kiril Nikolov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
TabStrip
Asked by
Jason
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or