Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
151023 | Jan 28,2020 01:36 PM UTC | Jan 29,2020 10:10 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
[App.component.html]
<div class="control-section">
<ejs-grid #grid [dataSource]='data' allowPaging='true' height=375 [pageSettings]='pageSettings' [aggregates]='aggreagtes' [toolbar]='toolbar' (toolbarClick)='toolbarClick($event)'
[allowExcelExport]='true' [allowPdfExport]='true'>
. . .
</ejs-grid>
</div>
|
[App.component.ts]
. . .
export class AppComponent {
public data: Object[];
public toolbar: string[];
public pageSettings: Object;
public aggreagtes: Object;
@ViewChild('grid', {static: true})
public grid: GridComponent;
public ngOnInit(): void {
this.data = orderDetails;
this.toolbar = ['ExcelExport', 'PdfExport', 'CsvExport'];
this.pageSettings = { pageCount: 5 };
this.aggreagtes = [{
columns: [{
type: 'Sum',
field: 'Freight',
format: 'N2',
footerTemplate: 'Sum: ${Sum}'
}]
}];
}
}
} |
[App.component.html]
<div class="control-section">
<ejs-grid #grid [dataSource]='data' allowPaging='true' (excelQueryCellInfo)="excelQueryCellInfo($event)" height=375 [pageSettings]='pageSettings' [aggregates]='aggreagtes' [toolbar]='toolbar' (toolbarClick)='toolbarClick($event)'
[allowExcelExport]='true' [allowPdfExport]='true'>
. . .
</ejs-grid>
</div>
|
[App.component.ts]
. . .
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
providers: [ToolbarService, PageService, ExcelExportService, PdfExportService, GroupService]
})
export class AppComponent {
public data: Object[];
public toolbar: string[];
public pageSettings: Object;
public aggreagtes: Object;
@ViewChild('grid', {static: true})
public grid: GridComponent;
public ngOnInit(): void {
this.data = orderDetails;
this.toolbar = ['ExcelExport', 'PdfExport', 'CsvExport'];
this.pageSettings = { pageCount: 5 };
this.aggreagtes = [{
columns: [{
type: 'Sum',
field: 'Freight',
format: 'N2',
footerTemplate: 'Sum: ${Sum}'
}]
}];
}
excelQueryCellInfo(args) {
// applying the color and border color for
args.style = {borders: { color: '#9c4b4b' }, fontColor: '#9c4b4b' };
}
. . .
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.