App.component.ts
public columns = [
{
fieldName: "additionlDetails.PhotoPath",
headerName: "PhotoPath",
fieldType: "image"
},
{
fieldName: "additionlDetails.Title",
headerName: "Title",
fieldType: "text"
},
{
fieldName: "additionlDetails.HireDate",
headerName: "Hire Date",
fieldType: "text"
},
{
fieldName: "additionlDetails.ReportsTo",
headerName: "Reports To",
fieldType: "text"
}
]; |
App.component.html
<div class="control-section e-tab-section">
<div class="e-sample-resize-container">
<ejs-grid #grid [dataSource]='data' id='Grid' [allowExcelExport]="true" [allowPdfExport]="true"
[allowResizing]="allowColumnReSizing" [allowSorting]="true" [allowPaging]="true"
[pageSettings]="pageSettings" [gridLines]="lines" [toolbar]="toolbar" [contextMenuItems]="contextMenuItems"
[allowFiltering]="true" [filterSettings]='filterSettings'>
<e-columns>
<e-column field='FirstName' headerText='Name' width='120' textAlign='Right'></e-column>
<ng-template ngFor let-column [ngForOf]="columns">
<e-column [field]="column.fieldName" [headerText]="column.headerName" [width]="80"></e-column>
</ng-template>
</e-columns>
</ejs-grid>
</div>
</div> |