Add component to Tab content

Hello,

is it possible to add content like Calendar or ComboBox component with all functionalities (not only plane HTML element) to Essential JS2 for Angular TAB?

If yes, please send us example.


Thank you.


5 Replies

BM Balaji M Syncfusion Team April 26, 2018 11:41 AM UTC

  
Hi AC,  
  
Thanks for contacting Syncfusion support.  
  
Yes, is it possible to add content like Calendar or ComboBox component with all functionalities (not only plain HTML element) to our Essential JS 2 Angular Tab.  
 
Option 1: 
 
You can achieve this in our tab using the ng-template inside the ‘e-tabitem’ tag with  #content attribute, which is mandatory to render content. And in this content we can render our desired components directly with all their functionalities. Please refer to the following code. 
 
 
<ejs-tab id="element"> 
    <e-tabitems> 
        <e-tabitem [header]='headerText[0]'> 
            <ng-template #content> 
                <ejs-calendar [value]='dateValue' [min]='minDate' [max]='maxDate'></ejs-calendar> 
            </ng-template> 
        </e-tabitem> 
        <e-tabitem [header]='headerText[1]'> 
            <ng-template #content> 
                <ejs-combobox id='comboelement' #samples [dataSource]='data' [placeholder]='text'></ejs-combobox> 
            </ng-template> 
        </e-tabitem> 
    </e-tabitems> 
</ejs-tab> 
 
 
 
 
 
Option 2:   
 
You can also define the tab content in HTML and set style “display:none” for it and assign the element’s id to the Tab item’s content as template . Please refer to the following code. 
 
 
HTML 
 
<div id="calender-section" style="display:none">  
    <div class="control-section"> 
        <ejs-calendar [value]='dateValue' [min]='minDate' [max]='maxDate'></ejs-calendar> 
    </div> 
</div> 
 
<div id="combobox-section" style="display:none"> 
    <div class="control-section"> 
        <ejs-combobox id='comboelement' #samples [dataSource]='data' [placeholder]='text'></ejs-combobox> 
    </div> 
</div> 
 
<ejs-tab id="element" #tab [items]='tabItems'> 
</ejs-tab> 
 
TS: 
 
public tabItems: Object[] = [ 
{ 
  header: { 'text': 'Calender' }, 
  content: '#calender-section'   // refer the div id here 
}, 
{ 
  header: { 'text': 'ComboBox' }, 
  content: '#combobox-section' 
} 
]; 
 
 
 
 
  
 
 
Please find the below getting started UG and API link for more references for our Tab component. 
 
 
 
 
Please check the shared samples and details and let us know if you have any further queries.   
  
Regards,  
M. Balaji 




UN Unknown Syncfusion Team April 30, 2018 10:21 AM UTC

Hi, after removing dynamically added Tab and trying to add another one, we are getting this error:

 



AP Arun Palaniyandi Syncfusion Team May 2, 2018 01:20 PM UTC

Hi AC 
  
Thanks for your update. 
 
We would like to confirm you that whether you are dynamically adding and removing Tabs using the Tabs public methods addTab and removeTab. If so, we would confirm that there is a bug in our removeTab method. Hence we have logged a defect report and this will be fixed in our upcoming Volume 2 main release.  
 
Let us know if you need any further assistance. 
      
Regards,
Arun P.
 
 



UN Unknown Syncfusion Team May 4, 2018 09:33 AM UTC

Hello again,

I think after renewing version on ej2-navigations and ej2-ng-navigations to 16.1.38 there are problems with tab component. I am trying to add data to tab like in your example option2 (with div id) but the component is not displayed. It seems that it works incorrect only with latest ej2-ng-navigations (if I am using ej2-ng-navigations version 16.1.37 and ej2-navigations version 16.1.38 it works correctly)


BM Balaji M Syncfusion Team May 7, 2018 01:38 PM UTC

Hi AC, 
 
Sorry for the inconvenience caused.  
 
Yes, your reported issue “the component is not displayed in tab” in the version 16.1.0.38 is already a known issue and we have fixed this issue internally. Hence this fix will be reflected in our upcoming patch release on this Wednesday(5/9/2018). 
 
 
We appreciate patience until then. 
 
Regards, 
M. Balaji 


Loader.
Up arrow icon