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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default tab items load when page loads.

Thread ID:





140659 Oct 31,2018 07:32 AM UTC Nov 1,2018 11:08 AM UTC Angular - EJ 2 1
Tags: Tab
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.

$("#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 
Deepa L. 


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon