@syncfusion/ej2-treegrid 20.1.55 → 20.1.56-97113
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/.eslintrc.json +16 -1
- package/CHANGELOG.md +15 -32
- package/README.md +64 -51
- package/dist/ej2-treegrid.min.js +1 -0
- package/dist/ej2-treegrid.umd.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +2046 -1076
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +2131 -1113
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -10
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/helpers/e2e/index.js +8 -6
- package/helpers/e2e/treegridhelper.js +82 -65
- package/package.json +64 -64
- package/src/treegrid/actions/batch-edit.js +115 -87
- package/src/treegrid/actions/clipboard.d.ts +3 -2
- package/src/treegrid/actions/clipboard.js +37 -35
- package/src/treegrid/actions/context-menu.js +53 -1
- package/src/treegrid/actions/crud-actions.js +67 -56
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +168 -115
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -16
- package/src/treegrid/actions/freeze-column.d.ts +1 -0
- package/src/treegrid/actions/freeze-column.js +48 -11
- package/src/treegrid/actions/infinite-scroll.js +25 -22
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.d.ts +1 -0
- package/src/treegrid/actions/page.js +21 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +142 -86
- package/src/treegrid/actions/selection.d.ts +1 -0
- package/src/treegrid/actions/selection.js +71 -39
- package/src/treegrid/actions/sort.js +17 -5
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +45 -43
- package/src/treegrid/actions/virtual-scroll.js +7 -4
- package/src/treegrid/base/constant.d.ts +30 -0
- package/src/treegrid/base/constant.js +30 -0
- package/src/treegrid/base/data.d.ts +1 -0
- package/src/treegrid/base/data.js +257 -57
- package/src/treegrid/base/treegrid-model.d.ts +50 -34
- package/src/treegrid/base/treegrid.d.ts +57 -35
- package/src/treegrid/base/treegrid.js +363 -200
- package/src/treegrid/enum.d.ts +8 -2
- package/src/treegrid/enum.js +2 -0
- package/src/treegrid/models/column.d.ts +6 -6
- package/src/treegrid/models/column.js +9 -9
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/loading-indicator-model.d.ts +20 -0
- package/src/treegrid/models/loading-indicator.d.ts +17 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.d.ts +4 -4
- package/src/treegrid/renderer/render.js +33 -24
- package/src/treegrid/renderer/virtual-row-model-generator.js +15 -6
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -2
- package/src/treegrid/renderer/virtual-tree-content-render.js +224 -106
- package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
- package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
- package/src/treegrid/utils.js +13 -12
- package/styles/bootstrap-dark.css +14 -1
- package/styles/bootstrap.css +14 -1
- package/styles/bootstrap4.css +14 -1
- package/styles/bootstrap5-dark.css +16 -2
- package/styles/bootstrap5.css +16 -2
- package/styles/fabric-dark.css +14 -1
- package/styles/fabric.css +14 -1
- package/styles/fluent-dark.css +15 -2
- package/styles/fluent.css +15 -2
- package/styles/highcontrast-light.css +14 -1
- package/styles/highcontrast.css +14 -1
- package/styles/material-dark.css +14 -1
- package/styles/material.css +14 -1
- package/styles/tailwind-dark.css +14 -1
- package/styles/tailwind.css +14 -1
- package/styles/treegrid/_all.scss +1 -1
- package/styles/treegrid/_bootstrap-dark-definition.scss +1 -1
- package/styles/treegrid/_bootstrap-definition.scss +1 -2
- package/styles/treegrid/_bootstrap4-definition.scss +0 -1
- package/styles/treegrid/_bootstrap5-definition.scss +0 -1
- package/styles/treegrid/_fabric-dark-definition.scss +1 -2
- package/styles/treegrid/_fabric-definition.scss +1 -2
- package/styles/treegrid/_fluent-definition.scss +0 -1
- package/styles/treegrid/_fusionnew-definition.scss +28 -0
- package/styles/treegrid/_highcontrast-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_icons.scss +12 -1
- package/styles/treegrid/_layout.scss +4 -4
- package/styles/treegrid/_material-definition.scss +0 -1
- package/styles/treegrid/_material3-definition.scss +28 -0
- package/styles/treegrid/_tailwind-definition.scss +0 -1
- package/styles/treegrid/_theme.scss +1 -0
- package/styles/treegrid/bootstrap-dark.css +14 -1
- package/styles/treegrid/bootstrap.css +14 -1
- package/styles/treegrid/bootstrap4.css +14 -1
- package/styles/treegrid/bootstrap5-dark.css +16 -2
- package/styles/treegrid/bootstrap5.css +16 -2
- package/styles/treegrid/fabric-dark.css +14 -1
- package/styles/treegrid/fabric.css +14 -1
- package/styles/treegrid/fluent-dark.css +15 -2
- package/styles/treegrid/fluent.css +15 -2
- package/styles/treegrid/highcontrast-light.css +14 -1
- package/styles/treegrid/highcontrast.css +14 -1
- package/styles/treegrid/icons/_bootstrap-dark.scss +12 -1
- package/styles/treegrid/icons/_bootstrap.scss +12 -1
- package/styles/treegrid/icons/_bootstrap4.scss +12 -1
- package/styles/treegrid/icons/_bootstrap5.scss +11 -0
- package/styles/treegrid/icons/_fabric-dark.scss +12 -1
- package/styles/treegrid/icons/_fabric.scss +12 -1
- package/styles/treegrid/icons/_fluent.scss +11 -0
- package/styles/treegrid/icons/_fusionnew.scss +26 -0
- package/styles/treegrid/icons/_highcontrast-light.scss +12 -1
- package/styles/treegrid/icons/_highcontrast.scss +11 -0
- package/styles/treegrid/icons/_material-dark.scss +12 -1
- package/styles/treegrid/icons/_material.scss +11 -0
- package/styles/treegrid/icons/_material3.scss +26 -0
- package/styles/treegrid/icons/_tailwind-dark.scss +11 -0
- package/styles/treegrid/icons/_tailwind.scss +11 -0
- package/styles/treegrid/material-dark.css +14 -1
- package/styles/treegrid/material.css +14 -1
- package/styles/treegrid/tailwind-dark.css +14 -1
- package/styles/treegrid/tailwind.css +14 -1
|
@@ -33,8 +33,10 @@ var ContextMenu = /** @class */ (function () {
|
|
|
33
33
|
ContextMenu.prototype.contextMenuOpen = function (args) {
|
|
34
34
|
var addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);
|
|
35
35
|
var editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);
|
|
36
|
+
var indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
|
|
37
|
+
var outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
|
|
36
38
|
if (addRow) {
|
|
37
|
-
if (this.parent.grid.editSettings.allowAdding === false) {
|
|
39
|
+
if (this.parent.grid.editSettings.allowAdding === false || this.parent.grid.isEdit) {
|
|
38
40
|
addRow.style.display = 'none';
|
|
39
41
|
}
|
|
40
42
|
else {
|
|
@@ -45,13 +47,63 @@ var ContextMenu = /** @class */ (function () {
|
|
|
45
47
|
&& !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {
|
|
46
48
|
editRecord.style.display = 'none';
|
|
47
49
|
}
|
|
50
|
+
var tObj = this.parent;
|
|
51
|
+
var selectedrow = tObj.getSelectedRows()[0];
|
|
52
|
+
if ((indent || outdent) && !isNullOrUndefined(selectedrow)) {
|
|
53
|
+
var targetElement = args.event.target.closest('td');
|
|
54
|
+
if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && !targetElement.classList.contains('e-rowcell'))) {
|
|
55
|
+
indent.style.display = outdent.style.display = 'none';
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
if (selectedrow.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
|
|
59
|
+
indent.style.display = outdent.style.display = 'none';
|
|
60
|
+
}
|
|
61
|
+
else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
|
|
62
|
+
var selectedItem = tObj.getCurrentViewRecords()[selectedrow.rowIndex];
|
|
63
|
+
if (!isNullOrUndefined(selectedItem)) {
|
|
64
|
+
if ((selectedItem.level > tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) || this.parent.editSettings.mode === 'Batch'
|
|
65
|
+
|| this.parent.editSettings.mode === 'Cell') {
|
|
66
|
+
indent.style.display = 'none';
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
indent.style.display = 'block';
|
|
70
|
+
}
|
|
71
|
+
if ((selectedItem.level === tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) && this.parent.editSettings.mode !== 'Batch'
|
|
72
|
+
&& this.parent.editSettings.mode !== 'Cell') {
|
|
73
|
+
indent.style.display = 'block';
|
|
74
|
+
}
|
|
75
|
+
if ((selectedItem.level === 0) || this.parent.editSettings.mode === 'Batch'
|
|
76
|
+
|| this.parent.editSettings.mode === 'Cell') {
|
|
77
|
+
outdent.style.display = 'none';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
outdent.style.display = 'block';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (tObj.grid.isEdit && isNullOrUndefined(selectedrow)) {
|
|
88
|
+
indent.style.display = 'none';
|
|
89
|
+
outdent.style.display = 'none';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
48
92
|
};
|
|
49
93
|
ContextMenu.prototype.contextMenuClick = function (args) {
|
|
50
94
|
if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {
|
|
51
95
|
this.parent.notify('savePreviousRowPosition', args);
|
|
52
96
|
this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
|
|
97
|
+
this.parent.editModule['isAddedRowByContextMenu'] = true;
|
|
53
98
|
this.parent.addRecord();
|
|
54
99
|
}
|
|
100
|
+
if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {
|
|
101
|
+
if (!isNullOrUndefined(this.parent.rowDragAndDropModule)) {
|
|
102
|
+
var indentOutdentAction = 'indentOutdentAction';
|
|
103
|
+
var action = args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' ? 'indent' : 'outdent';
|
|
104
|
+
this.parent.rowDragAndDropModule["" + indentOutdentAction](null, action);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
55
107
|
};
|
|
56
108
|
/**
|
|
57
109
|
* For internal use only - Get the module name.
|
|
@@ -33,7 +33,7 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
33
33
|
batchChanges = control.grid.editModule.getBatchChanges();
|
|
34
34
|
}
|
|
35
35
|
if (action === 'add' || (action === 'batchsave' && (control.editSettings.mode === 'Batch'
|
|
36
|
-
&& batchChanges[addedRecords].length))) {
|
|
36
|
+
&& batchChanges["" + addedRecords].length))) {
|
|
37
37
|
var addAct = addAction(details, treeData, control, isSelfReference, addRowIndex, selectedIndex, addRowRecord);
|
|
38
38
|
value = addAct.value;
|
|
39
39
|
isSkip = addAct.isSkip;
|
|
@@ -47,26 +47,27 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
47
47
|
if (!isSkip && (action !== 'add' ||
|
|
48
48
|
(control.editSettings.newRowPosition !== 'Top' && control.editSettings.newRowPosition !== 'Bottom'))) {
|
|
49
49
|
for (var k = 0; k < modifiedData.length; k++) {
|
|
50
|
-
if (typeof (modifiedData[k][key]) === 'object') {
|
|
51
|
-
modifiedData[k] = modifiedData[k][key];
|
|
50
|
+
if (typeof (modifiedData[parseInt(k.toString(), 10)]["" + key]) === 'object') {
|
|
51
|
+
modifiedData[parseInt(k.toString(), 10)] = modifiedData[parseInt(k.toString(), 10)]["" + key];
|
|
52
52
|
}
|
|
53
|
-
var keys = modifiedData[k
|
|
54
|
-
Object.keys(modifiedData[k])
|
|
53
|
+
var keys = modifiedData[parseInt(k.toString(), 10)].taskData ?
|
|
54
|
+
Object.keys(modifiedData[parseInt(k.toString(), 10)].taskData) :
|
|
55
|
+
Object.keys(modifiedData[parseInt(k.toString(), 10)]);
|
|
55
56
|
i = treeData.length;
|
|
56
57
|
var _loop_1 = function () {
|
|
57
|
-
if (treeData[i][key] === modifiedData[k][key]) {
|
|
58
|
+
if (treeData[parseInt(i.toString(), 10)]["" + key] === modifiedData[parseInt(k.toString(), 10)]["" + key]) {
|
|
58
59
|
if (action === 'delete') {
|
|
59
|
-
var currentData_1 = treeData[i];
|
|
60
|
+
var currentData_1 = treeData[parseInt(i.toString(), 10)];
|
|
60
61
|
treeData.splice(i, 1);
|
|
61
62
|
if (isSelfReference) {
|
|
62
|
-
if (!isNullOrUndefined(currentData_1[control.parentIdMapping])) {
|
|
63
|
+
if (!isNullOrUndefined(currentData_1["" + control.parentIdMapping])) {
|
|
63
64
|
var parentData = control.flatData.filter(function (e) {
|
|
64
|
-
return e[control.idMapping] === currentData_1[control.parentIdMapping];
|
|
65
|
+
return e["" + control.idMapping] === currentData_1["" + control.parentIdMapping];
|
|
65
66
|
})[0];
|
|
66
|
-
var childRecords = parentData ? parentData[control.childMapping] : [];
|
|
67
|
+
var childRecords = parentData ? parentData["" + control.childMapping] : [];
|
|
67
68
|
for (var p = childRecords.length - 1; p >= 0; p--) {
|
|
68
|
-
if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {
|
|
69
|
-
if (!control.enableImmutableMode) {
|
|
69
|
+
if (childRecords[parseInt(p.toString(), 10)]["" + control.idMapping] === currentData_1["" + control.idMapping]) {
|
|
70
|
+
if (!control.enableImmutableMode && parentData.childRecords.length === parentData['Children'].length) {
|
|
70
71
|
parentData['childRecords'].splice(p, 1);
|
|
71
72
|
}
|
|
72
73
|
childRecords.splice(p, 1);
|
|
@@ -84,13 +85,15 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
84
85
|
else {
|
|
85
86
|
if (action === 'edit') {
|
|
86
87
|
for (j = 0; j < keys.length; j++) {
|
|
87
|
-
if (Object.prototype.hasOwnProperty.call(treeData[i], keys[j]) && ((control.editSettings.mode !== 'Cell'
|
|
88
|
-
|| (!isNullOrUndefined(batchChanges) && batchChanges[changedRecords].length === 0))
|
|
89
|
-
|| keys[j] === columnName)) {
|
|
90
|
-
var editedData = getParentData(control, modifiedData[k].uniqueID);
|
|
91
|
-
treeData[i][keys[j]] =
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) && ((control.editSettings.mode !== 'Cell'
|
|
89
|
+
|| (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
|
|
90
|
+
|| keys[parseInt(j.toString(), 10)] === columnName)) {
|
|
91
|
+
var editedData = getParentData(control, modifiedData[parseInt(k.toString(), 10)].uniqueID);
|
|
92
|
+
treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =
|
|
93
|
+
modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];
|
|
92
94
|
if (editedData && editedData.taskData) {
|
|
93
|
-
editedData.taskData[keys[j]] = editedData[keys[j
|
|
95
|
+
editedData.taskData[keys[parseInt(j.toString(), 10)]] = editedData[keys[parseInt(j.toString(), 10)]]
|
|
96
|
+
= treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]];
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -99,15 +102,15 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
99
102
|
var index = void 0;
|
|
100
103
|
if (control.editSettings.newRowPosition === 'Child') {
|
|
101
104
|
if (isSelfReference) {
|
|
102
|
-
originalData.taskData[control.parentIdMapping] = treeData[i][control.idMapping];
|
|
105
|
+
originalData.taskData["" + control.parentIdMapping] = treeData[parseInt(i.toString(), 10)]["" + control.idMapping];
|
|
103
106
|
treeData.splice(i + 1, 0, originalData.taskData);
|
|
104
107
|
}
|
|
105
108
|
else {
|
|
106
|
-
if (!Object.prototype.hasOwnProperty.call(treeData[i], control.childMapping)) {
|
|
107
|
-
treeData[i][control.childMapping] = [];
|
|
109
|
+
if (!Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], control.childMapping)) {
|
|
110
|
+
treeData[parseInt(i.toString(), 10)]["" + control.childMapping] = [];
|
|
108
111
|
}
|
|
109
|
-
treeData[i][control.childMapping].push(originalData.taskData);
|
|
110
|
-
updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);
|
|
112
|
+
treeData[parseInt(i.toString(), 10)]["" + control.childMapping].push(originalData.taskData);
|
|
113
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control, isSelfReference, originalData);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
else if (control.editSettings.newRowPosition === 'Below') {
|
|
@@ -123,16 +126,16 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
|
|
|
123
126
|
else if (control.editSettings.newRowPosition === 'Above') {
|
|
124
127
|
treeData.splice(i, 0, originalData.taskData);
|
|
125
128
|
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
126
|
-
updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);
|
|
129
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control, isSelfReference, originalData);
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
return "break";
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
else if (!isNullOrUndefined(treeData[i][control.childMapping])) {
|
|
134
|
-
if (removeChildRecords(treeData[i][control.childMapping], modifiedData[k], action, key, control, isSelfReference, originalData, columnName)) {
|
|
135
|
-
updateParentRow(key, treeData[i], action, control, isSelfReference);
|
|
136
|
+
else if (!isNullOrUndefined(treeData[parseInt(i.toString(), 10)]["" + control.childMapping])) {
|
|
137
|
+
if (removeChildRecords(treeData[parseInt(i.toString(), 10)]["" + control.childMapping], modifiedData[parseInt(k.toString(), 10)], action, key, control, isSelfReference, originalData, columnName)) {
|
|
138
|
+
updateParentRow(key, treeData[parseInt(i.toString(), 10)], action, control, isSelfReference);
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
};
|
|
@@ -191,8 +194,8 @@ export function addAction(details, treeData, control, isSelfReference, addRowInd
|
|
|
191
194
|
}
|
|
192
195
|
else {
|
|
193
196
|
var primaryKeys = control.grid.getPrimaryKeyFieldNames()[0];
|
|
194
|
-
var currentdata = currentViewRecords[addRowIndex];
|
|
195
|
-
if (!isNullOrUndefined(currentdata) && currentdata[primaryKeys] === details.value[primaryKeys] || selectedIndex !== -1) {
|
|
197
|
+
var currentdata = currentViewRecords[parseInt(addRowIndex.toString(), 10)];
|
|
198
|
+
if (!isNullOrUndefined(currentdata) && currentdata["" + primaryKeys] === details.value["" + primaryKeys] || selectedIndex !== -1) {
|
|
196
199
|
value = extend({}, currentdata);
|
|
197
200
|
}
|
|
198
201
|
else {
|
|
@@ -200,7 +203,7 @@ export function addAction(details, treeData, control, isSelfReference, addRowInd
|
|
|
200
203
|
}
|
|
201
204
|
value = getPlainData(value);
|
|
202
205
|
var internalProperty = 'internalProperties';
|
|
203
|
-
control.editModule[internalProperty].taskData = value;
|
|
206
|
+
control.editModule["" + internalProperty].taskData = value;
|
|
204
207
|
}
|
|
205
208
|
if (selectedIndex === -1) {
|
|
206
209
|
treeData.unshift(value);
|
|
@@ -224,18 +227,22 @@ export function removeChildRecords(childRecords, modifiedData, action, key, cont
|
|
|
224
227
|
var isChildAll = false;
|
|
225
228
|
var j = childRecords.length;
|
|
226
229
|
while (j-- && j >= 0) {
|
|
227
|
-
if (childRecords[j][key] === modifiedData[key] ||
|
|
228
|
-
(isSelfReference && childRecords[j][control.parentIdMapping] === modifiedData[control.idMapping])) {
|
|
230
|
+
if (childRecords[parseInt(j.toString(), 10)]["" + key] === modifiedData["" + key] ||
|
|
231
|
+
(isSelfReference && childRecords[parseInt(j.toString(), 10)][control.parentIdMapping] === modifiedData[control.idMapping])) {
|
|
229
232
|
if (action === 'edit') {
|
|
230
233
|
var keys = Object.keys(modifiedData);
|
|
231
234
|
var editedData = getParentData(control, modifiedData.uniqueID);
|
|
232
235
|
for (var i = 0; i < keys.length; i++) {
|
|
233
|
-
if (Object.prototype.hasOwnProperty.call(childRecords[j], keys[i
|
|
234
|
-
|
|
236
|
+
if (Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&
|
|
237
|
+
(control.editSettings.mode !== 'Cell' || keys[parseInt(i.toString(), 10)] === columnName)) {
|
|
238
|
+
editedData[keys[parseInt(i.toString(), 10)]] =
|
|
239
|
+
editedData.taskData[keys[parseInt(i.toString(), 10)]] =
|
|
240
|
+
childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
|
|
241
|
+
modifiedData[keys[parseInt(i.toString(), 10)]];
|
|
235
242
|
if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell') {
|
|
236
243
|
var editModule = 'editModule';
|
|
237
|
-
control.grid.editModule[editModule].editRowIndex = modifiedData.index;
|
|
238
|
-
control.grid.editModule[editModule].updateCurrentViewData(modifiedData);
|
|
244
|
+
control.grid.editModule["" + editModule].editRowIndex = modifiedData.index;
|
|
245
|
+
control.grid.editModule["" + editModule].updateCurrentViewData(modifiedData);
|
|
239
246
|
}
|
|
240
247
|
}
|
|
241
248
|
}
|
|
@@ -244,28 +251,28 @@ export function removeChildRecords(childRecords, modifiedData, action, key, cont
|
|
|
244
251
|
else if (action === 'add' || action === 'batchsave') {
|
|
245
252
|
if (control.editSettings.newRowPosition === 'Child') {
|
|
246
253
|
if (isSelfReference) {
|
|
247
|
-
originalData[control.parentIdMapping] = childRecords[j][control.idMapping];
|
|
254
|
+
originalData["" + control.parentIdMapping] = childRecords[parseInt(j.toString(), 10)][control.idMapping];
|
|
248
255
|
childRecords.splice(j + 1, 0, originalData);
|
|
249
|
-
updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);
|
|
256
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
250
257
|
}
|
|
251
258
|
else {
|
|
252
|
-
if (!Object.prototype.hasOwnProperty.call(childRecords[j], control.childMapping)) {
|
|
253
|
-
childRecords[j][control.childMapping] = [];
|
|
259
|
+
if (!Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], control.childMapping)) {
|
|
260
|
+
childRecords[parseInt(j.toString(), 10)][control.childMapping] = [];
|
|
254
261
|
}
|
|
255
|
-
childRecords[j][control.childMapping].push(originalData.taskData);
|
|
256
|
-
updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);
|
|
262
|
+
childRecords[parseInt(j.toString(), 10)][control.childMapping].push(originalData.taskData);
|
|
263
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
257
264
|
}
|
|
258
265
|
}
|
|
259
266
|
else if (control.editSettings.newRowPosition === 'Above') {
|
|
260
267
|
childRecords.splice(j, 0, originalData.taskData);
|
|
261
268
|
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
262
|
-
updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);
|
|
269
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
263
270
|
}
|
|
264
271
|
}
|
|
265
272
|
else if (control.editSettings.newRowPosition === 'Below') {
|
|
266
273
|
childRecords.splice(j + 1, 0, originalData.taskData);
|
|
267
274
|
if (!isNullOrUndefined(originalData.parentItem)) {
|
|
268
|
-
updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);
|
|
275
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);
|
|
269
276
|
}
|
|
270
277
|
}
|
|
271
278
|
}
|
|
@@ -276,9 +283,9 @@ export function removeChildRecords(childRecords, modifiedData, action, key, cont
|
|
|
276
283
|
}
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
|
-
else if (!isNullOrUndefined(childRecords[j][control.childMapping])) {
|
|
280
|
-
if (removeChildRecords(childRecords[j][control.childMapping], modifiedData, action, key, control, isSelfReference, originalData, columnName)) {
|
|
281
|
-
updateParentRow(key, childRecords[j], action, control, isSelfReference);
|
|
286
|
+
else if (!isNullOrUndefined(childRecords[parseInt(j.toString(), 10)][control.childMapping])) {
|
|
287
|
+
if (removeChildRecords(childRecords[parseInt(j.toString(), 10)][control.childMapping], modifiedData, action, key, control, isSelfReference, originalData, columnName)) {
|
|
288
|
+
updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference);
|
|
282
289
|
}
|
|
283
290
|
}
|
|
284
291
|
}
|
|
@@ -302,12 +309,16 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
302
309
|
else {
|
|
303
310
|
var currentRecords = control.grid.getCurrentViewRecords();
|
|
304
311
|
var index_1;
|
|
305
|
-
currentRecords.map(function (e, i) { if (e[key] === record[key]) {
|
|
312
|
+
currentRecords.map(function (e, i) { if (e["" + key] === record["" + key]) {
|
|
306
313
|
index_1 = i;
|
|
307
314
|
return;
|
|
308
315
|
} });
|
|
316
|
+
if (control.enableVirtualization && isNullOrUndefined(index_1)) {
|
|
317
|
+
var updatedParent = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
|
|
318
|
+
record = updatedParent;
|
|
319
|
+
}
|
|
309
320
|
if (!isNullOrUndefined(index_1)) {
|
|
310
|
-
record = currentRecords[index_1];
|
|
321
|
+
record = currentRecords[parseInt(index_1.toString(), 10)];
|
|
311
322
|
}
|
|
312
323
|
if (control.enableVirtualization && isNullOrUndefined(record) && !isNullOrUndefined(child)) {
|
|
313
324
|
record = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
|
|
@@ -337,18 +348,18 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
337
348
|
record.childRecords = [];
|
|
338
349
|
}
|
|
339
350
|
else {
|
|
340
|
-
if (!isNullOrUndefined(child) && record[key] !== child[key]) {
|
|
351
|
+
if (!isNullOrUndefined(child) && record["" + key] !== child["" + key]) {
|
|
341
352
|
record.childRecords.push(child);
|
|
342
353
|
}
|
|
343
354
|
}
|
|
344
|
-
if (record.childRecords.indexOf(childRecords) === -1 && record[key] !== child[key]) {
|
|
355
|
+
if (record.childRecords.indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
|
|
345
356
|
record.childRecords.unshift(childRecords);
|
|
346
357
|
}
|
|
347
358
|
if (isSelfReference) {
|
|
348
359
|
if (!Object.prototype.hasOwnProperty.call(record, control.childMapping)) {
|
|
349
360
|
record[control.childMapping] = [];
|
|
350
361
|
}
|
|
351
|
-
if (record[control.childMapping].indexOf(childRecords) === -1 && record[key] !== child[key]) {
|
|
362
|
+
if (record["" + control.childMapping].indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
|
|
352
363
|
record[control.childMapping].unshift(childRecords);
|
|
353
364
|
}
|
|
354
365
|
}
|
|
@@ -358,8 +369,8 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
358
369
|
var data = control.grid.dataSource instanceof DataManager ?
|
|
359
370
|
control.grid.dataSource.dataSource.json : control.grid.dataSource;
|
|
360
371
|
for (var i = 0; i < data.length; i++) {
|
|
361
|
-
if (data[i][primaryKeys] === record[primaryKeys]) {
|
|
362
|
-
data[i] = record;
|
|
372
|
+
if (data[parseInt(i.toString(), 10)]["" + primaryKeys] === record["" + primaryKeys]) {
|
|
373
|
+
data[parseInt(i.toString(), 10)] = record;
|
|
363
374
|
break;
|
|
364
375
|
}
|
|
365
376
|
}
|
|
@@ -370,7 +381,7 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
370
381
|
row = control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];
|
|
371
382
|
}
|
|
372
383
|
else {
|
|
373
|
-
row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];
|
|
384
|
+
row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record["" + key])];
|
|
374
385
|
}
|
|
375
386
|
}
|
|
376
387
|
var movableRow = void 0;
|
|
@@ -383,7 +394,7 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
383
394
|
index_2 = index_2 + 1;
|
|
384
395
|
}
|
|
385
396
|
control.renderModule.cellRender({
|
|
386
|
-
data: record, cell: row.cells[index_2] ? row.cells[index_2]
|
|
397
|
+
data: record, cell: row.cells[parseInt(index_2.toString(), 10)] ? row.cells[parseInt(index_2.toString(), 10)]
|
|
387
398
|
: movableRow.cells[index_2 - control.getFrozenColumns()],
|
|
388
399
|
column: control.grid.getColumns()[control.treeColumnIndex],
|
|
389
400
|
requestType: action
|
|
@@ -50,16 +50,16 @@ var DetailRow = /** @class */ (function () {
|
|
|
50
50
|
};
|
|
51
51
|
DetailRow.prototype.setIndentVisibility = function (args) {
|
|
52
52
|
var visible = 'visible';
|
|
53
|
-
args[visible] = false;
|
|
53
|
+
args["" + visible] = false;
|
|
54
54
|
};
|
|
55
55
|
DetailRow.prototype.dataBoundArg = function () {
|
|
56
56
|
var detailele = this.parent.getRows().filter(function (e) {
|
|
57
57
|
return !e.classList.contains('e-detailrow');
|
|
58
58
|
});
|
|
59
59
|
for (var i = 0; i < detailele.length; i++) {
|
|
60
|
-
var elements = detailele[i].getElementsByClassName('e-detailrowcollapse');
|
|
61
|
-
var detailData = this.parent.grid.getRowObjectFromUID(detailele[i].getAttribute('data-Uid'));
|
|
62
|
-
var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[i]);
|
|
60
|
+
var elements = detailele[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
|
|
61
|
+
var detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
|
|
62
|
+
var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
|
|
63
63
|
if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
|
|
64
64
|
getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
|
|
65
65
|
this.parent.grid.detailRowModule.expand(elements[0]);
|
|
@@ -77,7 +77,7 @@ var DetailRow = /** @class */ (function () {
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
for (var i = 0; i < args.detailrows.length; i++) {
|
|
80
|
-
args.detailrows[i].style.display = args.action;
|
|
80
|
+
args.detailrows[parseInt(i.toString(), 10)].style.display = args.action;
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
DetailRow.prototype.detaildataBound = function (args) {
|
|
@@ -101,11 +101,11 @@ var DetailRow = /** @class */ (function () {
|
|
|
101
101
|
}
|
|
102
102
|
var focusElement = this.parent.grid.contentModule.getRows();
|
|
103
103
|
for (var i = 0; i < focusElement.length; i++) {
|
|
104
|
-
focusElement[i].cells[0].visible = false;
|
|
104
|
+
focusElement[parseInt(i.toString(), 10)].cells[0].visible = false;
|
|
105
105
|
}
|
|
106
106
|
var focusModule = getObject('focusModule', this.parent.grid);
|
|
107
107
|
var matrix = 'refreshMatrix';
|
|
108
|
-
focusModule[matrix](true)({ rows: this.parent.grid.contentModule.getRows() });
|
|
108
|
+
focusModule["" + matrix](true)({ rows: this.parent.grid.contentModule.getRows() });
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
111
|
* Destroys the DetailModule.
|