|
<div class="control-section">
<ejs-grid #grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [allowExcelExport]='true'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true'></e-column>
<e-column field='Percent' headerText='Percentage' [valueAccessor]='valueAccess' width='120' textAlign='Right'></e-column>
<e-column field='ShipCountry' headerText='Ship Country' width='150'></e-column>
</e-columns>
</ejs-grid>
</div> |
|
. . .
export class AppComponent {
public data: Object[];
public
public toolbar: string[];
public hierarchyOrderdata: Object[] = [
{
OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5),
ShipName: 'Vins et alcools Chevalier', ShipCity: 'Reims', ShipAddress: '59 rue de l Abbaye',
ShipRegion: 'CJ', ShipPostalCode: '51100', ShipCountry: 'France', Percent: 97.00, Verified: !0
},
{
OrderID: 10249, CustomerID: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6),
ShipName: 'Toms Spezialitäten', ShipCity: 'Münster', ShipAddress: 'Luisenstr. 48',
ShipRegion: 'CJ', ShipPostalCode: '44087', ShipCountry: 'Germany', Percent: 10.00, Verified: !1
},
. . .
public ngOnInit(): void {
. . .
}
public valueAccess = (field: string, data1: object, column: object) => {
return data1[field] + '%';
}
} |