import { Grid, Group } from '@syncfusion/ej2-grids';
import { data } from './datasource'
Grid.Inject(Group);
let grid: Grid = new Grid({
dataSource: data,
allowGrouping: true,
groupSettings: { captionTemplate: '#captiontemplate', columns: ['EmployeeID'] },
columns: [
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'EmployeeID', headerText: 'Employee ID', textAlign: 'Right', width: 120 },
{ field: 'CustomerID', headerText: 'Customer ID', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'ShipCountry', headerText: 'Ship Country', width: 120 },
],
height: 315
});
grid.appendTo('#Grid');
|