How to set default tab in kendo tabstrip conditionally
Hi,
In this I will be demonstrating, how we can set the default tab in kendo-tabstrip conditionally.
Scenario :
We have a grid, which has several columns. The grid is read-only (means, we cannot edit on the grid). There is one hyperlink and two buttons (total 3) in every line-item. On click of those controls, we have to open a popup where we can update the static data. Now the kendo-popup has 3 tabs.(let's say tab1, tab2 and tab3) Now, the challenge is we have to set each tab default for each control (3 tabs for 3 controls).
Solution :
We used @HostListener to overcome this challenge. We used two boolean variables for this. Below is the code snippet
And in the html, we bind this properties with [selected] property, code snippet below
<kendo-tabstrip-tab [selected]="!isTab3 && !isTab2" title="Details">
Tags : #angular #frontenddevelopment #kendotabstrip #kendoui
Comments
Post a Comment