igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Programatically change tab item

Open Eralmidia opened this issue 8 years ago • 2 comments

How can I change the active tab in a tabs component by code? The selectedIndex is read only, and I can't find any method for it in the IgxTabsComponent

Eralmidia avatar Jun 14 '18 12:06 Eralmidia

You can select a tabs group using IgxTabsGroupComponent select() method. For example:

@ViewChild('selectedTabsGroup')
public selectedTabsGroup: IgxTabsGroupComponent;
    
public selectTabsGroup() {
    this.selectedTabsGroup.select();
}

sboykova avatar Jun 14 '18 15:06 sboykova

Ah, thank you. I would have thought it would be present on the container component, so there was no need to set up multiple viewchildren for the tabs, but thats ok.

I would suggest updating https://www.infragistics.com/products/ignite-ui-angular/angular/components/tabs.html with this as well then, as it doesn't seem to mention the select-method.

Eralmidia avatar Jun 15 '18 07:06 Eralmidia