Kendo UI angular 2 TabStripComponent has a method selectTab. How can I use it to active a tab from the typescript code?
You can use the selectTab(index) method from the tabstrip component.
First, add a selector to your tabstrip in your view component:
<kendo-tabstrip #tabstrip>... </kendo-tabstrip>
Now, you can access the tabstrip from your module via
@ViewChild('tabstrip') public tabstrip: TabStripComponent;
Finally, you can activate any tab using its index with
tabstrip.selectTab(index);
Here is a Plunker if you want to have a look.
Be aware that it will not switch if the targeted tab is disabled!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With