app.component.html
<mat-tab-group >
<mat-tab label="First">
Grid1
<ejs-grid [dataSource]='data' id="gridcomp" allowPaging='true' allowExcelExport='true' allowPdfExport='true' allowSorting='true'
[contextMenuItems]="contextMenuItems" [editSettings]='editing'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true'></e-column>
<e-column field='CustomerName' headerText='Customer Name'></e-column>
<e-column field='Freight' headerText='Freight' format='C2' textAlign='Right' editType='numericedit'></e-column>
<e-column field='ShipName' headerText='Ship Name' width='200'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit'></e-column>
<e-column field='ShipCity' headerText='Ship City' width='150'></e-column>
</e-columns>
</ejs-grid>
</mat-tab>
<mat-tab label="Second">
<ng-template matTabContent> // use this tag to lazy load the content
Grid2
<ejs-grid [dataSource]='data' id="grid" allowPaging='true' allowExcelExport='true' allowPdfExport='true' allowSorting='true'
[contextMenuItems]="contextMenuItems" [editSettings]='editing'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit'></e-column>
<e-column field='ShipCity' headerText='Ship City' width='150'></e-column>
</e-columns>
</ejs-grid>
</ng-template>
</mat-tab>
</mat-tab-group> |