@syncfusion/ej2-grids 20.3.47-54738 → 20.3.47-54739
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-grids.min.js +1 -0
- package/helpers/e2e/gridhelper.d.ts +59 -0
- package/helpers/e2e/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components.d.ts +5 -0
- package/src/grid/actions/aggregate.d.ts +31 -0
- package/src/grid/actions/batch-edit.d.ts +116 -0
- package/src/grid/actions/blazor-action.d.ts +47 -0
- package/src/grid/actions/checkbox-filter.d.ts +47 -0
- package/src/grid/actions/clipboard.d.ts +69 -0
- package/src/grid/actions/column-chooser.d.ts +114 -0
- package/src/grid/actions/column-menu.d.ts +99 -0
- package/src/grid/actions/command-column.d.ts +31 -0
- package/src/grid/actions/context-menu.d.ts +102 -0
- package/src/grid/actions/data.d.ts +110 -0
- package/src/grid/actions/detail-row.d.ts +73 -0
- package/src/grid/actions/dialog-edit.d.ts +21 -0
- package/src/grid/actions/edit.d.ts +271 -0
- package/src/grid/actions/excel-export.d.ts +89 -0
- package/src/grid/actions/excel-filter.d.ts +53 -0
- package/src/grid/actions/export-helper.d.ts +67 -0
- package/src/grid/actions/filter.d.ts +253 -0
- package/src/grid/actions/foreign-key.d.ts +20 -0
- package/src/grid/actions/freeze.d.ts +17 -0
- package/src/grid/actions/group.d.ts +178 -0
- package/src/grid/actions/infinite-scroll.d.ts +146 -0
- package/src/grid/actions/inline-edit.d.ts +21 -0
- package/src/grid/actions/lazy-load-group.d.ts +40 -0
- package/src/grid/actions/logger.d.ts +30 -0
- package/src/grid/actions/normal-edit.d.ts +76 -0
- package/src/grid/actions/page.d.ts +117 -0
- package/src/grid/actions/pdf-export.d.ts +142 -0
- package/src/grid/actions/print.d.ts +67 -0
- package/src/grid/actions/reorder.d.ts +95 -0
- package/src/grid/actions/resize.d.ts +117 -0
- package/src/grid/actions/row-reorder.d.ts +92 -0
- package/src/grid/actions/scroll.d.ts +114 -0
- package/src/grid/actions/search.d.ts +72 -0
- package/src/grid/actions/selection.d.ts +481 -0
- package/src/grid/actions/show-hide.d.ts +55 -0
- package/src/grid/actions/sort.d.ts +138 -0
- package/src/grid/actions/toolbar.d.ts +84 -0
- package/src/grid/actions/virtual-scroll.d.ts +23 -0
- package/src/grid/actions.d.ts +39 -0
- package/src/grid/aggregate.d.ts +4 -0
- package/src/grid/base/constant.d.ts +559 -0
- package/src/grid/base/enum.d.ts +704 -0
- package/src/grid/base/grid.d.ts +3627 -0
- package/src/grid/base/interface.d.ts +2567 -0
- package/src/grid/base/string-literals.d.ts +87 -0
- package/src/grid/base/type.d.ts +42 -0
- package/src/grid/base/util.d.ts +747 -0
- package/src/grid/base.d.ts +11 -0
- package/src/grid/column-chooser.d.ts +4 -0
- package/src/grid/column-menu.d.ts +4 -0
- package/src/grid/command-column.d.ts +4 -0
- package/src/grid/common/checkbox-filter-base.d.ts +137 -0
- package/src/grid/common/excel-filter-base.d.ts +115 -0
- package/src/grid/common/filter-interface.d.ts +42 -0
- package/src/grid/common/index.d.ts +5 -0
- package/src/grid/common.d.ts +6 -0
- package/src/grid/context-menu.d.ts +4 -0
- package/src/grid/detail-row.d.ts +4 -0
- package/src/grid/edit.d.ts +4 -0
- package/src/grid/excel-export.d.ts +4 -0
- package/src/grid/filter.d.ts +4 -0
- package/src/grid/foreign-key.d.ts +4 -0
- package/src/grid/freeze.d.ts +4 -0
- package/src/grid/group.d.ts +4 -0
- package/src/grid/index.d.ts +9 -0
- package/src/grid/infinite-scroll.d.ts +4 -0
- package/src/grid/lazy-load-group.d.ts +4 -0
- package/src/grid/logger.d.ts +4 -0
- package/src/grid/models/aggregate.d.ts +138 -0
- package/src/grid/models/cell.d.ts +38 -0
- package/src/grid/models/column-chooser-settings.d.ts +20 -0
- package/src/grid/models/column.d.ts +1122 -0
- package/src/grid/models/models.d.ts +7 -0
- package/src/grid/models/page-settings.d.ts +55 -0
- package/src/grid/models/row.d.ts +62 -0
- package/src/grid/models.d.ts +7 -0
- package/src/grid/page.d.ts +4 -0
- package/src/grid/pdf-export.d.ts +4 -0
- package/src/grid/renderer/autocomplete-edit-cell.d.ts +20 -0
- package/src/grid/renderer/batch-edit-renderer.d.ts +23 -0
- package/src/grid/renderer/boolean-edit-cell.d.ts +30 -0
- package/src/grid/renderer/boolean-filter-ui.d.ts +42 -0
- package/src/grid/renderer/caption-cell-renderer.d.ts +45 -0
- package/src/grid/renderer/cell-merge-renderer.d.ts +23 -0
- package/src/grid/renderer/cell-renderer.d.ts +91 -0
- package/src/grid/renderer/column-freeze-renderer.d.ts +166 -0
- package/src/grid/renderer/combobox-edit-cell.d.ts +19 -0
- package/src/grid/renderer/command-column-renderer.d.ts +31 -0
- package/src/grid/renderer/content-renderer.d.ts +210 -0
- package/src/grid/renderer/date-filter-ui.d.ts +31 -0
- package/src/grid/renderer/datepicker-edit-cell.d.ts +20 -0
- package/src/grid/renderer/default-edit-cell.d.ts +22 -0
- package/src/grid/renderer/detail-expand-cell-renderer.d.ts +21 -0
- package/src/grid/renderer/detail-header-indent-renderer.d.ts +20 -0
- package/src/grid/renderer/dialog-edit-renderer.d.ts +39 -0
- package/src/grid/renderer/dropdown-edit-cell.d.ts +32 -0
- package/src/grid/renderer/edit-cell-base.d.ts +25 -0
- package/src/grid/renderer/edit-renderer.d.ts +35 -0
- package/src/grid/renderer/expand-cell-renderer.d.ts +28 -0
- package/src/grid/renderer/filter-cell-renderer.d.ts +36 -0
- package/src/grid/renderer/filter-menu-operator.d.ts +43 -0
- package/src/grid/renderer/filter-menu-renderer.d.ts +65 -0
- package/src/grid/renderer/footer-renderer.d.ts +50 -0
- package/src/grid/renderer/freeze-renderer.d.ts +142 -0
- package/src/grid/renderer/group-lazy-load-renderer.d.ts +177 -0
- package/src/grid/renderer/header-cell-renderer.d.ts +54 -0
- package/src/grid/renderer/header-indent-renderer.d.ts +20 -0
- package/src/grid/renderer/header-renderer.d.ts +156 -0
- package/src/grid/renderer/indent-cell-renderer.d.ts +20 -0
- package/src/grid/renderer/inline-edit-renderer.d.ts +39 -0
- package/src/grid/renderer/inputmask-edit-cell.d.ts +18 -0
- package/src/grid/renderer/multiselect-edit-cell.d.ts +18 -0
- package/src/grid/renderer/number-filter-ui.d.ts +30 -0
- package/src/grid/renderer/numeric-edit-cell.d.ts +27 -0
- package/src/grid/renderer/render.d.ts +104 -0
- package/src/grid/renderer/responsive-dialog-renderer.d.ts +84 -0
- package/src/grid/renderer/row-drag-drop-renderer.d.ts +20 -0
- package/src/grid/renderer/row-drag-header-indent-render.d.ts +20 -0
- package/src/grid/renderer/row-renderer.d.ts +55 -0
- package/src/grid/renderer/stacked-cell-renderer.d.ts +23 -0
- package/src/grid/renderer/string-filter-ui.d.ts +39 -0
- package/src/grid/renderer/summary-cell-renderer.d.ts +15 -0
- package/src/grid/renderer/template-edit-cell.d.ts +13 -0
- package/src/grid/renderer/timepicker-edit-cell.d.ts +18 -0
- package/src/grid/renderer/toggleswitch-edit-cell.d.ts +27 -0
- package/src/grid/renderer/virtual-content-renderer.d.ts +221 -0
- package/src/grid/renderer/virtual-freeze-renderer.d.ts +382 -0
- package/src/grid/renderer.d.ts +42 -0
- package/src/grid/reorder.d.ts +4 -0
- package/src/grid/resize.d.ts +4 -0
- package/src/grid/row-reorder.d.ts +4 -0
- package/src/grid/selection.d.ts +4 -0
- package/src/grid/services/aria-service.d.ts +34 -0
- package/src/grid/services/cell-render-factory.d.ts +14 -0
- package/src/grid/services/focus-strategy.d.ts +192 -0
- package/src/grid/services/freeze-row-model-generator.d.ts +14 -0
- package/src/grid/services/group-model-generator.d.ts +68 -0
- package/src/grid/services/intersection-observer.d.ts +23 -0
- package/src/grid/services/renderer-factory.d.ts +14 -0
- package/src/grid/services/row-model-generator.d.ts +41 -0
- package/src/grid/services/service-locator.d.ts +14 -0
- package/src/grid/services/summary-model-generator.d.ts +43 -0
- package/src/grid/services/value-formatter.d.ts +16 -0
- package/src/grid/services/virtual-row-model-generator.d.ts +55 -0
- package/src/grid/services/width-controller.d.ts +35 -0
- package/src/grid/services.d.ts +11 -0
- package/src/grid/sort.d.ts +4 -0
- package/src/grid/toolbar.d.ts +4 -0
- package/src/grid/virtual-scroll.d.ts +4 -0
- package/src/index.d.ts +5 -0
- package/src/pager/external-message.d.ts +55 -0
- package/src/pager/index.d.ts +9 -0
- package/src/pager/numeric-container.d.ts +78 -0
- package/src/pager/pager-dropdown.d.ts +68 -0
- package/src/pager/pager-message.d.ts +50 -0
- package/src/pager/pager.d.ts +341 -0
|
@@ -0,0 +1,1122 @@
|
|
|
1
|
+
import { NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';
|
|
2
|
+
import { DataManager } from '@syncfusion/ej2-data';
|
|
3
|
+
import { ICellFormatter, IFilterUI, IEditCell, CommandModel, IFilter, CommandButtonOptions, DataResult, IGrid } from '../base/interface';
|
|
4
|
+
import { TextAlign, ClipMode, Action, SortDirection, CommandButtonType, freezeDirection, freezeTable } from '../base/enum';
|
|
5
|
+
import { PredicateModel } from '../base/grid-model';
|
|
6
|
+
import { ValueAccessor, SortComparer, HeaderValueAccessor } from '../base/type';
|
|
7
|
+
/**
|
|
8
|
+
* Represents Grid `Column` model class.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Column {
|
|
11
|
+
/**
|
|
12
|
+
* Defines the field name of column which is mapped with mapping name of DataSource.
|
|
13
|
+
* The bounded columns can be sort, filter and group etc.,
|
|
14
|
+
* The `field` name must be a valid JavaScript identifier,
|
|
15
|
+
* the first character must be an alphabet and should not contain spaces and special characters.
|
|
16
|
+
*
|
|
17
|
+
* @default ''
|
|
18
|
+
*/
|
|
19
|
+
field: string;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the unique identifier value of the column. It is used to get the column object.
|
|
22
|
+
*
|
|
23
|
+
* @default ''
|
|
24
|
+
*/
|
|
25
|
+
uid: string;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the unique identifier value of the column. It is used to get the column object.
|
|
28
|
+
*
|
|
29
|
+
* @default null
|
|
30
|
+
*/
|
|
31
|
+
index: number;
|
|
32
|
+
/**
|
|
33
|
+
* Defines the header text of column which is used to display in column header.
|
|
34
|
+
* If `headerText` is not defined, then field name value will be assigned to header text.
|
|
35
|
+
*
|
|
36
|
+
* @default null
|
|
37
|
+
*/
|
|
38
|
+
headerText: string;
|
|
39
|
+
/**
|
|
40
|
+
* Defines the width of the column in pixels or percentage.
|
|
41
|
+
*
|
|
42
|
+
* @default ''
|
|
43
|
+
*/
|
|
44
|
+
width: string | number;
|
|
45
|
+
/**
|
|
46
|
+
* Defines the minimum Width of the column in pixels or percentage.
|
|
47
|
+
*
|
|
48
|
+
* @default ''
|
|
49
|
+
*/
|
|
50
|
+
minWidth: string | number;
|
|
51
|
+
/**
|
|
52
|
+
* Defines the maximum width of the column in pixel or percentage, which will restrict resizing beyond this pixel or percentage.
|
|
53
|
+
*
|
|
54
|
+
* @default ''
|
|
55
|
+
*/
|
|
56
|
+
maxWidth: string | number;
|
|
57
|
+
/**
|
|
58
|
+
* Defines the alignment of the column in both header and content cells.
|
|
59
|
+
*
|
|
60
|
+
* @default Left
|
|
61
|
+
*/
|
|
62
|
+
textAlign: TextAlign;
|
|
63
|
+
/**
|
|
64
|
+
* Defines the cell content's overflow mode. The available modes are
|
|
65
|
+
* * `Clip` - Truncates the cell content when it overflows its area.
|
|
66
|
+
* * `Ellipsis` - Displays ellipsis when the cell content overflows its area.
|
|
67
|
+
* * `EllipsisWithTooltip` - Displays ellipsis when the cell content overflows its area
|
|
68
|
+
* also it will display tooltip while hover on ellipsis applied cell.
|
|
69
|
+
*
|
|
70
|
+
* @default Ellipsis
|
|
71
|
+
*/
|
|
72
|
+
clipMode: ClipMode;
|
|
73
|
+
/**
|
|
74
|
+
* Define the alignment of column header which is used to align the text of column header.
|
|
75
|
+
*
|
|
76
|
+
* @default null
|
|
77
|
+
*/
|
|
78
|
+
headerTextAlign: TextAlign;
|
|
79
|
+
/**
|
|
80
|
+
* If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.
|
|
81
|
+
*
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
disableHtmlEncode: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Defines the data type of the column.
|
|
87
|
+
*
|
|
88
|
+
* @default null
|
|
89
|
+
*/
|
|
90
|
+
type: string;
|
|
91
|
+
/**
|
|
92
|
+
* It is used to change display value with the given format and does not affect the original data.
|
|
93
|
+
* Gets the format from the user which can be standard or custom
|
|
94
|
+
* [`number`](../base/internationalization/#number-formatting/)
|
|
95
|
+
* and [`date`](../base/internationalization/#date-formatting/) formats.
|
|
96
|
+
*
|
|
97
|
+
* @default null
|
|
98
|
+
* @aspType string
|
|
99
|
+
*/
|
|
100
|
+
format: string | NumberFormatOptions | DateFormatOptions;
|
|
101
|
+
/**
|
|
102
|
+
* If `visible` is set to false, hides the particular column. By default, columns are displayed.
|
|
103
|
+
*
|
|
104
|
+
* @default true
|
|
105
|
+
*/
|
|
106
|
+
visible: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Defines the column template that renders customized element in each cell of the column.
|
|
109
|
+
* It accepts either [template string](https://ej2.syncfusion.com/documentation/common/template-engine/) or HTML element ID.
|
|
110
|
+
*
|
|
111
|
+
* @default null
|
|
112
|
+
*/
|
|
113
|
+
template: string;
|
|
114
|
+
/**
|
|
115
|
+
* Defines the header template as string or HTML element ID which is used to add customized element in the column header.
|
|
116
|
+
*
|
|
117
|
+
* @default null
|
|
118
|
+
*/
|
|
119
|
+
headerTemplate: string;
|
|
120
|
+
/**
|
|
121
|
+
* You can use this property to freeze selected columns in grid
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
isFrozen: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* If `allowSorting` set to false, then it disables sorting option of a particular column.
|
|
128
|
+
* By default all columns are sortable.
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
allowSorting: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* If `allowResizing` is set to false, it disables resize option of a particular column.
|
|
135
|
+
* By default all the columns can be resized.
|
|
136
|
+
*
|
|
137
|
+
* @default true
|
|
138
|
+
*/
|
|
139
|
+
allowResizing: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* If `allowFiltering` set to false, then it disables filtering option and filter bar element of a particular column.
|
|
142
|
+
* By default all columns are filterable.
|
|
143
|
+
*
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
allowFiltering: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* If `allowGrouping` set to false, then it disables grouping of a particular column.
|
|
149
|
+
* By default all columns are groupable.
|
|
150
|
+
*
|
|
151
|
+
* @default true
|
|
152
|
+
*/
|
|
153
|
+
allowGrouping: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* If `allowReordering` set to false, then it disables reorder of a particular column.
|
|
156
|
+
* By default all columns can be reorder.
|
|
157
|
+
*
|
|
158
|
+
* @default true
|
|
159
|
+
*/
|
|
160
|
+
allowReordering: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* If `showColumnMenu` set to false, then it disable the column menu of a particular column.
|
|
163
|
+
* By default column menu will show for all columns
|
|
164
|
+
*
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
showColumnMenu: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* If `enableGroupByFormat` set to true, then it groups the particular column by formatted values.
|
|
170
|
+
*
|
|
171
|
+
* @default true
|
|
172
|
+
*/
|
|
173
|
+
enableGroupByFormat: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* If `allowEditing` set to false, then it disables editing of a particular column.
|
|
176
|
+
* By default all columns are editable.
|
|
177
|
+
*
|
|
178
|
+
* @default true
|
|
179
|
+
*/
|
|
180
|
+
allowEditing: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* The CSS styles and attributes of the content cells of a particular column can be customized.
|
|
183
|
+
*
|
|
184
|
+
* {% codeBlock src="grid/custom-attribute-api/index.ts" %}{% endcodeBlock %}
|
|
185
|
+
*
|
|
186
|
+
* @default null
|
|
187
|
+
*/
|
|
188
|
+
customAttributes: {
|
|
189
|
+
[x: string]: Object;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* If `displayAsCheckBox` is set to true, it displays the column value as a check box instead of Boolean value.
|
|
193
|
+
*
|
|
194
|
+
* @default false
|
|
195
|
+
*/
|
|
196
|
+
displayAsCheckBox: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Defines the column data source which will act as foreign data source.
|
|
199
|
+
*
|
|
200
|
+
* @default null
|
|
201
|
+
*/
|
|
202
|
+
dataSource: Object[] | DataManager | DataResult;
|
|
203
|
+
/**
|
|
204
|
+
* Defines the method which is used to achieve custom formatting from an external function.
|
|
205
|
+
* This function triggers before rendering of each cell.
|
|
206
|
+
* {% codeBlock src="grid/formatter-api/index.ts" %}{% endcodeBlock %}
|
|
207
|
+
*
|
|
208
|
+
* @default null
|
|
209
|
+
*/
|
|
210
|
+
formatter: {
|
|
211
|
+
new (): ICellFormatter;
|
|
212
|
+
} | ICellFormatter | Function;
|
|
213
|
+
/**
|
|
214
|
+
* Defines the method used to apply custom cell values from external function and display this on each cell rendered.
|
|
215
|
+
*
|
|
216
|
+
* {% codeBlock src="grid/value-accessor-api/index.ts" %}{% endcodeBlock %}
|
|
217
|
+
*
|
|
218
|
+
* @default null
|
|
219
|
+
*/
|
|
220
|
+
valueAccessor: ValueAccessor | string;
|
|
221
|
+
/**
|
|
222
|
+
* Defines the method used to apply custom header cell values from external function and display this on each header cell rendered.
|
|
223
|
+
*
|
|
224
|
+
* @default null
|
|
225
|
+
*/
|
|
226
|
+
headerValueAccessor: HeaderValueAccessor | string;
|
|
227
|
+
/**
|
|
228
|
+
* The `filterBarTemplate` is used to add a custom component instead of default input component for filter bar.
|
|
229
|
+
* It have create and read functions.
|
|
230
|
+
* * create: It is used for creating custom components.
|
|
231
|
+
* * read: It is used to perform custom filter action.
|
|
232
|
+
*
|
|
233
|
+
* {% codeBlock src="grid/filter-template-api/index.ts" %}{% endcodeBlock %}
|
|
234
|
+
*
|
|
235
|
+
* @default null
|
|
236
|
+
*/
|
|
237
|
+
filterBarTemplate: IFilterUI;
|
|
238
|
+
/**
|
|
239
|
+
* It is used to customize the default filter options for a specific columns.
|
|
240
|
+
* * type - Specifies the filter type as menu or checkbox.
|
|
241
|
+
* * ui - to render custom component for specific column it has following functions.
|
|
242
|
+
* * ui.create – It is used for creating custom components.
|
|
243
|
+
* * ui.read - It is used for read the value from the component.
|
|
244
|
+
* * ui.write - It is used to apply component model as dynamically.
|
|
245
|
+
* {% codeBlock src="grid/filter-menu-api/index.ts" %}{% endcodeBlock %}
|
|
246
|
+
*
|
|
247
|
+
* > Check the [`Filter UI`](../../grid/filtering/filter-menu/#custom-component-in-filter-menu) for its customization.
|
|
248
|
+
*
|
|
249
|
+
* @default {}
|
|
250
|
+
*/
|
|
251
|
+
filter: IFilter;
|
|
252
|
+
/**
|
|
253
|
+
* Used to render multiple header rows(stacked headers) on the Grid header.
|
|
254
|
+
*
|
|
255
|
+
* @default null
|
|
256
|
+
*/
|
|
257
|
+
columns: Column[] | string[] | ColumnModel[];
|
|
258
|
+
/**
|
|
259
|
+
* Defines the tool tip text for stacked headers.
|
|
260
|
+
*
|
|
261
|
+
* @default null
|
|
262
|
+
* @hidden
|
|
263
|
+
*/
|
|
264
|
+
toolTip: string;
|
|
265
|
+
/**
|
|
266
|
+
* If `isPrimaryKey` is set to true, considers this column as the primary key constraint.
|
|
267
|
+
*
|
|
268
|
+
* @default false
|
|
269
|
+
*/
|
|
270
|
+
isPrimaryKey: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Column visibility can change based on [`Media Queries`](http://cssmediaqueries.com/what-are-css-media-queries.html).
|
|
273
|
+
* `hideAtMedia` accepts only valid Media Queries.
|
|
274
|
+
*
|
|
275
|
+
* @default ''
|
|
276
|
+
*/
|
|
277
|
+
hideAtMedia?: string;
|
|
278
|
+
/**
|
|
279
|
+
* If `showInColumnChooser` set to false, then hide the particular column in column chooser.
|
|
280
|
+
* By default all columns are displayed in column Chooser.
|
|
281
|
+
*
|
|
282
|
+
* @default true
|
|
283
|
+
*/
|
|
284
|
+
showInColumnChooser?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Defines the type of component for editable.
|
|
287
|
+
*
|
|
288
|
+
* @default 'stringedit'
|
|
289
|
+
*/
|
|
290
|
+
editType: string;
|
|
291
|
+
/**
|
|
292
|
+
* Defines rules to validate data before creating and updating.
|
|
293
|
+
*
|
|
294
|
+
* @default null
|
|
295
|
+
*/
|
|
296
|
+
validationRules: Object;
|
|
297
|
+
/**
|
|
298
|
+
* Defines default values for the component when adding a new record to the Grid.
|
|
299
|
+
*
|
|
300
|
+
* @default null
|
|
301
|
+
* @aspType object
|
|
302
|
+
*/
|
|
303
|
+
defaultValue: string;
|
|
304
|
+
/**
|
|
305
|
+
* Defines the `IEditCell` object to customize default edit cell.
|
|
306
|
+
*
|
|
307
|
+
* @default {}
|
|
308
|
+
*/
|
|
309
|
+
edit: IEditCell;
|
|
310
|
+
/**
|
|
311
|
+
* If `isIdentity` is set to true, then this column is considered as identity column.
|
|
312
|
+
*
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
isIdentity: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Defines the display column name from the foreign data source which will be obtained from comparing local and foreign data.
|
|
318
|
+
*
|
|
319
|
+
* @default null
|
|
320
|
+
*/
|
|
321
|
+
foreignKeyValue: string;
|
|
322
|
+
/**
|
|
323
|
+
* Defines the mapping column name of the foreign data source.
|
|
324
|
+
* If it is not defined then the `columns.field` will be considered as mapping column name
|
|
325
|
+
*
|
|
326
|
+
* @default null
|
|
327
|
+
*/
|
|
328
|
+
foreignKeyField: string;
|
|
329
|
+
/**
|
|
330
|
+
* @hidden
|
|
331
|
+
* Defines the commands column template as string or HTML element ID which is used to add
|
|
332
|
+
* customized command buttons in each cells of the column.
|
|
333
|
+
*/
|
|
334
|
+
commandsTemplate: string;
|
|
335
|
+
/**
|
|
336
|
+
* `commands` provides an option to display command buttons in every cell.
|
|
337
|
+
* The available built-in command buttons are
|
|
338
|
+
* * Edit - Edit the record.
|
|
339
|
+
* * Delete - Delete the record.
|
|
340
|
+
* * Save - Save the record.
|
|
341
|
+
* * Cancel - Cancel the edit state.
|
|
342
|
+
* {% codeBlock src="grid/command-column-api/index.ts" %}{% endcodeBlock %}
|
|
343
|
+
*
|
|
344
|
+
* @default null
|
|
345
|
+
*/
|
|
346
|
+
commands: CommandModel[];
|
|
347
|
+
/**
|
|
348
|
+
* @hidden
|
|
349
|
+
* Gets the current view foreign key data.
|
|
350
|
+
*
|
|
351
|
+
* @default []
|
|
352
|
+
*/
|
|
353
|
+
columnData: Object[];
|
|
354
|
+
/**
|
|
355
|
+
* Defines the cell edit template that used as editor for a particular column.
|
|
356
|
+
* It accepts either template string or HTML element ID.
|
|
357
|
+
*
|
|
358
|
+
* @default null
|
|
359
|
+
* @aspIgnore
|
|
360
|
+
*/
|
|
361
|
+
editTemplate: string;
|
|
362
|
+
/**
|
|
363
|
+
* Defines the filter template/UI that used as filter for a particular column.
|
|
364
|
+
* It accepts either template string or HTML element ID.
|
|
365
|
+
*
|
|
366
|
+
* @default null
|
|
367
|
+
* @aspIgnore
|
|
368
|
+
*/
|
|
369
|
+
filterTemplate: string;
|
|
370
|
+
/** @hidden */
|
|
371
|
+
toJSON: Function;
|
|
372
|
+
/**
|
|
373
|
+
* Defines the mapping column name of the foreign data source.
|
|
374
|
+
* If it is not defined then the `columns.field` will be considered as mapping column name
|
|
375
|
+
*
|
|
376
|
+
* @default false
|
|
377
|
+
*/
|
|
378
|
+
lockColumn: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* If `allowSearching` set to false, then it disables Searching of a particular column.
|
|
381
|
+
* By default all columns allow Searching.
|
|
382
|
+
*
|
|
383
|
+
* @default true
|
|
384
|
+
*/
|
|
385
|
+
allowSearching: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* If `autoFit` set to true, then the particular column content width will be
|
|
388
|
+
* adjusted based on its content in the initial rendering itself.
|
|
389
|
+
* Setting this property as true is equivalent to calling `autoFitColumns` method in the `dataBound` event.
|
|
390
|
+
*
|
|
391
|
+
* @default false
|
|
392
|
+
*/
|
|
393
|
+
autoFit: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* defines which side the column need to freeze
|
|
396
|
+
* The available built-in freeze directions are
|
|
397
|
+
* * Left - Freeze the column at left side.
|
|
398
|
+
* * Right - Freeze the column at right side.
|
|
399
|
+
*
|
|
400
|
+
* @default null
|
|
401
|
+
*/
|
|
402
|
+
freeze: freezeDirection;
|
|
403
|
+
private parent;
|
|
404
|
+
/**
|
|
405
|
+
* @hidden
|
|
406
|
+
* Sets the selected state.
|
|
407
|
+
* @default false
|
|
408
|
+
*/
|
|
409
|
+
isSelected: boolean;
|
|
410
|
+
constructor(options: ColumnModel, parent?: IGrid);
|
|
411
|
+
private formatFn;
|
|
412
|
+
private parserFn;
|
|
413
|
+
private templateFn;
|
|
414
|
+
private fltrTemplateFn;
|
|
415
|
+
private headerTemplateFn;
|
|
416
|
+
private editTemplateFn;
|
|
417
|
+
private filterTemplateFn;
|
|
418
|
+
private sortDirection;
|
|
419
|
+
/** @hidden */
|
|
420
|
+
freezeTable: freezeTable;
|
|
421
|
+
/**
|
|
422
|
+
* @returns {Function} returns the edit template
|
|
423
|
+
* @hidden */
|
|
424
|
+
getEditTemplate: Function;
|
|
425
|
+
/**
|
|
426
|
+
* @returns {Function} returns the filter template
|
|
427
|
+
* @hidden */
|
|
428
|
+
getFilterTemplate: Function;
|
|
429
|
+
/**
|
|
430
|
+
* @returns {string} returns the sort direction
|
|
431
|
+
* @hidden */
|
|
432
|
+
getSortDirection(): string;
|
|
433
|
+
/**
|
|
434
|
+
* @param {string} direction - specifies the direction
|
|
435
|
+
* @returns {void}
|
|
436
|
+
* @hidden
|
|
437
|
+
*/
|
|
438
|
+
setSortDirection(direction: string): void;
|
|
439
|
+
/**
|
|
440
|
+
* @returns {freezeTable} returns the FreezeTable
|
|
441
|
+
* @hidden */
|
|
442
|
+
getFreezeTableName(): freezeTable;
|
|
443
|
+
/**
|
|
444
|
+
* @param {Column} column - specifies the column
|
|
445
|
+
* @returns {void}
|
|
446
|
+
* @hidden
|
|
447
|
+
*/
|
|
448
|
+
setProperties(column: Column): void;
|
|
449
|
+
/**
|
|
450
|
+
* Defines the custom sort comparer function.
|
|
451
|
+
* The sort comparer function has the same functionality like
|
|
452
|
+
* [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) sort comparer.
|
|
453
|
+
* {% codeBlock src="grid/sort-comparer-api/index.ts" %}{% endcodeBlock %}
|
|
454
|
+
*/
|
|
455
|
+
sortComparer: SortComparer | string;
|
|
456
|
+
/**
|
|
457
|
+
* @returns {boolean} returns true for foreign column
|
|
458
|
+
* @hidden
|
|
459
|
+
* It defines the column is foreign key column or not.
|
|
460
|
+
*/
|
|
461
|
+
isForeignColumn(): boolean;
|
|
462
|
+
/**
|
|
463
|
+
* @returns {Function} returns the function
|
|
464
|
+
* @hidden
|
|
465
|
+
*/
|
|
466
|
+
getFormatter(): Function;
|
|
467
|
+
/**
|
|
468
|
+
* @param {Function} value - specifies the value
|
|
469
|
+
* @returns {void}
|
|
470
|
+
* @hidden
|
|
471
|
+
*/
|
|
472
|
+
setFormatter(value: Function): void;
|
|
473
|
+
/**
|
|
474
|
+
* @returns {Function} returns the function
|
|
475
|
+
* @hidden */
|
|
476
|
+
getParser(): Function;
|
|
477
|
+
/**
|
|
478
|
+
* @param {Function} value - specifies the value
|
|
479
|
+
* @returns {void}
|
|
480
|
+
* @hidden
|
|
481
|
+
*/
|
|
482
|
+
setParser(value: Function): void;
|
|
483
|
+
/**
|
|
484
|
+
* @returns {Function} returns the function
|
|
485
|
+
* @hidden */
|
|
486
|
+
getColumnTemplate(): Function;
|
|
487
|
+
/**
|
|
488
|
+
* @returns {Function} returns the function
|
|
489
|
+
* @hidden */
|
|
490
|
+
getHeaderTemplate(): Function;
|
|
491
|
+
/**
|
|
492
|
+
* @returns {Function} returns the function
|
|
493
|
+
* @hidden */
|
|
494
|
+
getFilterItemTemplate(): Function;
|
|
495
|
+
/**
|
|
496
|
+
* @returns {string} returns the string
|
|
497
|
+
* @hidden */
|
|
498
|
+
getDomSetter(): string;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Interface for a class Column
|
|
502
|
+
*/
|
|
503
|
+
export interface ColumnModel {
|
|
504
|
+
/**
|
|
505
|
+
* Defines the field name of column which is mapped with mapping name of DataSource.
|
|
506
|
+
* The bounded columns can be sort, filter and group etc.,
|
|
507
|
+
* If the `field` name contains “dot”, then it is considered as complex binding.
|
|
508
|
+
* The `field` name must be a valid JavaScript identifier,
|
|
509
|
+
* the first character must be an alphabet and should not contain spaces and special characters.
|
|
510
|
+
*
|
|
511
|
+
* @default ''
|
|
512
|
+
*/
|
|
513
|
+
field?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Gets the unique identifier value of the column. It is used to get the object.
|
|
516
|
+
*
|
|
517
|
+
* @default ''
|
|
518
|
+
*/
|
|
519
|
+
uid?: string;
|
|
520
|
+
/**
|
|
521
|
+
* Gets the unique identifier value of the column. It is used to get the object.
|
|
522
|
+
*
|
|
523
|
+
* @default null
|
|
524
|
+
*/
|
|
525
|
+
index?: number;
|
|
526
|
+
/**
|
|
527
|
+
* Defines the header text of column which is used to display in column header.
|
|
528
|
+
* If `headerText` is not defined, then field name value will be assigned to header text.
|
|
529
|
+
*
|
|
530
|
+
* @default null
|
|
531
|
+
*/
|
|
532
|
+
headerText?: string;
|
|
533
|
+
/**
|
|
534
|
+
* Defines the width of the column in pixels or percentage.
|
|
535
|
+
*
|
|
536
|
+
* @default ''
|
|
537
|
+
*/
|
|
538
|
+
width?: string | number;
|
|
539
|
+
/**
|
|
540
|
+
* Defines the minimum width of the column in pixels or percentage.
|
|
541
|
+
*
|
|
542
|
+
* @default ''
|
|
543
|
+
*/
|
|
544
|
+
minWidth?: string | number;
|
|
545
|
+
/**
|
|
546
|
+
* Defines the maximum width of the column in pixel or percentage, which will restrict resizing beyond this pixel or percentage.
|
|
547
|
+
*
|
|
548
|
+
* @default ''
|
|
549
|
+
*/
|
|
550
|
+
maxWidth?: string | number;
|
|
551
|
+
/**
|
|
552
|
+
* Defines the alignment of the column in both header and content cells.
|
|
553
|
+
*
|
|
554
|
+
* @default Left
|
|
555
|
+
*/
|
|
556
|
+
textAlign?: TextAlign;
|
|
557
|
+
/**
|
|
558
|
+
* Defines the cell content's overflow mode. The available modes are
|
|
559
|
+
* * `Clip` - Truncates the cell content when it overflows its area.
|
|
560
|
+
* * `Ellipsis` - Displays ellipsis when the cell content overflows its area.
|
|
561
|
+
* * `EllipsisWithTooltip` - Displays ellipsis when the cell content overflows its area
|
|
562
|
+
* also it will display tooltip while hover on ellipsis applied cell.
|
|
563
|
+
*
|
|
564
|
+
* @default Ellipsis
|
|
565
|
+
*/
|
|
566
|
+
clipMode?: ClipMode;
|
|
567
|
+
/**
|
|
568
|
+
* Define the alignment of column header which is used to align the text of column header.
|
|
569
|
+
*
|
|
570
|
+
* @aspdefaultvalueignore
|
|
571
|
+
* @default null
|
|
572
|
+
*/
|
|
573
|
+
headerTextAlign?: TextAlign;
|
|
574
|
+
/**
|
|
575
|
+
* If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.
|
|
576
|
+
*
|
|
577
|
+
* @default true
|
|
578
|
+
*/
|
|
579
|
+
disableHtmlEncode?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Defines the data type of the column.
|
|
582
|
+
*
|
|
583
|
+
* @default null
|
|
584
|
+
*/
|
|
585
|
+
type?: string;
|
|
586
|
+
/**
|
|
587
|
+
* It is used to change display value with the given format and does not affect the original data.
|
|
588
|
+
* Gets the format from the user which can be standard or custom
|
|
589
|
+
* [`number`](../../common/internationalization/#manipulating-numbers)
|
|
590
|
+
* and [`date`](../../common/internationalization/#manipulating-datetime) formats.
|
|
591
|
+
*
|
|
592
|
+
* @default null
|
|
593
|
+
* @aspType string
|
|
594
|
+
*/
|
|
595
|
+
format?: string | NumberFormatOptions | DateFormatOptions;
|
|
596
|
+
/**
|
|
597
|
+
* If `visible` is set to false, hides the particular column. By default, all columns are displayed.
|
|
598
|
+
*
|
|
599
|
+
* @default true
|
|
600
|
+
*/
|
|
601
|
+
visible?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Defines the column template that renders customized element in each cell of the column.
|
|
604
|
+
* It accepts either [template string](../../common/template-engine/) or HTML element ID.
|
|
605
|
+
*
|
|
606
|
+
* @default null
|
|
607
|
+
*/
|
|
608
|
+
template?: string;
|
|
609
|
+
/**
|
|
610
|
+
* Defines the column template as string or HTML element ID which is used to add customized element in the column header.
|
|
611
|
+
*
|
|
612
|
+
* @default null
|
|
613
|
+
*/
|
|
614
|
+
headerTemplate?: string;
|
|
615
|
+
/**
|
|
616
|
+
* You can use this property to freeze selected columns in grid.
|
|
617
|
+
*
|
|
618
|
+
* @default false
|
|
619
|
+
*/
|
|
620
|
+
isFrozen?: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* If `allowSorting` set to false, then it disables sorting option of a particular column.
|
|
623
|
+
* By default all columns are sortable.
|
|
624
|
+
*
|
|
625
|
+
* @default true
|
|
626
|
+
*/
|
|
627
|
+
allowSorting?: boolean;
|
|
628
|
+
/**
|
|
629
|
+
* If `allowResizing` set to false, it disables resize option of a particular column.
|
|
630
|
+
*
|
|
631
|
+
* @default true
|
|
632
|
+
*/
|
|
633
|
+
allowResizing?: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* If `showColumnMenu` set to false, then it disable the column menu of a particular column.
|
|
636
|
+
* By default column menu will show for all columns
|
|
637
|
+
*
|
|
638
|
+
* @default true
|
|
639
|
+
*/
|
|
640
|
+
showColumnMenu?: boolean;
|
|
641
|
+
/**
|
|
642
|
+
* If `allowFiltering` set to false, then it disables filtering option and filter bar element of a particular column.
|
|
643
|
+
* By default all columns are filterable.
|
|
644
|
+
*
|
|
645
|
+
* @default true
|
|
646
|
+
*/
|
|
647
|
+
allowFiltering?: boolean;
|
|
648
|
+
/**
|
|
649
|
+
* If `allowGrouping` set to false, then it disables grouping of a particular column.
|
|
650
|
+
* By default all columns are groupable.
|
|
651
|
+
*
|
|
652
|
+
* @default true
|
|
653
|
+
*/
|
|
654
|
+
allowGrouping?: boolean;
|
|
655
|
+
/**
|
|
656
|
+
* If `allowReordering` set to false, then it disables reorder of a particular column.
|
|
657
|
+
* By default all columns can be reorder.
|
|
658
|
+
*
|
|
659
|
+
* @default true
|
|
660
|
+
*/
|
|
661
|
+
allowReordering?: boolean;
|
|
662
|
+
/**
|
|
663
|
+
* If `enableGroupByFormat` set to true, then it groups the particular column by formatted values.
|
|
664
|
+
* By default no columns are group by format.
|
|
665
|
+
*
|
|
666
|
+
* @default true
|
|
667
|
+
*/
|
|
668
|
+
enableGroupByFormat?: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* If `allowEditing` set to false, then it disables editing of a particular column.
|
|
671
|
+
* By default all columns are editable.
|
|
672
|
+
*
|
|
673
|
+
* @default true
|
|
674
|
+
*/
|
|
675
|
+
allowEditing?: boolean;
|
|
676
|
+
/**
|
|
677
|
+
* @hidden
|
|
678
|
+
* Gets the current view foreign key data.
|
|
679
|
+
* @default []
|
|
680
|
+
*/
|
|
681
|
+
columnData?: Object[];
|
|
682
|
+
/**
|
|
683
|
+
* The CSS styles and attributes of the content cells of a particular column can be customized.
|
|
684
|
+
*
|
|
685
|
+
* ```html
|
|
686
|
+
* <div id="Grid"></div>
|
|
687
|
+
* ```
|
|
688
|
+
* ```typescript
|
|
689
|
+
* let gridObj: Grid = new Grid({
|
|
690
|
+
* dataSource: filterData,
|
|
691
|
+
* columns: [
|
|
692
|
+
* { field: 'OrderID', headerText: 'Order ID' },
|
|
693
|
+
* {
|
|
694
|
+
* field: 'EmployeeID', headerText: 'Employee ID', customAttributes: {
|
|
695
|
+
* class: 'employeeid',
|
|
696
|
+
* type: 'employee-id-cell'
|
|
697
|
+
* }
|
|
698
|
+
* }]
|
|
699
|
+
* });
|
|
700
|
+
* gridObj.appendTo('#Grid');
|
|
701
|
+
* ```
|
|
702
|
+
*
|
|
703
|
+
* @default null
|
|
704
|
+
*/
|
|
705
|
+
customAttributes?: {
|
|
706
|
+
[x: string]: Object;
|
|
707
|
+
};
|
|
708
|
+
/**
|
|
709
|
+
* If `displayAsCheckBox` is set to true, it displays the column value as a check box instead of Boolean value.
|
|
710
|
+
*
|
|
711
|
+
* @default false
|
|
712
|
+
*/
|
|
713
|
+
displayAsCheckBox?: boolean;
|
|
714
|
+
/**
|
|
715
|
+
* Defines the column data source which will act as foreign data source.
|
|
716
|
+
*
|
|
717
|
+
* @default null
|
|
718
|
+
*/
|
|
719
|
+
dataSource?: Object[] | DataManager | DataResult;
|
|
720
|
+
/**
|
|
721
|
+
* Defines the method which is used to achieve custom formatting from an external function.
|
|
722
|
+
* This function triggers before rendering of each cell.
|
|
723
|
+
*
|
|
724
|
+
* ```html
|
|
725
|
+
* <div id="Grid"></div>
|
|
726
|
+
* ```
|
|
727
|
+
* ```typescript
|
|
728
|
+
* class ExtendedFormatter implements ICellFormatter {
|
|
729
|
+
* public getValue(column: Column, data: Object): Object {
|
|
730
|
+
* return '<span style="color:' + (data['Verified'] ? 'green' : 'red') + '"><i>' + data['Verified'] + '</i><span>';
|
|
731
|
+
* }
|
|
732
|
+
* }
|
|
733
|
+
* let gridObj: Grid = new Grid({
|
|
734
|
+
* dataSource: filterData,
|
|
735
|
+
* columns: [
|
|
736
|
+
* { field: 'ShipName', headerText: 'Ship Name' },
|
|
737
|
+
* { field: 'Verified', headerText: 'Verified Status', formatter: ExtendedFormatter }]
|
|
738
|
+
* });
|
|
739
|
+
* gridObj.appendTo('#Grid');
|
|
740
|
+
* ```
|
|
741
|
+
*
|
|
742
|
+
* @default null
|
|
743
|
+
*/
|
|
744
|
+
formatter?: {
|
|
745
|
+
new (): ICellFormatter;
|
|
746
|
+
} | ICellFormatter | Function;
|
|
747
|
+
/**
|
|
748
|
+
* Defines the method used to apply custom cell values from external function and display this on each cell rendered.
|
|
749
|
+
*
|
|
750
|
+
* ```html
|
|
751
|
+
* <div id="Grid"></div>
|
|
752
|
+
* ```
|
|
753
|
+
* ```typescript
|
|
754
|
+
* let gridObj: Grid = new Grid({
|
|
755
|
+
* dataSource: [{ EmployeeID: 1, EmployeeName: ['John', 'M'] }, { EmployeeID: 2, EmployeeName: ['Peter', 'A'] }],
|
|
756
|
+
* columns: [
|
|
757
|
+
* { field: 'EmployeeID', headerText: 'Employee ID' },
|
|
758
|
+
* { field: 'EmployeeName', headerText: 'Employee First Name',
|
|
759
|
+
* valueAccessor: (field: string, data: Object, column: Column) => {
|
|
760
|
+
* return data['EmployeeName'][0];
|
|
761
|
+
* },
|
|
762
|
+
* }]
|
|
763
|
+
* });
|
|
764
|
+
* ```
|
|
765
|
+
*
|
|
766
|
+
* @default null
|
|
767
|
+
*/
|
|
768
|
+
valueAccessor?: ValueAccessor | string;
|
|
769
|
+
/**
|
|
770
|
+
* Defines the method used to apply custom header cell values from external function and display this on each cell rendered.
|
|
771
|
+
*
|
|
772
|
+
* ```html
|
|
773
|
+
* <div id="Grid"></div>
|
|
774
|
+
* ```
|
|
775
|
+
* ```typescript
|
|
776
|
+
* let gridObj: Grid = new Grid({
|
|
777
|
+
* dataSource: [{ EmployeeID: 1, EmployeeName: ['John', 'M'] }, { EmployeeID: 2, EmployeeName: ['Peter', 'A'] }],
|
|
778
|
+
* columns: [
|
|
779
|
+
* { field: 'EmployeeID', headerText: 'Employee ID' },
|
|
780
|
+
* { field: 'EmployeeName', headerText: 'Employee First Name',
|
|
781
|
+
* headerValueAccessor: (field: string,column: Column) => {
|
|
782
|
+
* return "newheadername";
|
|
783
|
+
* },
|
|
784
|
+
* }]
|
|
785
|
+
* });
|
|
786
|
+
* ```
|
|
787
|
+
*
|
|
788
|
+
* @default null
|
|
789
|
+
*/
|
|
790
|
+
headerValueAccessor?: HeaderValueAccessor | string;
|
|
791
|
+
/**
|
|
792
|
+
* The `filterBarTemplate` is used to add a custom component instead of default input component for filter bar.
|
|
793
|
+
* It have create and read functions.
|
|
794
|
+
* * create: It is used for creating custom components.
|
|
795
|
+
* * read: It is used to perform custom filter action.
|
|
796
|
+
*
|
|
797
|
+
* ```html
|
|
798
|
+
* <div id="Grid"></div>
|
|
799
|
+
* ```
|
|
800
|
+
* ```typescript
|
|
801
|
+
* let gridObj: Grid = new Grid({
|
|
802
|
+
* dataSource: filterData,
|
|
803
|
+
* columns: [
|
|
804
|
+
* { field: 'OrderID', headerText: 'Order ID' },
|
|
805
|
+
* {
|
|
806
|
+
* field: 'EmployeeID', filterBarTemplate: {
|
|
807
|
+
* create: (args: { element: Element, column: Column }) => {
|
|
808
|
+
* let input: HTMLInputElement = document.createElement('input');
|
|
809
|
+
* input.id = 'EmployeeID';
|
|
810
|
+
* input.type = 'text';
|
|
811
|
+
* return input;
|
|
812
|
+
* },
|
|
813
|
+
* write: (args: { element: Element, column: Column }) => {
|
|
814
|
+
* args.element.addEventListener('input', args.column.filterBarTemplate.read as EventListener);
|
|
815
|
+
* },
|
|
816
|
+
* read: (args: { element: HTMLInputElement, columnIndex: number, column: Column }) => {
|
|
817
|
+
* gridObj.filterByColumn(args.element.id, 'equal', args.element.value);
|
|
818
|
+
* }
|
|
819
|
+
* }
|
|
820
|
+
* }],
|
|
821
|
+
* allowFiltering: true
|
|
822
|
+
* });
|
|
823
|
+
* gridObj.appendTo('#Grid');
|
|
824
|
+
* ```
|
|
825
|
+
*
|
|
826
|
+
* @default null
|
|
827
|
+
*/
|
|
828
|
+
filterBarTemplate?: IFilterUI;
|
|
829
|
+
/**
|
|
830
|
+
* Defines the filter options to customize filtering for the particular column.
|
|
831
|
+
*
|
|
832
|
+
* @default null
|
|
833
|
+
*/
|
|
834
|
+
filter?: IFilter;
|
|
835
|
+
/**
|
|
836
|
+
* Used to render multiple header rows(stacked headers) on the Grid header.
|
|
837
|
+
*
|
|
838
|
+
* @default null
|
|
839
|
+
*/
|
|
840
|
+
columns?: Column[] | string[] | ColumnModel[];
|
|
841
|
+
/**
|
|
842
|
+
* Defines the tool tip text for stacked headers.
|
|
843
|
+
*
|
|
844
|
+
* @hidden
|
|
845
|
+
* @default null
|
|
846
|
+
*/
|
|
847
|
+
toolTip?: string;
|
|
848
|
+
/**
|
|
849
|
+
* If `isPrimaryKey` is set to true, considers this column as the primary key constraint.
|
|
850
|
+
*
|
|
851
|
+
* @default false
|
|
852
|
+
*/
|
|
853
|
+
isPrimaryKey?: boolean;
|
|
854
|
+
/**
|
|
855
|
+
* Defines the type of component for editing.
|
|
856
|
+
*
|
|
857
|
+
* @default 'stringedit'
|
|
858
|
+
*/
|
|
859
|
+
editType?: string;
|
|
860
|
+
/**
|
|
861
|
+
* `editType`(../../grid/editing/edit-types/#customize-editors-using-params) Defines rules to validate data before creating and updating.
|
|
862
|
+
*
|
|
863
|
+
* @default null
|
|
864
|
+
*/
|
|
865
|
+
validationRules?: Object;
|
|
866
|
+
/**
|
|
867
|
+
* Defines default values for the component when adding a new record to the Grid.
|
|
868
|
+
*
|
|
869
|
+
* @default null
|
|
870
|
+
* @aspType object
|
|
871
|
+
*/
|
|
872
|
+
defaultValue?: string;
|
|
873
|
+
/**
|
|
874
|
+
* Defines the `IEditCell`(../../grid/editing/edit-types/#custom-editors-using-template) object to customize default edit cell.
|
|
875
|
+
*
|
|
876
|
+
* @default {}
|
|
877
|
+
*/
|
|
878
|
+
edit?: IEditCell;
|
|
879
|
+
/**
|
|
880
|
+
* If `isIdentity` is set to true, then this column is considered as identity column.
|
|
881
|
+
*
|
|
882
|
+
* @default false
|
|
883
|
+
*/
|
|
884
|
+
isIdentity?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* Defines the mapping column name of the foreign data source.
|
|
887
|
+
* If it is not defined then the `columns.field` will be considered as mapping column name
|
|
888
|
+
*
|
|
889
|
+
* @default null
|
|
890
|
+
*/
|
|
891
|
+
foreignKeyField?: string;
|
|
892
|
+
/**
|
|
893
|
+
* Defines the display column name from the foreign data source which will be obtained from comparing local and foreign data
|
|
894
|
+
*
|
|
895
|
+
* @default null
|
|
896
|
+
*/
|
|
897
|
+
foreignKeyValue?: string;
|
|
898
|
+
/**
|
|
899
|
+
* column visibility can change based on its [`Media Queries`](http://cssmediaqueries.com/what-are-css-media-queries.html).
|
|
900
|
+
* `hideAtMedia` accepts only valid Media Queries.
|
|
901
|
+
*
|
|
902
|
+
* @default ''
|
|
903
|
+
*/
|
|
904
|
+
hideAtMedia?: string;
|
|
905
|
+
/**
|
|
906
|
+
* If `showInColumnChooser` set to false, then hides the particular column in column chooser.
|
|
907
|
+
* By default all columns are displayed in column Chooser.
|
|
908
|
+
*
|
|
909
|
+
* @default true
|
|
910
|
+
*/
|
|
911
|
+
showInColumnChooser?: boolean;
|
|
912
|
+
/**
|
|
913
|
+
* @hidden
|
|
914
|
+
* Defines the commands column template as string or HTML element ID which is used to add
|
|
915
|
+
* customized command buttons in each cells of the column.
|
|
916
|
+
*/
|
|
917
|
+
commandsTemplate?: string;
|
|
918
|
+
/**
|
|
919
|
+
* `commands` provides an option to display command buttons in every cell.
|
|
920
|
+
* The available built-in command buttons are
|
|
921
|
+
* * Edit - Edit the record.
|
|
922
|
+
* * Delete - Delete the record.
|
|
923
|
+
* * Save - Save the record.
|
|
924
|
+
* * Cancel - Cancel the edit state.
|
|
925
|
+
*
|
|
926
|
+
* The following code example implements the custom command column.
|
|
927
|
+
* ```html
|
|
928
|
+
* <style type="text/css" class="cssStyles">
|
|
929
|
+
* .details-icon:before
|
|
930
|
+
* {
|
|
931
|
+
* content:"\e74d";
|
|
932
|
+
* }
|
|
933
|
+
* </style>
|
|
934
|
+
* <div id="Grid"></div>
|
|
935
|
+
* ```
|
|
936
|
+
* ```typescript
|
|
937
|
+
* var gridObj = new Grid({
|
|
938
|
+
* datasource: window.gridData,
|
|
939
|
+
* columns : [
|
|
940
|
+
* { field: 'CustomerID', headerText: 'Customer ID' },
|
|
941
|
+
* { field: 'CustomerName', headerText: 'Customer Name' },
|
|
942
|
+
* {commands: [{buttonOption:{content: 'Details', click: onClick, cssClass: details-icon}}], headerText: 'Customer Details'}
|
|
943
|
+
* ]
|
|
944
|
+
* gridObj.appendTo("#Grid");
|
|
945
|
+
* ```
|
|
946
|
+
*
|
|
947
|
+
* @default null
|
|
948
|
+
*/
|
|
949
|
+
commands?: CommandModel[];
|
|
950
|
+
/**
|
|
951
|
+
* It defines the custom sort comparer function.
|
|
952
|
+
*/
|
|
953
|
+
sortComparer?: SortComparer | string;
|
|
954
|
+
/**
|
|
955
|
+
* @hidden
|
|
956
|
+
* It defines the column is foreign key column or not.
|
|
957
|
+
*/
|
|
958
|
+
isForeignColumn?: () => boolean;
|
|
959
|
+
/**
|
|
960
|
+
* Defines the cell edit template that used as editor for a particular column.
|
|
961
|
+
* It accepts either template string or HTML element ID.
|
|
962
|
+
*
|
|
963
|
+
* @aspIgnore
|
|
964
|
+
*/
|
|
965
|
+
editTemplate?: string;
|
|
966
|
+
/**
|
|
967
|
+
* Defines the filter template/UI that used as filter for a particular column.
|
|
968
|
+
* It accepts either template string or HTML element ID.
|
|
969
|
+
*
|
|
970
|
+
* @aspIgnore
|
|
971
|
+
*/
|
|
972
|
+
filterTemplate?: string;
|
|
973
|
+
/**
|
|
974
|
+
* Defines the mapping column name of the foreign data source.
|
|
975
|
+
* If it is not defined then the `columns.field` will be considered as mapping column name
|
|
976
|
+
*
|
|
977
|
+
* @default false
|
|
978
|
+
*/
|
|
979
|
+
lockColumn?: boolean;
|
|
980
|
+
/**
|
|
981
|
+
* If `allowSearching` set to false, then it disables Searching of a particular column.
|
|
982
|
+
* By default all columns allow Searching.
|
|
983
|
+
*
|
|
984
|
+
* @default true
|
|
985
|
+
*/
|
|
986
|
+
allowSearching?: boolean;
|
|
987
|
+
/**
|
|
988
|
+
* If `autoFit` set to true, then the particular column content width will be
|
|
989
|
+
* adjusted based on its content in the initial rendering itself.
|
|
990
|
+
* Setting this property as true is equivalent to calling `autoFitColumns` method in the `dataBound` event.
|
|
991
|
+
*
|
|
992
|
+
* @default false
|
|
993
|
+
*/
|
|
994
|
+
autoFit?: boolean;
|
|
995
|
+
/**
|
|
996
|
+
* defines which side the column need to freeze
|
|
997
|
+
* The available built-in freeze directions are
|
|
998
|
+
* * Left - Freeze the column at left side.
|
|
999
|
+
* * Right - Freeze the column at right side.
|
|
1000
|
+
*
|
|
1001
|
+
* @default null
|
|
1002
|
+
*/
|
|
1003
|
+
freeze?: freezeDirection;
|
|
1004
|
+
}
|
|
1005
|
+
export interface ActionEventArgs {
|
|
1006
|
+
/** Defines the current action. */
|
|
1007
|
+
requestType?: Action;
|
|
1008
|
+
/** Defines the type of event. */
|
|
1009
|
+
type?: string;
|
|
1010
|
+
/** Cancel the print action */
|
|
1011
|
+
cancel?: boolean;
|
|
1012
|
+
/** Defines the previous page number. */
|
|
1013
|
+
previousPage?: number;
|
|
1014
|
+
/** Defines the current page number. */
|
|
1015
|
+
currentPage?: number;
|
|
1016
|
+
/** Defines the field name of the currently grouped columns. */
|
|
1017
|
+
columnName?: string;
|
|
1018
|
+
/** Defines the object that is currently filtered. */
|
|
1019
|
+
currentFilterObject?: PredicateModel;
|
|
1020
|
+
/** Defines the column name that is currently filtered. */
|
|
1021
|
+
currentFilteringColumn?: string;
|
|
1022
|
+
/** Defines the collection of filtered columns. */
|
|
1023
|
+
columns?: PredicateModel[];
|
|
1024
|
+
/** Defines the string value to search. */
|
|
1025
|
+
searchString?: string;
|
|
1026
|
+
/** Defines the direction of sort column. */
|
|
1027
|
+
direction?: SortDirection;
|
|
1028
|
+
/** Defines the record objects.
|
|
1029
|
+
*
|
|
1030
|
+
* @isGenericType true
|
|
1031
|
+
*/
|
|
1032
|
+
data?: Object;
|
|
1033
|
+
/** Defines the previous data.
|
|
1034
|
+
*
|
|
1035
|
+
* @isGenericType true
|
|
1036
|
+
*/
|
|
1037
|
+
previousData?: Object;
|
|
1038
|
+
/** Defines the added row. */
|
|
1039
|
+
row?: Object;
|
|
1040
|
+
/** Added row index */
|
|
1041
|
+
index?: number;
|
|
1042
|
+
/** Defines the record objects.
|
|
1043
|
+
*
|
|
1044
|
+
* @isGenericType true
|
|
1045
|
+
*/
|
|
1046
|
+
rowData?: Object;
|
|
1047
|
+
/** Defines the target for dialog */
|
|
1048
|
+
target?: HTMLElement;
|
|
1049
|
+
/** Defines the selected row index. */
|
|
1050
|
+
selectedRow?: number;
|
|
1051
|
+
/** Defines the current action. */
|
|
1052
|
+
action?: string;
|
|
1053
|
+
/** Defines foreign data object. */
|
|
1054
|
+
foreignKeyData?: Object;
|
|
1055
|
+
/** Define the form element */
|
|
1056
|
+
form?: HTMLFormElement;
|
|
1057
|
+
/** Define the movable table form element */
|
|
1058
|
+
movableForm?: HTMLFormElement;
|
|
1059
|
+
/** Defines the selected rows for delete. */
|
|
1060
|
+
tr?: Element[];
|
|
1061
|
+
/** Defines the primary keys */
|
|
1062
|
+
primaryKeys?: string[];
|
|
1063
|
+
/** Defines the primary key value */
|
|
1064
|
+
primaryKeyValue?: Object[];
|
|
1065
|
+
/** Defines the edited rowIndex */
|
|
1066
|
+
rowIndex?: number;
|
|
1067
|
+
/** Defines take number of data while Filtering */
|
|
1068
|
+
filterChoiceCount: number;
|
|
1069
|
+
/**
|
|
1070
|
+
* Defines the excel search operator
|
|
1071
|
+
*/
|
|
1072
|
+
excelSearchOperator: string;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Define options for custom command buttons.
|
|
1076
|
+
*/
|
|
1077
|
+
export declare class CommandColumnModel {
|
|
1078
|
+
/**
|
|
1079
|
+
* Define the command Button tooltip.
|
|
1080
|
+
*/
|
|
1081
|
+
title: string;
|
|
1082
|
+
/**
|
|
1083
|
+
* Define the command Button type.
|
|
1084
|
+
*/
|
|
1085
|
+
type: CommandButtonType;
|
|
1086
|
+
/**
|
|
1087
|
+
* Define the button model
|
|
1088
|
+
*/
|
|
1089
|
+
buttonOption: CommandButtonOptions;
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Defines Grid column
|
|
1093
|
+
*/
|
|
1094
|
+
export declare class GridColumn extends Column {
|
|
1095
|
+
/**
|
|
1096
|
+
* Defines stacked columns
|
|
1097
|
+
*
|
|
1098
|
+
* @default null
|
|
1099
|
+
*/
|
|
1100
|
+
columns: string[] | ColumnModel[];
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Interface for a class GridColumn
|
|
1104
|
+
*/
|
|
1105
|
+
export interface GridColumnModel extends ColumnModel {
|
|
1106
|
+
/**
|
|
1107
|
+
* Defines stacked columns
|
|
1108
|
+
*
|
|
1109
|
+
* @default null
|
|
1110
|
+
*/
|
|
1111
|
+
columns?: string[] | ColumnModel[];
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Defines stacked grid column
|
|
1115
|
+
*/
|
|
1116
|
+
export declare class StackedColumn extends GridColumn {
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Interface for a class stacked grid column
|
|
1120
|
+
*/
|
|
1121
|
+
export interface StackedColumnModel extends GridColumnModel {
|
|
1122
|
+
}
|