@syncfusion/ej2-treegrid 30.2.4 → 31.1.17
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-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +263 -157
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +291 -167
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/dist/ts/treegrid/actions/batch-edit.d.ts +74 -0
- package/dist/ts/treegrid/actions/batch-edit.ts +627 -0
- package/dist/ts/treegrid/actions/clipboard.d.ts +36 -0
- package/dist/ts/treegrid/actions/clipboard.ts +174 -0
- package/dist/ts/treegrid/actions/column-chooser.d.ts +37 -0
- package/dist/ts/treegrid/actions/column-chooser.ts +55 -0
- package/dist/ts/treegrid/actions/column-menu.d.ts +24 -0
- package/dist/ts/treegrid/actions/column-menu.ts +39 -0
- package/dist/ts/treegrid/actions/command-column.d.ts +24 -0
- package/dist/ts/treegrid/actions/command-column.ts +32 -0
- package/dist/ts/treegrid/actions/context-menu.d.ts +42 -0
- package/dist/ts/treegrid/actions/context-menu.ts +149 -0
- package/dist/ts/treegrid/actions/crud-actions.d.ts +66 -0
- package/dist/ts/treegrid/actions/crud-actions.ts +388 -0
- package/dist/ts/treegrid/actions/detail-row.d.ts +39 -0
- package/dist/ts/treegrid/actions/detail-row.ts +124 -0
- package/dist/ts/treegrid/actions/edit.d.ts +121 -0
- package/dist/ts/treegrid/actions/edit.ts +1083 -0
- package/dist/ts/treegrid/actions/excel-export.d.ts +67 -0
- package/dist/ts/treegrid/actions/excel-export.ts +240 -0
- package/dist/ts/treegrid/actions/filter.d.ts +57 -0
- package/dist/ts/treegrid/actions/filter.ts +231 -0
- package/dist/ts/treegrid/actions/freeze-column.d.ts +28 -0
- package/dist/ts/treegrid/actions/freeze-column.ts +119 -0
- package/dist/ts/treegrid/actions/index.d.ts +24 -0
- package/dist/ts/treegrid/actions/index.ts +24 -0
- package/dist/ts/treegrid/actions/infinite-scroll.d.ts +96 -0
- package/dist/ts/treegrid/actions/infinite-scroll.ts +320 -0
- package/dist/ts/treegrid/actions/logger.d.ts +25 -0
- package/dist/ts/treegrid/actions/logger.ts +136 -0
- package/dist/ts/treegrid/actions/page.d.ts +67 -0
- package/dist/ts/treegrid/actions/page.ts +212 -0
- package/dist/ts/treegrid/actions/pdf-export.d.ts +63 -0
- package/dist/ts/treegrid/actions/pdf-export.ts +182 -0
- package/dist/ts/treegrid/actions/print.d.ts +37 -0
- package/dist/ts/treegrid/actions/print.ts +69 -0
- package/dist/ts/treegrid/actions/reorder.d.ts +36 -0
- package/dist/ts/treegrid/actions/reorder.ts +60 -0
- package/dist/ts/treegrid/actions/resize.d.ts +36 -0
- package/dist/ts/treegrid/actions/resize.ts +54 -0
- package/dist/ts/treegrid/actions/rowdragdrop.d.ts +405 -0
- package/dist/ts/treegrid/actions/rowdragdrop.ts +1896 -0
- package/dist/ts/treegrid/actions/selection.d.ts +51 -0
- package/dist/ts/treegrid/actions/selection.ts +530 -0
- package/dist/ts/treegrid/actions/sort.d.ts +63 -0
- package/dist/ts/treegrid/actions/sort.ts +149 -0
- package/dist/ts/treegrid/actions/summary.d.ts +47 -0
- package/dist/ts/treegrid/actions/summary.ts +231 -0
- package/dist/ts/treegrid/actions/toolbar.d.ts +52 -0
- package/dist/ts/treegrid/actions/toolbar.ts +154 -0
- package/dist/ts/treegrid/actions/virtual-scroll.d.ts +90 -0
- package/dist/ts/treegrid/actions/virtual-scroll.ts +306 -0
- package/dist/ts/treegrid/base/constant.d.ts +158 -0
- package/dist/ts/treegrid/base/constant.ts +158 -0
- package/dist/ts/treegrid/base/data.d.ts +90 -0
- package/dist/ts/treegrid/base/data.ts +904 -0
- package/dist/ts/treegrid/base/index.d.ts +11 -0
- package/dist/ts/treegrid/base/index.ts +11 -0
- package/dist/ts/treegrid/base/interface.d.ts +186 -0
- package/dist/ts/treegrid/base/interface.ts +191 -0
- package/dist/ts/treegrid/base/treegrid-model.d.ts +1100 -0
- package/dist/ts/treegrid/base/treegrid.d.ts +2422 -0
- package/dist/ts/treegrid/base/treegrid.ts +5962 -0
- package/dist/ts/treegrid/enum.d.ts +152 -0
- package/dist/ts/treegrid/enum.ts +217 -0
- package/dist/ts/treegrid/index.d.ts +9 -0
- package/dist/ts/treegrid/index.ts +9 -0
- package/dist/ts/treegrid/models/column-chooser-settings-model.d.ts +62 -0
- package/dist/ts/treegrid/models/column-chooser-settings.d.ts +53 -0
- package/dist/ts/treegrid/models/column-chooser-settings.ts +67 -0
- package/dist/ts/treegrid/models/column-model.d.ts +30 -0
- package/dist/ts/treegrid/models/column.d.ts +697 -0
- package/dist/ts/treegrid/models/column.ts +800 -0
- package/dist/ts/treegrid/models/edit-settings-model.d.ts +100 -0
- package/dist/ts/treegrid/models/edit-settings.d.ts +89 -0
- package/dist/ts/treegrid/models/edit-settings.ts +111 -0
- package/dist/ts/treegrid/models/filter-settings-model.d.ts +216 -0
- package/dist/ts/treegrid/models/filter-settings.d.ts +195 -0
- package/dist/ts/treegrid/models/filter-settings.ts +237 -0
- package/dist/ts/treegrid/models/index.d.ts +24 -0
- package/dist/ts/treegrid/models/index.ts +24 -0
- package/dist/ts/treegrid/models/infinite-scroll-settings-model.d.ts +29 -0
- package/dist/ts/treegrid/models/infinite-scroll-settings.d.ts +25 -0
- package/dist/ts/treegrid/models/infinite-scroll-settings.ts +31 -0
- package/dist/ts/treegrid/models/loading-indicator-model.d.ts +21 -0
- package/dist/ts/treegrid/models/loading-indicator.d.ts +19 -0
- package/dist/ts/treegrid/models/loading-indicator.ts +21 -0
- package/dist/ts/treegrid/models/page-settings-model.d.ts +66 -0
- package/dist/ts/treegrid/models/page-settings.d.ts +57 -0
- package/dist/ts/treegrid/models/page-settings.ts +73 -0
- package/dist/ts/treegrid/models/rowdrop-settings-model.d.ts +15 -0
- package/dist/ts/treegrid/models/rowdrop-settings.d.ts +34 -0
- package/dist/ts/treegrid/models/rowdrop-settings.ts +37 -0
- package/dist/ts/treegrid/models/search-settings-model.d.ts +79 -0
- package/dist/ts/treegrid/models/search-settings.d.ts +73 -0
- package/dist/ts/treegrid/models/search-settings.ts +83 -0
- package/dist/ts/treegrid/models/selection-settings-model.d.ts +76 -0
- package/dist/ts/treegrid/models/selection-settings.d.ts +68 -0
- package/dist/ts/treegrid/models/selection-settings.ts +82 -0
- package/dist/ts/treegrid/models/sort-settings-model.d.ts +49 -0
- package/dist/ts/treegrid/models/sort-settings.d.ts +43 -0
- package/dist/ts/treegrid/models/sort-settings.ts +51 -0
- package/dist/ts/treegrid/models/summary-model.d.ts +93 -0
- package/dist/ts/treegrid/models/summary.d.ts +126 -0
- package/dist/ts/treegrid/models/summary.ts +170 -0
- package/dist/ts/treegrid/models/textwrap-settings-model.d.ts +21 -0
- package/dist/ts/treegrid/models/textwrap-settings.d.ts +19 -0
- package/dist/ts/treegrid/models/textwrap-settings.ts +21 -0
- package/dist/ts/treegrid/renderer/index.d.ts +5 -0
- package/dist/ts/treegrid/renderer/index.ts +5 -0
- package/dist/ts/treegrid/renderer/render.d.ts +41 -0
- package/dist/ts/treegrid/renderer/render.ts +379 -0
- package/dist/ts/treegrid/renderer/virtual-row-model-generator.d.ts +16 -0
- package/dist/ts/treegrid/renderer/virtual-row-model-generator.ts +90 -0
- package/dist/ts/treegrid/renderer/virtual-tree-content-render.d.ts +353 -0
- package/dist/ts/treegrid/renderer/virtual-tree-content-render.ts +1125 -0
- package/dist/ts/treegrid/utils.d.ts +70 -0
- package/dist/ts/treegrid/utils.ts +217 -0
- package/package.json +51 -15
- package/src/treegrid/actions/context-menu.js +3 -1
- package/src/treegrid/actions/excel-export.d.ts +8 -0
- package/src/treegrid/actions/excel-export.js +12 -0
- package/src/treegrid/actions/freeze-column.js +1 -1
- package/src/treegrid/actions/pdf-export.d.ts +8 -0
- package/src/treegrid/actions/pdf-export.js +12 -0
- package/src/treegrid/actions/selection.js +1 -1
- package/src/treegrid/actions/virtual-scroll.js +2 -2
- package/src/treegrid/base/data.js +1 -1
- package/src/treegrid/base/treegrid-model.d.ts +32 -2
- package/src/treegrid/base/treegrid.d.ts +29 -2
- package/src/treegrid/base/treegrid.js +39 -2
- package/src/treegrid/models/column-chooser-settings-model.d.ts +62 -0
- package/src/treegrid/models/column-chooser-settings.d.ts +53 -0
- package/src/treegrid/models/column-chooser-settings.js +52 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +3 -8
- package/src/treegrid/utils.js +22 -6
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* crud-actions.ts file
|
|
3
|
+
*/
|
|
4
|
+
import { ITreeData } from '../base/interface';
|
|
5
|
+
import { isNullOrUndefined, extend, getValue } from '@syncfusion/ej2-base';
|
|
6
|
+
import { TreeGrid } from '../base';
|
|
7
|
+
import { DataManager } from '@syncfusion/ej2-data';
|
|
8
|
+
import { extendArray, getPlainData, getParentData } from '../utils';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Performs CRUD update to Tree Grid data source
|
|
13
|
+
*
|
|
14
|
+
* @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type
|
|
15
|
+
* @param {TreeGrid} details.value - Gets modified record value
|
|
16
|
+
* @param {string} details.action - CRUD action type
|
|
17
|
+
* @param {TreeGrid} control - Tree Grid instance
|
|
18
|
+
* @param {boolean} isSelfReference - Denotes whether Self Referential data binding
|
|
19
|
+
* @param {number} addRowIndex - New add row index
|
|
20
|
+
* @param {number} selectedIndex - Selected Row index
|
|
21
|
+
* @param {string} columnName - Column field name
|
|
22
|
+
* @param {ITreeData} addRowRecord - Newly added record
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
export function editAction(details: { value: ITreeData, action: string }, control: TreeGrid, isSelfReference: boolean,
|
|
26
|
+
addRowIndex: number, selectedIndex: number, columnName?: string, addRowRecord?: ITreeData): void {
|
|
27
|
+
let value: ITreeData = details.value; const action: string = details.action; const changedRecords: string = 'changedRecords';
|
|
28
|
+
let i: number; let j: number; const addedRecords: string = 'addedRecords'; let batchChanges: Object;
|
|
29
|
+
const key: string = control.grid.getPrimaryKeyFieldNames()[0];
|
|
30
|
+
const treeData: ITreeData[] = control.dataSource instanceof DataManager ?
|
|
31
|
+
control.dataSource.dataSource.json : <Object[]>control.dataSource;
|
|
32
|
+
let modifiedData: Object[] = []; const originalData: ITreeData = value; let isSkip: boolean = false;
|
|
33
|
+
if (control.editSettings.mode === 'Batch') {
|
|
34
|
+
batchChanges = control.grid.editModule.getBatchChanges();
|
|
35
|
+
}
|
|
36
|
+
if (action === 'add' || (action === 'batchsave' && (control.editSettings.mode === 'Batch'
|
|
37
|
+
&& batchChanges[`${addedRecords}`].length))) {
|
|
38
|
+
const addAct: { value: Object, isSkip: boolean } = addAction(details, treeData, control, isSelfReference,
|
|
39
|
+
addRowIndex, selectedIndex, addRowRecord);
|
|
40
|
+
value = addAct.value; isSkip = addAct.isSkip;
|
|
41
|
+
}
|
|
42
|
+
if (value instanceof Array) {
|
|
43
|
+
modifiedData = extendArray(value);
|
|
44
|
+
} else {
|
|
45
|
+
modifiedData.push(extend({}, value));
|
|
46
|
+
}
|
|
47
|
+
if (!isSkip && (action !== 'add' ||
|
|
48
|
+
(control.editSettings.newRowPosition !== 'Top' && control.editSettings.newRowPosition !== 'Bottom'))) {
|
|
49
|
+
for (let k: number = 0; k < modifiedData.length; k++) {
|
|
50
|
+
if (typeof(modifiedData[parseInt(k.toString(), 10)][`${key}`]) === 'object') { modifiedData[parseInt(k.toString(), 10)] = modifiedData[parseInt(k.toString(), 10)][`${key}`]; }
|
|
51
|
+
const keys: string[] = (modifiedData[parseInt(k.toString(), 10)] as ITreeData).taskData ?
|
|
52
|
+
Object.keys((modifiedData[parseInt(k.toString(), 10)] as ITreeData).taskData) :
|
|
53
|
+
Object.keys(modifiedData[parseInt(k.toString(), 10)]);
|
|
54
|
+
i = treeData.length;
|
|
55
|
+
while (i-- && i >= 0) {
|
|
56
|
+
if (treeData[parseInt(i.toString(), 10)][`${key}`] === modifiedData[parseInt(k.toString(), 10)][`${key}`]) {
|
|
57
|
+
if (action === 'delete') {
|
|
58
|
+
const currentData: Object = treeData[parseInt(i.toString(), 10)]; treeData.splice(i, 1);
|
|
59
|
+
if (isSelfReference) {
|
|
60
|
+
if (!isNullOrUndefined(currentData[`${control.parentIdMapping}`])) {
|
|
61
|
+
const parentData: ITreeData = control.flatData.filter((e: ITreeData) =>
|
|
62
|
+
e[`${control.idMapping}`] === currentData[`${control.parentIdMapping}`])[0];
|
|
63
|
+
const childRecords: Object[] = parentData ? parentData[`${control.childMapping}`] : [];
|
|
64
|
+
for (let p: number = childRecords.length - 1; p >= 0; p--) {
|
|
65
|
+
if (childRecords[parseInt(p.toString(), 10)][`${control.idMapping}`] === currentData[`${control.idMapping}`]) {
|
|
66
|
+
if (!control.enableImmutableMode && parentData.childRecords.length === parentData['Children'].length) {
|
|
67
|
+
parentData['childRecords'].splice(p, 1);
|
|
68
|
+
}
|
|
69
|
+
childRecords.splice(p, 1);
|
|
70
|
+
if (!childRecords.length) {
|
|
71
|
+
parentData.hasChildRecords = false;
|
|
72
|
+
updateParentRow(key, parentData, action, control, isSelfReference);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
if (action === 'edit') {
|
|
82
|
+
for (j = 0; j < keys.length; j++) {
|
|
83
|
+
if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) && ((control.editSettings.mode !== 'Cell'
|
|
84
|
+
|| (!isNullOrUndefined(batchChanges) && batchChanges[`${changedRecords}`].length === 0))
|
|
85
|
+
|| keys[parseInt(j.toString(), 10)] === columnName)) {
|
|
86
|
+
const editedData: ITreeData =
|
|
87
|
+
getParentData(control, (<ITreeData>modifiedData[parseInt(k.toString(), 10)]).uniqueID);
|
|
88
|
+
treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =
|
|
89
|
+
modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];
|
|
90
|
+
if (editedData && editedData.taskData) {
|
|
91
|
+
editedData.taskData[keys[parseInt(j.toString(), 10)]] = editedData[keys[parseInt(j.toString(), 10)]]
|
|
92
|
+
= treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
} else if (action === 'add' || action === 'batchsave') {
|
|
97
|
+
let index: number;
|
|
98
|
+
if (control.editSettings.newRowPosition === 'Child') {
|
|
99
|
+
if (isSelfReference) {
|
|
100
|
+
originalData.taskData[`${control.parentIdMapping}`] = treeData[parseInt(i.toString(), 10)][`${control.idMapping}`];
|
|
101
|
+
treeData.splice(i + 1, 0, originalData.taskData);
|
|
102
|
+
} else {
|
|
103
|
+
if (!Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], control.childMapping)) {
|
|
104
|
+
treeData[parseInt(i.toString(), 10)][`${control.childMapping}`] = [];
|
|
105
|
+
}
|
|
106
|
+
treeData[parseInt(i.toString(), 10)][`${control.childMapping}`].push(originalData.taskData);
|
|
107
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control,
|
|
108
|
+
isSelfReference, originalData);
|
|
109
|
+
}
|
|
110
|
+
} else if (control.editSettings.newRowPosition === 'Below') {
|
|
111
|
+
treeData.splice(i + 1, 0, originalData.taskData);
|
|
112
|
+
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
113
|
+
updateParentRow(key, treeData[i + 1], action, control, isSelfReference, originalData);
|
|
114
|
+
}
|
|
115
|
+
} else if (!addRowIndex) { index = 0; treeData.splice(index, 0, originalData.taskData);
|
|
116
|
+
} else if (control.editSettings.newRowPosition === 'Above') {
|
|
117
|
+
treeData.splice(i, 0, originalData.taskData);
|
|
118
|
+
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
119
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control,
|
|
120
|
+
isSelfReference, originalData);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
} else if (!isNullOrUndefined(treeData[parseInt(i.toString(), 10)][`${control.childMapping}`])) {
|
|
127
|
+
if (removeChildRecords(treeData[parseInt(i.toString(), 10)][`${control.childMapping}`], modifiedData[parseInt(k.toString(), 10)], action, key, control,
|
|
128
|
+
isSelfReference, originalData, columnName)) {
|
|
129
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control, isSelfReference);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Performs Add action to Tree Grid data source
|
|
139
|
+
*
|
|
140
|
+
* @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type
|
|
141
|
+
* @param {TreeGrid} details.value - Gets modified record value
|
|
142
|
+
* @param {string} details.action - CRUD action type
|
|
143
|
+
* @param {Object[]} treeData - Tree Grid data source
|
|
144
|
+
* @param {TreeGrid} control - Tree Grid instance
|
|
145
|
+
* @param {boolean} isSelfReference - Denotes whether Self Referential data binding
|
|
146
|
+
* @param {number} addRowIndex - New add row index
|
|
147
|
+
* @param {number} selectedIndex - Selected Row index
|
|
148
|
+
* @param {ITreeData} addRowRecord - Newly added record
|
|
149
|
+
* @returns {void}
|
|
150
|
+
*/
|
|
151
|
+
export function addAction(details: { value: ITreeData, action: string }, treeData: Object[], control: TreeGrid, isSelfReference: boolean,
|
|
152
|
+
addRowIndex: number, selectedIndex: number, addRowRecord: ITreeData): { value: Object, isSkip: boolean } {
|
|
153
|
+
let value: Object; let isSkip: boolean = false;
|
|
154
|
+
const currentViewRecords: ITreeData[] = <ITreeData[]>control.grid.getCurrentViewRecords();
|
|
155
|
+
value = extend({}, details.value);
|
|
156
|
+
value = getPlainData(value);
|
|
157
|
+
switch (control.editSettings.newRowPosition) {
|
|
158
|
+
case 'Top':
|
|
159
|
+
treeData.unshift(value);
|
|
160
|
+
isSkip = true;
|
|
161
|
+
break;
|
|
162
|
+
case 'Bottom':
|
|
163
|
+
treeData.push(value);
|
|
164
|
+
isSkip = true;
|
|
165
|
+
break;
|
|
166
|
+
case 'Above':
|
|
167
|
+
if (!isNullOrUndefined(addRowRecord)) {
|
|
168
|
+
value = extend({}, addRowRecord);
|
|
169
|
+
value = getPlainData(value);
|
|
170
|
+
} else {
|
|
171
|
+
value = extend({}, currentViewRecords[addRowIndex + 1]);
|
|
172
|
+
value = getPlainData(value);
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case 'Below':
|
|
176
|
+
case 'Child':
|
|
177
|
+
if (!isNullOrUndefined(addRowRecord)) {
|
|
178
|
+
value = extend({}, addRowRecord);
|
|
179
|
+
value = getPlainData(value);
|
|
180
|
+
} else {
|
|
181
|
+
const primaryKeys: string = control.grid.getPrimaryKeyFieldNames()[0];
|
|
182
|
+
const currentdata: Object = currentViewRecords[parseInt(addRowIndex.toString(), 10)];
|
|
183
|
+
if (!isNullOrUndefined(currentdata) && currentdata[`${primaryKeys}`] === details.value[`${primaryKeys}`] || selectedIndex !== -1) {
|
|
184
|
+
value = extend({}, currentdata);
|
|
185
|
+
} else {
|
|
186
|
+
value = extend({}, details.value);
|
|
187
|
+
}
|
|
188
|
+
value = getPlainData(value);
|
|
189
|
+
const internalProperty: string = 'internalProperties';
|
|
190
|
+
(control.editModule[`${internalProperty}`] as ITreeData).taskData = value;
|
|
191
|
+
}
|
|
192
|
+
if (selectedIndex === -1) {
|
|
193
|
+
treeData.unshift(value);
|
|
194
|
+
isSkip = true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return { value: value, isSkip: isSkip };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @param {ITreeData[]} childRecords - Child Records collection
|
|
202
|
+
* @param {Object} modifiedData - Modified data in crud action
|
|
203
|
+
* @param {string} action - crud action type
|
|
204
|
+
* @param {string} key - Primary key field name
|
|
205
|
+
* @param {TreeGrid} control - Tree Grid instance
|
|
206
|
+
* @param {boolean} isSelfReference - Specified whether Self Referential data binding
|
|
207
|
+
* @param {ITreeData} originalData - Non updated data from data source, of edited data
|
|
208
|
+
* @param {string} columnName - column field name
|
|
209
|
+
* @returns {boolean} Returns whether child records exists
|
|
210
|
+
*/
|
|
211
|
+
export function removeChildRecords(childRecords: ITreeData[], modifiedData: Object, action: string, key: string, control: TreeGrid,
|
|
212
|
+
isSelfReference: boolean, originalData?: ITreeData, columnName?: string): boolean {
|
|
213
|
+
let isChildAll: boolean = false;
|
|
214
|
+
let j: number = childRecords.length;
|
|
215
|
+
while (j-- && j >= 0) {
|
|
216
|
+
if (childRecords[parseInt(j.toString(), 10)][`${key}`] === modifiedData[`${key}`] ||
|
|
217
|
+
(isSelfReference && childRecords[parseInt(j.toString(), 10)][control.parentIdMapping] === modifiedData[control.idMapping])) {
|
|
218
|
+
if (action === 'edit') {
|
|
219
|
+
const keys: string[] = Object.keys(modifiedData);
|
|
220
|
+
const editedData: ITreeData = getParentData(control, (<ITreeData>modifiedData).uniqueID);
|
|
221
|
+
for (let i: number = 0; i < keys.length; i++) {
|
|
222
|
+
if (Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&
|
|
223
|
+
(control.editSettings.mode !== 'Cell' || keys[parseInt(i.toString(), 10)] === columnName)) {
|
|
224
|
+
editedData[keys[parseInt(i.toString(), 10)]] =
|
|
225
|
+
editedData.taskData[keys[parseInt(i.toString(), 10)]] =
|
|
226
|
+
childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
|
|
227
|
+
modifiedData[keys[parseInt(i.toString(), 10)]];
|
|
228
|
+
if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
|
|
229
|
+
const editModule: string = 'editModule';
|
|
230
|
+
control.grid.editModule[`${editModule}`].editRowIndex = (<ITreeData>modifiedData).index;
|
|
231
|
+
control.grid.editModule[`${editModule}`].updateCurrentViewData(modifiedData);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
} else if (action === 'add' || action === 'batchsave') {
|
|
237
|
+
if (control.editSettings.newRowPosition === 'Child') {
|
|
238
|
+
if (isSelfReference) {
|
|
239
|
+
originalData[`${control.parentIdMapping}`] = childRecords[parseInt(j.toString(), 10)][control.idMapping];
|
|
240
|
+
childRecords.splice(j + 1, 0, originalData);
|
|
241
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
242
|
+
} else {
|
|
243
|
+
if (!Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], control.childMapping)) {
|
|
244
|
+
childRecords[parseInt(j.toString(), 10)][control.childMapping] = [];
|
|
245
|
+
}
|
|
246
|
+
childRecords[parseInt(j.toString(), 10)][control.childMapping].push(originalData.taskData);
|
|
247
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
248
|
+
}
|
|
249
|
+
} else if (control.editSettings.newRowPosition === 'Above') {
|
|
250
|
+
childRecords.splice(j, 0, originalData.taskData);
|
|
251
|
+
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
252
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
253
|
+
}
|
|
254
|
+
} else if (control.editSettings.newRowPosition === 'Below') {
|
|
255
|
+
childRecords.splice(j + 1, 0, originalData.taskData);
|
|
256
|
+
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
257
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
childRecords.splice(j, 1);
|
|
262
|
+
if (!childRecords.length) {
|
|
263
|
+
isChildAll = true;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} else if (!isNullOrUndefined(childRecords[parseInt(j.toString(), 10)][control.childMapping])) {
|
|
267
|
+
if (removeChildRecords(childRecords[parseInt(j.toString(), 10)][control.childMapping], modifiedData, action, key,
|
|
268
|
+
control, isSelfReference, originalData, columnName)) {
|
|
269
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return isChildAll;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @param {string} key - Primary key field name
|
|
278
|
+
* @param {ITreeData} record - Parent Record which has to be updated
|
|
279
|
+
* @param {string} action - CRUD action type
|
|
280
|
+
* @param {TreeGrid} control - Tree Grid instance
|
|
281
|
+
* @param {boolean} isSelfReference - Specified whether self referential data binding
|
|
282
|
+
* @param {ITreeData} child - Specifies child record
|
|
283
|
+
* @returns {void}
|
|
284
|
+
*/
|
|
285
|
+
export function updateParentRow(key: string, record: ITreeData, action: string, control: TreeGrid, isSelfReference: boolean,
|
|
286
|
+
child?: ITreeData): void {
|
|
287
|
+
|
|
288
|
+
if ((control.editSettings.newRowPosition === 'Above' || control.editSettings.newRowPosition === 'Below')
|
|
289
|
+
&& ((action === 'add' || action === 'batchsave')) && !isNullOrUndefined(child.parentItem)) {
|
|
290
|
+
const parentData: ITreeData = getParentData(control, child.parentItem.uniqueID);
|
|
291
|
+
parentData.childRecords.push(child);
|
|
292
|
+
} else {
|
|
293
|
+
const currentRecords: ITreeData[] = control.grid.getCurrentViewRecords();
|
|
294
|
+
let index: number;
|
|
295
|
+
currentRecords.map((e: ITreeData, i: number) => { if (e[`${key}`] === record[`${key}`]) { index = i; return; } });
|
|
296
|
+
if (control.enableVirtualization && isNullOrUndefined(index)) {
|
|
297
|
+
const updatedParent: ITreeData = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
|
|
298
|
+
record = updatedParent;
|
|
299
|
+
}
|
|
300
|
+
if (!isNullOrUndefined(index)) {
|
|
301
|
+
record = currentRecords[parseInt(index.toString(), 10)];
|
|
302
|
+
}
|
|
303
|
+
if (control.enableVirtualization && isNullOrUndefined(record) && !isNullOrUndefined(child)) {
|
|
304
|
+
record = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
|
|
305
|
+
}
|
|
306
|
+
if (!isSelfReference && !isNullOrUndefined(record.childRecords) && record.childRecords.length) {
|
|
307
|
+
record.hasChildRecords = true;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
record.hasChildRecords = false;
|
|
311
|
+
}
|
|
312
|
+
if (action === 'add' || action === 'batchsave') {
|
|
313
|
+
record.expanded = true;
|
|
314
|
+
record.hasChildRecords = true;
|
|
315
|
+
if (control.sortSettings.columns.length && isNullOrUndefined(child)) {
|
|
316
|
+
child = <ITreeData>currentRecords.filter((e: ITreeData) => {
|
|
317
|
+
if (e.parentUniqueID === record.uniqueID) {
|
|
318
|
+
return e;
|
|
319
|
+
} else {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
const childRecords: ITreeData = child ? child instanceof Array ? child[0] : child : currentRecords[index + 1];
|
|
325
|
+
if (control.editSettings.newRowPosition !== 'Below') {
|
|
326
|
+
if (!Object.prototype.hasOwnProperty.call(record, 'childRecords')) {
|
|
327
|
+
record.childRecords = [];
|
|
328
|
+
} else {
|
|
329
|
+
if (!isNullOrUndefined(child) && record[`${key}`] !== child[`${key}`]) {
|
|
330
|
+
if (!record.childRecords.some((records: ITreeData) => records.uniqueID === child.uniqueID)) {
|
|
331
|
+
record.childRecords.push(child);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (record.childRecords.indexOf(childRecords) === -1 && record[`${key}`] !== child[`${key}`]) {
|
|
336
|
+
record.childRecords.unshift(childRecords);
|
|
337
|
+
}
|
|
338
|
+
if (isSelfReference) {
|
|
339
|
+
if (!Object.prototype.hasOwnProperty.call(record, control.childMapping)) {
|
|
340
|
+
record[control.childMapping] = [];
|
|
341
|
+
}
|
|
342
|
+
if (record[`${control.childMapping}`].indexOf(childRecords) === -1 && record[`${key}`] !== child[`${key}`]) {
|
|
343
|
+
record[control.childMapping].unshift(childRecords);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const primaryKeys: string = control.grid.getPrimaryKeyFieldNames()[0];
|
|
349
|
+
const data: ITreeData[] = control.grid.dataSource instanceof DataManager ?
|
|
350
|
+
control.grid.dataSource.dataSource.json : <Object[]>control.grid.dataSource;
|
|
351
|
+
for (let i: number = 0; i < data.length; i++) {
|
|
352
|
+
if (data[parseInt(i.toString(), 10)][`${primaryKeys}`] === record[`${primaryKeys}`]) {
|
|
353
|
+
data[parseInt(i.toString(), 10)] = record;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
control.grid.setRowData(key, record);
|
|
358
|
+
let row: HTMLTableRowElement = <HTMLTableRowElement>control.getRowByIndex(index);
|
|
359
|
+
if (control.editSettings.mode === 'Batch') {
|
|
360
|
+
if (action === 'add') {
|
|
361
|
+
row = <HTMLTableRowElement>control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];
|
|
362
|
+
} else {
|
|
363
|
+
row = <HTMLTableRowElement>control.getRows()[control.grid.getRowIndexByPrimaryKey(record[`${key}`])];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
let movableRow: HTMLTableRowElement;
|
|
367
|
+
if (control.frozenRows || control.getFrozenColumns()) {
|
|
368
|
+
movableRow = <HTMLTableRowElement>control.getRowByIndex(index);
|
|
369
|
+
}
|
|
370
|
+
if (!control.enableVirtualization && !isNullOrUndefined(row) || !isNullOrUndefined(movableRow)) {
|
|
371
|
+
let index: number = control.treeColumnIndex;
|
|
372
|
+
if (control.allowRowDragAndDrop && control.enableImmutableMode) {
|
|
373
|
+
index = index + 1;
|
|
374
|
+
}
|
|
375
|
+
control.renderModule.cellRender({
|
|
376
|
+
data: record, cell: row.cells[parseInt(index.toString(), 10)] ? row.cells[parseInt(index.toString(), 10)]
|
|
377
|
+
: movableRow.cells[index - control.getFrozenColumns()],
|
|
378
|
+
column: control.grid.getColumns()[control.treeColumnIndex],
|
|
379
|
+
requestType: action
|
|
380
|
+
});
|
|
381
|
+
if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {
|
|
382
|
+
control.renderModule.RowModifier({
|
|
383
|
+
data: record, row: row
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TreeGrid } from '../base';
|
|
2
|
+
/**
|
|
3
|
+
* TreeGrid Detail Row module
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export declare class DetailRow {
|
|
8
|
+
private parent;
|
|
9
|
+
constructor(parent: TreeGrid);
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* For internal use only - Get the module name.
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
* @returns {string} Returns DetailRow module name
|
|
18
|
+
*/
|
|
19
|
+
protected getModuleName(): string;
|
|
20
|
+
addEventListener(): void;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
removeEventListener(): void;
|
|
26
|
+
private setIndentVisibility;
|
|
27
|
+
private dataBoundArg;
|
|
28
|
+
private childRowExpand;
|
|
29
|
+
private rowExpandCollapse;
|
|
30
|
+
private detaildataBound;
|
|
31
|
+
private actioncomplete;
|
|
32
|
+
/**
|
|
33
|
+
* Destroys the DetailModule.
|
|
34
|
+
*
|
|
35
|
+
* @function destroy
|
|
36
|
+
* @returns {void}
|
|
37
|
+
*/
|
|
38
|
+
destroy(): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Grid, getObject, Row, DetailDataBoundEventArgs, Cell, Column } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { DetailRow as detailrow } from '@syncfusion/ej2-grids';
|
|
3
|
+
import { TreeGrid, ITreeData, CellSaveEventArgs } from '../base';
|
|
4
|
+
import { isNullOrUndefined, addClass } from '@syncfusion/ej2-base';
|
|
5
|
+
import { getExpandStatus, isRemoteData } from '../utils';
|
|
6
|
+
import { FocusStrategy } from '@syncfusion/ej2-grids/src/grid/services/focus-strategy';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* TreeGrid Detail Row module
|
|
10
|
+
*
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export class DetailRow {
|
|
14
|
+
private parent: TreeGrid;
|
|
15
|
+
constructor(parent: TreeGrid) {
|
|
16
|
+
Grid.Inject(detailrow);
|
|
17
|
+
this.parent = parent;
|
|
18
|
+
this.addEventListener();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* For internal use only - Get the module name.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @returns {string} Returns DetailRow module name
|
|
28
|
+
*/
|
|
29
|
+
protected getModuleName(): string {
|
|
30
|
+
return 'detailRow';
|
|
31
|
+
}
|
|
32
|
+
public addEventListener(): void {
|
|
33
|
+
this.parent.on('dataBoundArg', this.dataBoundArg, this);
|
|
34
|
+
this.parent.on('detaildataBound', this.detaildataBound, this);
|
|
35
|
+
this.parent.grid.on('detail-indentcell-info', this.setIndentVisibility, this);
|
|
36
|
+
this.parent.on('childRowExpand', this.childRowExpand, this);
|
|
37
|
+
this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
|
|
38
|
+
this.parent.on('actioncomplete', this.actioncomplete, this);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
public removeEventListener(): void {
|
|
45
|
+
if (this.parent.isDestroyed) { return; }
|
|
46
|
+
this.parent.off('dataBoundArg', this.dataBoundArg);
|
|
47
|
+
this.parent.off('detaildataBound', this.detaildataBound);
|
|
48
|
+
this.parent.off('childRowExpand', this.childRowExpand);
|
|
49
|
+
this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
|
|
50
|
+
this.parent.off('actioncomplete', this.actioncomplete);
|
|
51
|
+
this.parent.grid.off('detail-indentcell-info', this.setIndentVisibility);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private setIndentVisibility(args: Object): void {
|
|
55
|
+
const visible: string = 'visible';
|
|
56
|
+
args[`${visible}`] = false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private dataBoundArg(): void {
|
|
60
|
+
const detailRows: HTMLTableRowElement[] = this.parent.getRows().filter((e: HTMLTableRowElement) => {
|
|
61
|
+
return !e.classList.contains('e-detailrow');
|
|
62
|
+
});
|
|
63
|
+
for (let i: number = 0; i < detailRows.length; i++) {
|
|
64
|
+
const elements: Object = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
|
|
65
|
+
const detailData: Row<Object> = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
|
|
66
|
+
const parentItem: Object = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
|
|
67
|
+
if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
|
|
68
|
+
getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
|
|
69
|
+
this.parent.grid.detailRowModule.expand(elements[0]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
private childRowExpand(args: { row: HTMLTableRowElement }): void {
|
|
74
|
+
const detailRowElement: Object = args.row.getElementsByClassName('e-detailrowcollapse');
|
|
75
|
+
if (!isNullOrUndefined(detailRowElement[0])) {
|
|
76
|
+
this.parent.grid.detailRowModule.expand(detailRowElement[0]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private rowExpandCollapse(args: { detailrows: HTMLTableRowElement[], action: string }): void {
|
|
81
|
+
if (isRemoteData(this.parent)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
for (let i: number = 0; i < args.detailrows.length; i++) {
|
|
85
|
+
this.parent['toggleRowVisibility'](args.detailrows[parseInt(i.toString(), 10)], args.action);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
private detaildataBound(args: DetailDataBoundEventArgs): void {
|
|
89
|
+
const data: ITreeData = <ITreeData>args.data;
|
|
90
|
+
const row: HTMLElement = args.detailElement.parentElement.previousSibling as HTMLElement;
|
|
91
|
+
const index: number = !isNullOrUndefined(data.parentItem) ? data.parentItem.index : data.index;
|
|
92
|
+
const expandClass: string = 'e-gridrowindex' + index + 'level' + data.level;
|
|
93
|
+
const classlist: DOMTokenList = row.querySelector('.' + expandClass).classList;
|
|
94
|
+
const gridClas: string[] = [].slice.call(classlist).filter((gridclass: string) => (gridclass === expandClass));
|
|
95
|
+
const newNo: number = gridClas[0].length;
|
|
96
|
+
const slicedclas: string = gridClas.toString().slice(6, newNo);
|
|
97
|
+
const detailClass: string = 'e-griddetail' + slicedclas;
|
|
98
|
+
addClass([args.detailElement.parentElement], detailClass);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private actioncomplete(args: CellSaveEventArgs): void {
|
|
102
|
+
if (args.requestType === 'beginEdit' || args.requestType === 'add') {
|
|
103
|
+
const colSpan: string = ((args.row as HTMLElement).querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
|
|
104
|
+
const colum: number = parseInt(colSpan, 10) - 1;
|
|
105
|
+
(args.row as HTMLElement).querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
|
|
106
|
+
}
|
|
107
|
+
const focusElement: Row<Object>[] | HTMLCollectionOf<HTMLTableRowElement> = this.parent.grid.contentModule.getRows();
|
|
108
|
+
for (let i: number = 0; i < focusElement.length; i++) {
|
|
109
|
+
(focusElement[parseInt(i.toString(), 10)].cells[0] as Cell<Column> ).visible = false;
|
|
110
|
+
}
|
|
111
|
+
const focusModule: FocusStrategy = getObject('focusModule', this.parent.grid);
|
|
112
|
+
const matrix: string = 'refreshMatrix';
|
|
113
|
+
focusModule[`${matrix}`](true)({ rows: this.parent.grid.contentModule.getRows() });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Destroys the DetailModule.
|
|
117
|
+
*
|
|
118
|
+
* @function destroy
|
|
119
|
+
* @returns {void}
|
|
120
|
+
*/
|
|
121
|
+
public destroy(): void {
|
|
122
|
+
this.removeEventListener();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Column } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { TreeGrid } from '../base/treegrid';
|
|
3
|
+
import { RowPosition } from '../enum';
|
|
4
|
+
/**
|
|
5
|
+
* TreeGrid Edit Module
|
|
6
|
+
* The `Edit` module is used to handle editing actions.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Edit {
|
|
9
|
+
private parent;
|
|
10
|
+
private isSelfReference;
|
|
11
|
+
private addedRecords;
|
|
12
|
+
private deletedRecords;
|
|
13
|
+
private addRowIndex;
|
|
14
|
+
private addRowRecord;
|
|
15
|
+
private isOnBatch;
|
|
16
|
+
private keyPress;
|
|
17
|
+
private selectedIndex;
|
|
18
|
+
private doubleClickTarget;
|
|
19
|
+
private internalProperties;
|
|
20
|
+
private previousNewRowPosition;
|
|
21
|
+
private batchEditModule;
|
|
22
|
+
private isTabLastRow;
|
|
23
|
+
private prevAriaRowIndex;
|
|
24
|
+
private isAddedRowByMethod;
|
|
25
|
+
private isAddedRowByContextMenu;
|
|
26
|
+
private editedRowIndex;
|
|
27
|
+
private isScrollByFocus;
|
|
28
|
+
private isIndexUndefined;
|
|
29
|
+
/**
|
|
30
|
+
* Constructor for Edit module
|
|
31
|
+
*
|
|
32
|
+
* @param {TreeGrid} parent - Tree Grid instance
|
|
33
|
+
*/
|
|
34
|
+
constructor(parent: TreeGrid);
|
|
35
|
+
/**
|
|
36
|
+
* For internal use only - Get the module name.
|
|
37
|
+
*
|
|
38
|
+
* @private
|
|
39
|
+
* @returns {string} Returns Edit module name
|
|
40
|
+
*/
|
|
41
|
+
protected getModuleName(): string;
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
addEventListener(): void;
|
|
47
|
+
private gridDblClick;
|
|
48
|
+
private getRowPosition;
|
|
49
|
+
private beforeStartEdit;
|
|
50
|
+
private beforeBatchCancel;
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
55
|
+
removeEventListener(): void;
|
|
56
|
+
/**
|
|
57
|
+
* To destroy the editModule
|
|
58
|
+
*
|
|
59
|
+
* @returns {void}
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
destroy(): void;
|
|
63
|
+
/**
|
|
64
|
+
* @param {Column[]} cols - Column property Collection
|
|
65
|
+
* @hidden
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
applyFormValidation(cols?: Column[]): void;
|
|
69
|
+
private editActionEvents;
|
|
70
|
+
private infiniteAddAction;
|
|
71
|
+
private updateInfiniteCurrentViewData;
|
|
72
|
+
private recordDoubleClick;
|
|
73
|
+
private updateGridEditMode;
|
|
74
|
+
private resetIsOnBatch;
|
|
75
|
+
private keyPressed;
|
|
76
|
+
private deleteUniqueID;
|
|
77
|
+
private cellEdit;
|
|
78
|
+
private enableToolbarItems;
|
|
79
|
+
private batchCancel;
|
|
80
|
+
private customCellSave;
|
|
81
|
+
private cellSave;
|
|
82
|
+
private afterCellSave;
|
|
83
|
+
private lastCellTab;
|
|
84
|
+
private updateCell;
|
|
85
|
+
private crudAction;
|
|
86
|
+
private updateIndex;
|
|
87
|
+
private beginAdd;
|
|
88
|
+
private beginEdit;
|
|
89
|
+
private savePreviousRowPosition;
|
|
90
|
+
private beginAddEdit;
|
|
91
|
+
/**
|
|
92
|
+
* If the data,index and position given, Adds the record to treegrid rows otherwise it will create edit form.
|
|
93
|
+
*
|
|
94
|
+
* @returns {void}
|
|
95
|
+
*/
|
|
96
|
+
addRecord(data?: Object, index?: number, position?: RowPosition): void;
|
|
97
|
+
/**
|
|
98
|
+
* Checks the status of validation at the time of editing. If validation is passed, it returns true.
|
|
99
|
+
*
|
|
100
|
+
* @returns {boolean} Returns form validation results
|
|
101
|
+
*/
|
|
102
|
+
editFormValidate(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* @hidden
|
|
105
|
+
* @returns {void}
|
|
106
|
+
*/
|
|
107
|
+
destroyForm(): void;
|
|
108
|
+
private contentready;
|
|
109
|
+
/**
|
|
110
|
+
* If the row index and field is given, edits the particular cell in a row.
|
|
111
|
+
*
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
editCell(rowIndex?: number, field?: string): void;
|
|
115
|
+
/**
|
|
116
|
+
* Cancels edited state.
|
|
117
|
+
*
|
|
118
|
+
* @returns {void}
|
|
119
|
+
*/
|
|
120
|
+
private closeEdit;
|
|
121
|
+
}
|