/
gridoptions.ts
131 lines (129 loc) · 4.29 KB
/
gridoptions.ts
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import type { Column, EditCommand, EditorFactory, EditorLock } from "../core";
import { ColumnFormat, CompatFormatter, FormatterFactory, GlobalEditorLock, GroupTotals, defaultColumnFormat } from "../core";
import { LayoutEngine } from "./layout";
export interface GridOptions<TItem = any> {
addNewRowCssClass?: string;
alwaysAllowHorizontalScroll?: boolean;
alwaysShowVerticalScroll?: boolean;
asyncEditorLoadDelay?: number;
asyncEditorLoading?: boolean;
asyncPostCleanupDelay?: number;
asyncPostRenderDelay?: number;
autoEdit?: boolean;
autoHeight?: boolean;
cellFlashingCssClass?: string;
cellHighlightCssClass?: string;
emptyNode?: (node: Element) => void;
columns?: Column<TItem>[];
createPreHeaderPanel?: boolean;
dataItemColumnValueExtractor?: (item: TItem, column: Column<TItem>) => void;
defaultColumnWidth?: number;
defaultFormat?: ColumnFormat<TItem>;
defaultFormatter?: CompatFormatter<TItem>;
editable?: boolean;
editCommandHandler?: (item: TItem, column: Column<TItem>, command: EditCommand) => void;
editorCellNavOnLRKeys?: boolean;
editorFactory?: EditorFactory;
editorLock?: EditorLock;
enableAddRow?: boolean;
enableAsyncPostRender?: boolean;
enableAsyncPostRenderCleanup?: boolean;
enableCellNavigation?: boolean;
enableCellRangeSelection?: boolean;
enableColumnReorder?: boolean;
enableRowReordering?: boolean;
enableTabKeyNavigation?: boolean;
enableTextSelectionOnCells?: boolean;
explicitInitialization?: boolean;
footerRowHeight?: number;
forceFitColumns?: boolean;
forceSyncScrolling?: boolean;
forceSyncScrollInterval?: number;
formatterFactory?: FormatterFactory;
frozenBottom?: boolean;
frozenColumns?: number;
frozenRows?: number;
fullWidthRows?: boolean;
groupingPanel?: boolean,
groupingPanelHeight?: number;
groupTotalsFormatter?: (p1?: GroupTotals<TItem>, p2?: Column<TItem>, grid?: any) => string;
headerRowHeight?: number;
jQuery?: { ready: any, fn: any };
leaveSpaceForNewRows?: boolean;
layoutEngine?: LayoutEngine;
minBuffer?: number;
multiColumnSort?: boolean;
multiSelect?: boolean;
preHeaderPanelHeight?: number;
renderAllCells?: boolean;
removeNode?: (node: Element) => void;
rowHeight?: number;
rtl?: boolean;
selectedCellCssClass?: string;
showCellSelection?: boolean;
showColumnHeader?: boolean;
showFooterRow?: boolean;
showGroupingPanel?: boolean;
showHeaderRow?: boolean;
showPreHeaderPanel?: boolean;
showTopPanel?: boolean;
slickCompat?: boolean;
suppressActiveCellChangeOnEdit?: boolean;
syncColumnCellResize?: boolean;
topPanelHeight?: number;
useLegacyUI?: boolean;
useCssVars?: boolean;
viewportClass?: string;
}
export const gridDefaults: GridOptions = {
addNewRowCssClass: "new-row",
alwaysAllowHorizontalScroll: false,
alwaysShowVerticalScroll: false,
asyncEditorLoadDelay: 100,
asyncEditorLoading: false,
asyncPostCleanupDelay: 40,
asyncPostRenderDelay: -1,
autoEdit: true,
autoHeight: false,
cellFlashingCssClass: "flashing",
dataItemColumnValueExtractor: null,
defaultColumnWidth: 80,
defaultFormat: defaultColumnFormat,
editable: false,
editorFactory: null,
editorLock: GlobalEditorLock,
enableAddRow: false,
enableAsyncPostRender: false,
enableAsyncPostRenderCleanup: false,
enableCellNavigation: true,
enableColumnReorder: true,
enableTabKeyNavigation: true,
enableTextSelectionOnCells: false,
explicitInitialization: false,
footerRowHeight: 30,
forceFitColumns: false,
forceSyncScrolling: false,
forceSyncScrollInterval: 250,
formatterFactory: null,
fullWidthRows: false,
groupingPanel: false,
groupingPanelHeight: 30,
headerRowHeight: 30,
leaveSpaceForNewRows: false,
minBuffer: 3,
multiColumnSort: false,
multiSelect: true,
renderAllCells: false,
rowHeight: 30,
selectedCellCssClass: "selected",
showCellSelection: true,
showColumnHeader: true,
showFooterRow: false,
showGroupingPanel: true,
showHeaderRow: false,
showTopPanel: false,
suppressActiveCellChangeOnEdit: false,
topPanelHeight: 30,
useLegacyUI: true,
useCssVars: false
}