pm-controls
Version:
ProModel Controls
50 lines (43 loc) • 1.56 kB
text/typescript
import {
Component,
ChangeDetectorRef,
ChangeDetectionStrategy,
Input,
SimpleChanges
} from '@angular/core';
import { GridComponent } from '../../../../../controls/components/grid/grid-component';
import { ColumnGroup } from '../../../../../objects/request/column-group';
export class GridColumnGroupingComponent {
constructor(
private changeDetectorRef: ChangeDetectorRef) {
changeDetectorRef.detach();
}
ColumnGroups: Array<any> = [];
Grid: GridComponent;
Row: any;
ngOnChanges(changes: SimpleChanges) {
if (changes['Columns']) {
this.changeDetectorRef.detectChanges();
}
if (changes['ColumnGroups']) {
this.changeDetectorRef.detectChanges();
}
}
ColumnHeaderAlignmentClass(column: ColumnGroup) {
if (column.HeaderTextAlign) {
if (column.HeaderTextAlign.toLowerCase() == "left")
return "column-alignment-left";
if (column.HeaderTextAlign.toLowerCase() == "right")
return "column-alignment-right";
if (column.HeaderTextAlign.toLowerCase() == "center")
return "column-alignment-center";
}
return;
}
}