Load new tabs dynamically at the click event of button

Hi,

I am loading tabs in starting with a variable. Here is my code:-

<div *ngFor="let item of TabsDetails">

            <div *ngIf="item.IsBranch;then branch_content else noBranch_content"></div>

            <!--Block with Branch-->
            <ng-template #branch_content>
              <e-tabitem [header]="{ 'text': item.Label }">

                <ng-template #content>
                  <img src={{iconImageSource}} (click)="fnBranchPopUp(item.Id)" />
                  <ejs-grid #overviewgrid id='overviewgrid' [dataSource]='gridDataSource' rowHeight='38' [allowSelection]='true'
                            height='600' width="1000px">
                    <e-columns>
                      <e-column headerText="Actions" [filter]='filterSettings' width='230'></e-column>

                      <!--for printing Grid columns-->
                      <div *ngFor="let item of gridColumns">

                        <e-column [field]="item.Label" [headerText]="item.Label" width='230'></e-column>
                      </div>

                    </e-columns>
                  </ejs-grid>
                </ng-template>
              </e-tabitem>
            </ng-template>


            <!--else block without branch-->
            <ng-template #noBranch_content>
              <e-tabitem [header]="{ 'text': item.Label }">
                <ng-template #content>
                  <ejs-grid #overviewgrid id='overviewgrid' [dataSource]='gridDataSource' rowHeight='38' [allowSelection]='true'
                            height='600' width="1000px">
                    <e-columns>
                      <e-column headerText="Actions" [filter]='filterSettings' width='230'></e-column>

                      <!--for printing Grid columns-->
                      <div *ngFor="let item of gridColumns">
                        <e-column [field]="item.Label" [headerText]="item.Label" width='230'></e-column>
                      </div>
                    </e-columns>
                  </ejs-grid>
                </ng-template>
              </e-tabitem>
            </ng-template>
          </div>

Inside the tab item, I am showing grid with dynamic columns.

But now issues is, I need to reload new tabs the button click, I have new tabs names at the rowselect event of Grid.
But I am not able to load new tabs. Kindly help.


7 Replies

BS Balasubramanian Sattanathan Syncfusion Team March 16, 2020 08:55 AM UTC

Hi Namita, 
 
Greetings from Syncfusion Support. 
 
We let you know that your query has been addressed already in the following ticket #152356. 
 
Please let us know if you have any concern.   
 
Regards, 
Balasubramanian S 



NA Namita March 17, 2020 04:03 AM UTC

Hi

Both issues are different. #152356 is about creating Grid columns dynamically on click of tabs.

Now issue is reload new tabs on a button click which are coming from Database.


NA Namita March 18, 2020 01:39 AM UTC

I need to add multiple tabs in loop in ts file, but it adds only 1 tab


BS Balasubramanian Sattanathan Syncfusion Team March 18, 2020 11:50 AM UTC

Hi Namita, 
 
Thanks for the update. 
 
We have analyzed your reported scenario at our end and got confused about your requirements. Kindly confirm whether your requirement is needed to add multiple tab components dynamically for the single page or add multiple tab items dynamically for the single tab. 
 
Please let us know if you have any concerns. 
 
Regards, 
Balasubramanian S 



NA Namita March 24, 2020 01:01 AM UTC

my tabs are changing dynamically. after clicking on a  botton, new tabs are coming from database which I need to show on screen again.




NA Namita March 24, 2020 03:16 AM UTC

May we have call on that?


BS Balasubramanian Sattanathan Syncfusion Team March 24, 2020 10:20 AM UTC

Hi Namita, 
  
We have created a new support incident under your account, please follow the incident(#270360) for further assistance. Kindly log on to our support website to check further updates on it    
   
  
Regards,  
Balasubramanian S 


Loader.
Up arrow icon