pm-controls
Version:
ProModel Controls
53 lines (46 loc) • 1.38 kB
text/typescript
import {
Component,
ChangeDetectorRef,
ChangeDetectionStrategy,
Input,
SimpleChanges,
ViewContainerRef
} from '@angular/core';
import { GridComponent } from '../../../../controls/components/grid/grid-component';
export class GridRowsCountComponent {
constructor(private changeDetectorRef: ChangeDetectorRef) {
changeDetectorRef.detach();
}
Rows: Array<any> = [];
RowFocus;
Grid: GridComponent;
ngOnChanges(changes: SimpleChanges) {
if (changes['Rows']) {
this.changeDetectorRef.detectChanges();
}
if (changes['RowFocus']) {
this.changeDetectorRef.detectChanges();
}
}
IsRowFocused(row: any) {
if (this.RowFocus) {
return this.RowFocus[row['_rowNumber']];
}
return false;
}
OnCellSelect(row: any) {
this.Grid.SelectRow(row);
}
OnRowResize(size: any, row: any) {
if (size < 0)
size = 0;
row['_rowResizeHeight'] = size;
this.Grid.ResizeRow(row);
}
}