pm-controls
Version:
ProModel Controls
62 lines (55 loc) • 2.21 kB
text/typescript
import {
ChangeDetectorRef,
Component,
Input
} from '@angular/core';
import { GridComponent } from '../../../../controls/components/grid/grid-component';
import { ModalDialog } from '../../../../controls/components/modal/modal-dialog';
export class GridSettingsGeneralPanelComponent {
constructor(private changeDetectorRef: ChangeDetectorRef) {
changeDetectorRef.detach();
}
private grid: GridComponent;
get Grid(): GridComponent {
return this.grid;
}
set Grid(value: GridComponent) {
this.grid = value;
this.CurrentGrid =
{
"ColumnHeaderHeight": value.ColumnHeaderHeight,
"FrozenColumnCount": value.FrozenColumnCount,
"HierarchyColumnIndex": value.HierarchyColumnIndex,
"HierarchyColumnProperty": value.HierarchyColumnProperty,
"ShowFooter": value.ShowFooter,
"ShowRowNumbers": value.ShowRowNumbers,
"ShowColumnGroups": value.ShowColumnGroups,
"RowHeight": value.RowHeight
}
this.changeDetectorRef.detectChanges();
}
Dialog: ModalDialog;
CurrentGrid;
TopHeightPx;
TransformY;
OnSave() {
this.Grid.ColumnHeaderHeight = this.CurrentGrid.ColumnHeaderHeight;
this.Grid.FrozenColumnCount = this.CurrentGrid.FrozenColumnCount;
this.Grid.HierarchyColumnIndex = this.CurrentGrid.HierarchyColumnIndex;
this.Grid.HierarchyColumnProperty = this.CurrentGrid.HierarchyColumnProperty;
this.Grid.ShowFooter = this.CurrentGrid.ShowFooter;
this.Grid.ShowColumnGroups = this.CurrentGrid.ShowColumnGroups;
this.Grid.ShowRowNumbers = this.CurrentGrid.ShowRowNumbers;
this.Grid.RowHeight = this.CurrentGrid.RowHeight;
this.Grid.RaiseChange();
}
OnClose() {
this.Dialog.Close(false);
}
}