-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathgrid-cell-merge-sample.component.ts
More file actions
51 lines (49 loc) · 1.68 KB
/
grid-cell-merge-sample.component.ts
File metadata and controls
51 lines (49 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
import {
GridSelectionMode,
IgxGridComponent,
IgxColumnComponent,
IgxCellTemplateDirective,
GridCellMergeMode,
IgxSelectComponent,
IgxSelectItemComponent,
IgxGridToolbarComponent,
IgxLabelDirective
} from 'igniteui-angular';
import { INVOICE_DATA } from '../../data/invoiceData';
import { IgxPreventDocumentScrollDirective } from '../../directives/prevent-scroll.directive';
import { FormsModule } from '@angular/forms';
@Component({
encapsulation: ViewEncapsulation.None,
selector: 'app-grid-groupby-sample',
styleUrls: ['./grid-cell-merge-sample.component.scss'],
templateUrl: './grid-cell-merge-sample.component.html',
imports: [
IgxGridComponent,
IgxPreventDocumentScrollDirective,
IgxColumnComponent,
IgxCellTemplateDirective,
IgxSelectComponent,
IgxSelectItemComponent,
IgxLabelDirective,
IgxGridToolbarComponent,
FormsModule
]
})
export class GridCellMergeSampleComponent {
@ViewChild('grid1', { read: IgxGridComponent, static: true })
public grid1: IgxGridComponent;
public data;
public selectionMode: GridSelectionMode = 'single';
public cellMergeMode: GridCellMergeMode = 'always';
public mergeTypes = [{ name: 'Merge always', value: GridCellMergeMode.always }, { name: 'Merge on sort', value: GridCellMergeMode.onSort }];
constructor() {
this.data = INVOICE_DATA;
}
public formatDate(val: Date) {
return new Intl.DateTimeFormat('en-US').format(val);
}
public formatCurrency(value: number) {
return '$' + value.toFixed(2);
}
}