We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default tab items load when page loads.

Thread ID:

Created:

Updated:

Platform:

Replies:

140659 Oct 31,2018 07:32 AM UTC Nov 1,2018 11:08 AM UTC Angular - EJ 2 1
loading
Tags: Tab
Sarvana
Asked On October 31, 2018 07:32 AM UTC

I have a tab control which has four tab items name called conten0,conten1,conten2,conten3. I need to show the default tab items content2 as default items to show when the user comes to the page. I tried to add the class to the tab and tab items. but facing a problem.

ngAfterViewInit(){
$("#tab_default").attr("aria-activedescendant","e-item_2");
$("#e-item_2").addClass("e-item e-active e-content e-control e-touch");
}

Deepa Loganathan [Syncfusion]
Replied On November 1, 2018 11:08 AM UTC

 
Hi Sarvana,  
 
 
Thank you for contacting Syncfusion support.  
 
 
You can activate a specific tab item upon initial rendering by setting the selectedItemproperty instead of adding class attributes as given in the below code.  
 
 
 
export class ResponsiveTabComponent implements ngOnInit { 
 
     
    @ViewChild('adaptiveTab')tabObj: TabComponent; 
   
  ngOnInit(): void 
    ngOnInit() { 
 
   this.tabObj.selectedItem = 2; 
    
  } 
    // Mapping Tab items Header property    
    public headerText: Object = [{ text: 'HTML' }, { text: 'C Sharp(C#)' }, { text: 'Java' }, { text: 'VB.Net' }, 
        { text: 'Xamarin' }, { text: 'ASP.NET' }, { text: 'ASP.NET MVC' }, { text: 'JavaScript' }]; 
 
     public index = 2; 
} 
 
 
We have prepared a sample based on your requirement.  
 
 
 
 
Please check and get back to us if you need any further assistance 
 
 
Regards,  
 
Deepa L. 
 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;