@syncfusion/ej2-treegrid 20.3.60 → 20.4.38
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 +8 -53
- package/README.md +64 -51
- 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 +1191 -908
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1249 -944
- 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/package.json +16 -10
- package/src/treegrid/actions/batch-edit.js +82 -82
- package/src/treegrid/actions/clipboard.js +34 -33
- package/src/treegrid/actions/context-menu.js +1 -1
- package/src/treegrid/actions/crud-actions.js +62 -55
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.js +61 -60
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -13
- package/src/treegrid/actions/freeze-column.js +9 -8
- package/src/treegrid/actions/infinite-scroll.js +19 -19
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.js +8 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +88 -82
- package/src/treegrid/actions/selection.js +34 -32
- package/src/treegrid/actions/sort.js +7 -6
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +242 -55
- package/src/treegrid/base/treegrid-model.d.ts +20 -4
- package/src/treegrid/base/treegrid.d.ts +24 -5
- package/src/treegrid/base/treegrid.js +226 -191
- package/src/treegrid/models/column.js +3 -3
- 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 +19 -0
- package/src/treegrid/models/loading-indicator.d.ts +16 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.js +20 -19
- package/src/treegrid/renderer/virtual-row-model-generator.js +6 -5
- package/src/treegrid/renderer/virtual-tree-content-render.js +128 -99
- package/src/treegrid/utils.js +12 -11
|
@@ -94,7 +94,7 @@ var Page = /** @class */ (function () {
|
|
|
94
94
|
if (this.parent.enableImmutableMode) {
|
|
95
95
|
var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames()[0];
|
|
96
96
|
var record = this.parent.flatData.filter(function (e) {
|
|
97
|
-
return e[primaryKeyField_1] === rowDetails.record[primaryKeyField_1];
|
|
97
|
+
return e["" + primaryKeyField_1] === rowDetails.record["" + primaryKeyField_1];
|
|
98
98
|
});
|
|
99
99
|
if (record.length) {
|
|
100
100
|
record[0].expanded = rowDetails.record.expanded;
|
|
@@ -112,15 +112,15 @@ var Page = /** @class */ (function () {
|
|
|
112
112
|
var row = 'row';
|
|
113
113
|
var action = 'action';
|
|
114
114
|
var targetEle = void 0;
|
|
115
|
-
if (ret[action] === 'collapse') {
|
|
116
|
-
targetEle = ret[row].getElementsByClassName('e-treegridexpand')[0];
|
|
115
|
+
if (ret["" + action] === 'collapse') {
|
|
116
|
+
targetEle = ret["" + row].getElementsByClassName('e-treegridexpand')[0];
|
|
117
117
|
if (!isNullOrUndefined(targetEle)) {
|
|
118
118
|
removeClass([targetEle], 'e-treegridexpand');
|
|
119
119
|
addClass([targetEle], 'e-treegridcollapse');
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
else if (ret[action] === 'expand') {
|
|
123
|
-
targetEle = ret[row].getElementsByClassName('e-treegridcollapse')[0];
|
|
122
|
+
else if (ret["" + action] === 'expand') {
|
|
123
|
+
targetEle = ret["" + row].getElementsByClassName('e-treegridcollapse')[0];
|
|
124
124
|
if (!isNullOrUndefined(targetEle)) {
|
|
125
125
|
removeClass([targetEle], 'e-treegridcollapse');
|
|
126
126
|
addClass([targetEle], 'e-treegridexpand');
|
|
@@ -131,11 +131,11 @@ var Page = /** @class */ (function () {
|
|
|
131
131
|
Page.prototype.pageRoot = function (pagedResults, temp, result) {
|
|
132
132
|
var newResults = isNullOrUndefined(result) ? [] : result;
|
|
133
133
|
var _loop_1 = function (t) {
|
|
134
|
-
newResults.push(temp[t]);
|
|
134
|
+
newResults.push(temp[parseInt(t.toString(), 10)]);
|
|
135
135
|
var res = [];
|
|
136
|
-
if (temp[t].hasChildRecords) {
|
|
136
|
+
if (temp[parseInt(t.toString(), 10)].hasChildRecords) {
|
|
137
137
|
res = pagedResults.filter(function (e) {
|
|
138
|
-
return temp[t].uniqueID === e.parentUniqueID;
|
|
138
|
+
return temp[parseInt(t.toString(), 10)].uniqueID === e.parentUniqueID;
|
|
139
139
|
});
|
|
140
140
|
newResults = this_1.pageRoot(pagedResults, res, newResults);
|
|
141
141
|
}
|
|
@@ -48,12 +48,12 @@ var Reorder = /** @class */ (function () {
|
|
|
48
48
|
};
|
|
49
49
|
Reorder.prototype.getTreeColumn = function () {
|
|
50
50
|
var columnModel = 'columnModel';
|
|
51
|
-
var treeColumn = this.parent[columnModel][this.parent.treeColumnIndex];
|
|
51
|
+
var treeColumn = this.parent["" + columnModel][this.parent.treeColumnIndex];
|
|
52
52
|
var treeIndex;
|
|
53
53
|
var updatedCols = this.parent.getColumns();
|
|
54
54
|
for (var f = 0; f < updatedCols.length; f++) {
|
|
55
55
|
var treeColumnfield = getObject('field', treeColumn);
|
|
56
|
-
var parentColumnfield = getObject('field', updatedCols[f]);
|
|
56
|
+
var parentColumnfield = getObject('field', updatedCols[parseInt(f.toString(), 10)]);
|
|
57
57
|
if (treeColumnfield === parentColumnfield) {
|
|
58
58
|
treeIndex = f;
|
|
59
59
|
break;
|
|
@@ -81,11 +81,11 @@ var RowDD = /** @class */ (function () {
|
|
|
81
81
|
if (position === 'child') {
|
|
82
82
|
this.dropPosition = 'middleSegment';
|
|
83
83
|
}
|
|
84
|
-
this.parent[dropPosition] = this.dropPosition;
|
|
84
|
+
this.parent["" + dropPosition] = this.dropPosition;
|
|
85
85
|
var data = [];
|
|
86
86
|
for (var i = 0; i < fromIndexes.length; i++) {
|
|
87
|
-
var index = this.parent.getRowByIndex(fromIndexes[i]).rowIndex;
|
|
88
|
-
data[i] = this.parent.getCurrentViewRecords()[index];
|
|
87
|
+
var index = this.parent.getRowByIndex(fromIndexes[parseInt(i.toString(), 10)]).rowIndex;
|
|
88
|
+
data[parseInt(i.toString(), 10)] = this.parent.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
89
89
|
}
|
|
90
90
|
var isByMethod = true;
|
|
91
91
|
var args = {
|
|
@@ -99,7 +99,7 @@ var RowDD = /** @class */ (function () {
|
|
|
99
99
|
if (tObj.isLocalData) {
|
|
100
100
|
tObj.flatData = this.orderToIndex(tObj.flatData);
|
|
101
101
|
}
|
|
102
|
-
if (this.parent[action] === 'outdenting') {
|
|
102
|
+
if (this.parent["" + action] === 'outdenting') {
|
|
103
103
|
if (!isNullOrUndefined(data[0].parentItem)) {
|
|
104
104
|
data[0].level = data[0].parentItem.level + 1;
|
|
105
105
|
}
|
|
@@ -110,7 +110,7 @@ var RowDD = /** @class */ (function () {
|
|
|
110
110
|
if (this.parent.allowRowDragAndDrop) {
|
|
111
111
|
index = this.parent.treeColumnIndex + 1;
|
|
112
112
|
}
|
|
113
|
-
else if (this.parent[action] === 'indenting') {
|
|
113
|
+
else if (this.parent["" + action] === 'indenting') {
|
|
114
114
|
index = this.parent.treeColumnIndex;
|
|
115
115
|
}
|
|
116
116
|
var row = this.parent.getRows()[fromIndexes[0]];
|
|
@@ -120,18 +120,18 @@ var RowDD = /** @class */ (function () {
|
|
|
120
120
|
totalRecord.push(dropData);
|
|
121
121
|
rows.push(row);
|
|
122
122
|
var parentUniqueID = 'parentUniqueID';
|
|
123
|
-
var parentData = getParentData(this.parent, args.data[0][parentUniqueID]);
|
|
124
|
-
var parentrow = this.parent.getRows()[toIndex];
|
|
123
|
+
var parentData = getParentData(this.parent, args.data[0]["" + parentUniqueID]);
|
|
124
|
+
var parentrow = this.parent.getRows()[parseInt(toIndex.toString(), 10)];
|
|
125
125
|
totalRecord.push(parentData);
|
|
126
126
|
rows.push(parentrow);
|
|
127
|
-
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
127
|
+
this.parent["" + updateRowAndCellElements](totalRecord, rows, index);
|
|
128
128
|
}
|
|
129
|
-
if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {
|
|
129
|
+
if (this.parent.enableImmutableMode && this.parent["" + action] === 'outdenting') {
|
|
130
130
|
var index = void 0;
|
|
131
131
|
if (this.parent.allowRowDragAndDrop) {
|
|
132
132
|
index = this.parent.treeColumnIndex + 1;
|
|
133
133
|
}
|
|
134
|
-
else if (this.parent[action] === 'outdenting') {
|
|
134
|
+
else if (this.parent["" + action] === 'outdenting') {
|
|
135
135
|
index = this.parent.treeColumnIndex;
|
|
136
136
|
}
|
|
137
137
|
var record = args.data[0];
|
|
@@ -140,7 +140,7 @@ var RowDD = /** @class */ (function () {
|
|
|
140
140
|
var rows = [];
|
|
141
141
|
totalRecord.push(record);
|
|
142
142
|
rows.push(row);
|
|
143
|
-
this.parent[updateRowAndCellElements](totalRecord, rows, index);
|
|
143
|
+
this.parent["" + updateRowAndCellElements](totalRecord, rows, index);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
@@ -163,14 +163,14 @@ var RowDD = /** @class */ (function () {
|
|
|
163
163
|
selectedItemIndex = this.parent.selectedRowIndex;
|
|
164
164
|
}
|
|
165
165
|
this.selectedItem = isNullOrUndefined(record) ?
|
|
166
|
-
tObj.getCurrentViewRecords()[selectedItemIndex] : record;
|
|
166
|
+
tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)] : record;
|
|
167
167
|
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
168
|
-
var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[primaryKeyField]);
|
|
168
|
+
var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem["" + primaryKeyField]);
|
|
169
169
|
this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?
|
|
170
170
|
this.parent.getSelectedRows()[0]
|
|
171
171
|
: this.parent.grid.getRowByIndex(rowIndex);
|
|
172
172
|
this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?
|
|
173
|
-
tObj.getCurrentViewRecords()[selectedItemIndex]
|
|
173
|
+
tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)]
|
|
174
174
|
: this.selectedItem;
|
|
175
175
|
if (request === 'indent') {
|
|
176
176
|
var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];
|
|
@@ -181,10 +181,11 @@ var RowDD = /** @class */ (function () {
|
|
|
181
181
|
}
|
|
182
182
|
if (record_1.level > this.selectedRecord.level) {
|
|
183
183
|
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
184
|
-
if (tObj.getCurrentViewRecords()[i].taskData ===
|
|
184
|
+
if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].taskData ===
|
|
185
|
+
record_1.parentItem.taskData) {
|
|
185
186
|
dropIndex = i;
|
|
186
187
|
if (tObj.enableVirtualization) {
|
|
187
|
-
dropIndex = parseInt(tObj.getRows()[i].getAttribute('data-rowindex'), 10);
|
|
188
|
+
dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('data-rowindex'), 10);
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
}
|
|
@@ -195,8 +196,8 @@ var RowDD = /** @class */ (function () {
|
|
|
195
196
|
if (this.parent.enableVirtualization && this.selectedRecord && !(record_1.level > this.selectedRecord.level)) {
|
|
196
197
|
dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
|
|
197
198
|
}
|
|
198
|
-
tObj[action] = 'indenting';
|
|
199
|
-
tObj[droppedIndex] = dropIndex;
|
|
199
|
+
tObj["" + action] = 'indenting';
|
|
200
|
+
tObj["" + droppedIndex] = dropIndex;
|
|
200
201
|
this.eventTrigger('indenting', dropIndex);
|
|
201
202
|
}
|
|
202
203
|
else if (request === 'outdent') {
|
|
@@ -207,15 +208,15 @@ var RowDD = /** @class */ (function () {
|
|
|
207
208
|
var dropIndex = void 0;
|
|
208
209
|
var parentItem = this.selectedRecord.parentItem;
|
|
209
210
|
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
210
|
-
if (tObj.getCurrentViewRecords()[i].uniqueID === parentItem.uniqueID) {
|
|
211
|
+
if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].uniqueID === parentItem.uniqueID) {
|
|
211
212
|
dropIndex = i;
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
if (this.parent.enableVirtualization && this.selectedRecord) {
|
|
215
|
-
dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('data-rowindex'), 10);
|
|
216
|
+
dropIndex = parseInt(this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('data-rowindex'), 10);
|
|
216
217
|
}
|
|
217
|
-
tObj[action] = 'outdenting';
|
|
218
|
-
tObj[droppedIndex] = dropIndex;
|
|
218
|
+
tObj["" + action] = 'outdenting';
|
|
219
|
+
tObj["" + droppedIndex] = dropIndex;
|
|
219
220
|
this.eventTrigger('outdenting', dropIndex);
|
|
220
221
|
}
|
|
221
222
|
}
|
|
@@ -251,10 +252,10 @@ var RowDD = /** @class */ (function () {
|
|
|
251
252
|
};
|
|
252
253
|
RowDD.prototype.orderToIndex = function (currentData) {
|
|
253
254
|
for (var i = 0; i < currentData.length; i++) {
|
|
254
|
-
currentData[i].index = i;
|
|
255
|
-
if (!isNullOrUndefined(currentData[i].parentItem)) {
|
|
256
|
-
var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);
|
|
257
|
-
currentData[i].parentItem.index = updatedParent.index;
|
|
255
|
+
currentData[parseInt(i.toString(), 10)].index = i;
|
|
256
|
+
if (!isNullOrUndefined(currentData[parseInt(i.toString(), 10)].parentItem)) {
|
|
257
|
+
var updatedParent = getValue('uniqueIDCollection.' + currentData[parseInt(i.toString(), 10)].parentUniqueID, this.parent);
|
|
258
|
+
currentData[parseInt(i.toString(), 10)].parentItem.index = updatedParent.index;
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
return currentData;
|
|
@@ -263,7 +264,7 @@ var RowDD = /** @class */ (function () {
|
|
|
263
264
|
var draggedRecord;
|
|
264
265
|
var dragRecords = e.records;
|
|
265
266
|
for (var i = e.records.length - 1; i > -1; i--) {
|
|
266
|
-
draggedRecord = dragRecords[i];
|
|
267
|
+
draggedRecord = dragRecords[parseInt(i.toString(), 10)];
|
|
267
268
|
if (draggedRecord.parentUniqueID) {
|
|
268
269
|
var record = dragRecords.filter(function (data) {
|
|
269
270
|
return data.uniqueID === draggedRecord.parentUniqueID;
|
|
@@ -290,7 +291,7 @@ var RowDD = /** @class */ (function () {
|
|
|
290
291
|
var dragRecords_1 = e.records;
|
|
291
292
|
var dragLength = e.records.length;
|
|
292
293
|
for (var i = dragLength - 1; i > -1; i--) {
|
|
293
|
-
draggedRecord_1 = dragRecords_1[i];
|
|
294
|
+
draggedRecord_1 = dragRecords_1[parseInt(i.toString(), 10)];
|
|
294
295
|
if (!i && draggedRecord_1.hasChildRecords) {
|
|
295
296
|
draggedRecord_1.taskData[this.parent.parentIdMapping] = null;
|
|
296
297
|
}
|
|
@@ -307,9 +308,9 @@ var RowDD = /** @class */ (function () {
|
|
|
307
308
|
!isNullOrUndefined(tObj.parentIdMapping)) {
|
|
308
309
|
var childData = (draggedRecord_1[tObj.childMapping]);
|
|
309
310
|
for (var j = 0; j < childData.length; j++) {
|
|
310
|
-
if (dragRecords_1.indexOf(childData[j]) === -1) {
|
|
311
|
-
dragRecords_1.splice(j, 0, childData[j]);
|
|
312
|
-
childData[j].taskData = extend({}, childData[j]);
|
|
311
|
+
if (dragRecords_1.indexOf(childData[parseInt(j.toString(), 10)]) === -1) {
|
|
312
|
+
dragRecords_1.splice(j, 0, childData[parseInt(j.toString(), 10)]);
|
|
313
|
+
childData[parseInt(j.toString(), 10)].taskData = extend({}, childData[parseInt(j.toString(), 10)]);
|
|
313
314
|
i += 1;
|
|
314
315
|
}
|
|
315
316
|
}
|
|
@@ -330,7 +331,7 @@ var RowDD = /** @class */ (function () {
|
|
|
330
331
|
}
|
|
331
332
|
else {
|
|
332
333
|
for (var i = 0; i < dragRecords.length; i++) {
|
|
333
|
-
setValue('uniqueIDCollection.' + dragRecords[i].uniqueID, dragRecords[i], this.parent);
|
|
334
|
+
setValue('uniqueIDCollection.' + dragRecords[parseInt(i.toString(), 10)].uniqueID, dragRecords[parseInt(i.toString(), 10)], this.parent);
|
|
334
335
|
}
|
|
335
336
|
var args = { data: e.records, dropIndex: e.toIndex };
|
|
336
337
|
if (this.parent.dataSource instanceof DataManager) {
|
|
@@ -363,7 +364,7 @@ var RowDD = /** @class */ (function () {
|
|
|
363
364
|
};
|
|
364
365
|
RowDD.prototype.rowsRemoved = function (e) {
|
|
365
366
|
for (var i = 0; i < e.records.length; i++) {
|
|
366
|
-
this.draggedRecord = e.records[i];
|
|
367
|
+
this.draggedRecord = e.records[parseInt(i.toString(), 10)];
|
|
367
368
|
if (this.draggedRecord.hasChildRecords || this.draggedRecord.parentItem &&
|
|
368
369
|
this.parent.grid.dataSource.
|
|
369
370
|
indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0]) !== -1 ||
|
|
@@ -388,7 +389,8 @@ var RowDD = /** @class */ (function () {
|
|
|
388
389
|
if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {
|
|
389
390
|
var keys = Object.keys(tempDataSource);
|
|
390
391
|
for (var i = 0; i < keys.length; i++) {
|
|
391
|
-
if (tempDataSource[i][this.parent.childMapping] ===
|
|
392
|
+
if (tempDataSource[parseInt(i.toString(), 10)][this.parent.childMapping] ===
|
|
393
|
+
droppedRecord.taskData[this.parent.childMapping]) {
|
|
392
394
|
idx = i;
|
|
393
395
|
}
|
|
394
396
|
}
|
|
@@ -408,7 +410,8 @@ var RowDD = /** @class */ (function () {
|
|
|
408
410
|
var record = this.getChildrecordsByParentID(droppedRecord.parentUniqueID)[0];
|
|
409
411
|
var childRecords = record.childRecords;
|
|
410
412
|
for (var i = 0; i < childRecords.length; i++) {
|
|
411
|
-
droppedRecord.parentItem.taskData[this.parent.childMapping][i
|
|
413
|
+
droppedRecord.parentItem.taskData[this.parent.childMapping][parseInt(i.toString(), 10)]
|
|
414
|
+
= childRecords[parseInt(i.toString(), 10)].taskData;
|
|
412
415
|
}
|
|
413
416
|
}
|
|
414
417
|
}
|
|
@@ -462,7 +465,7 @@ var RowDD = /** @class */ (function () {
|
|
|
462
465
|
this.removeFirstrowBorder(rowEle);
|
|
463
466
|
this.removeLastrowBorder(rowEle);
|
|
464
467
|
for (var i = 0; i < args.rows.length; i++) {
|
|
465
|
-
if (!isNullOrUndefined(rowEle) && rowEle.getAttribute('data-uid') === args.rows[i].getAttribute('data-uid')
|
|
468
|
+
if (!isNullOrUndefined(rowEle) && rowEle.getAttribute('data-uid') === args.rows[parseInt(i.toString(), 10)].getAttribute('data-uid')
|
|
466
469
|
|| !parentsUntil(args.target, 'e-gridcontent')) {
|
|
467
470
|
this.dropPosition = 'Invalid';
|
|
468
471
|
this.addErrorElem();
|
|
@@ -660,10 +663,10 @@ var RowDD = /** @class */ (function () {
|
|
|
660
663
|
RowDD.prototype.addRemoveClasses = function (cells, add, className) {
|
|
661
664
|
for (var i = 0, len = cells.length; i < len; i++) {
|
|
662
665
|
if (add) {
|
|
663
|
-
cells[i].classList.add(className);
|
|
666
|
+
cells[parseInt(i.toString(), 10)].classList.add(className);
|
|
664
667
|
}
|
|
665
668
|
else {
|
|
666
|
-
cells[i].classList.remove(className);
|
|
669
|
+
cells[parseInt(i.toString(), 10)].classList.remove(className);
|
|
667
670
|
}
|
|
668
671
|
}
|
|
669
672
|
};
|
|
@@ -686,7 +689,7 @@ var RowDD = /** @class */ (function () {
|
|
|
686
689
|
var rowEle = args.target ? closest(args.target, 'tr') : null;
|
|
687
690
|
var rowIdx = rowEle ? rowEle.rowIndex : -1;
|
|
688
691
|
var dragRecords = [];
|
|
689
|
-
var droppedRecord = tObj.getCurrentViewRecords()[rowIdx];
|
|
692
|
+
var droppedRecord = tObj.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
|
|
690
693
|
this.removeErrorElem();
|
|
691
694
|
this.canDrop = true;
|
|
692
695
|
if (!args.data[0]) {
|
|
@@ -765,12 +768,12 @@ var RowDD = /** @class */ (function () {
|
|
|
765
768
|
else if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-lastrow-border')[0])) {
|
|
766
769
|
this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();
|
|
767
770
|
}
|
|
768
|
-
if (this.parent.enableImmutableMode && !this.parent.allowPaging && !isNullOrUndefined(args.data[0][parentItem])) {
|
|
771
|
+
if (this.parent.enableImmutableMode && !this.parent.allowPaging && !isNullOrUndefined(args.data[0]["" + parentItem])) {
|
|
769
772
|
var index = this.parent.treeColumnIndex;
|
|
770
773
|
index = index + 1;
|
|
771
774
|
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
772
|
-
var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField]);
|
|
773
|
-
var row = this.parent.getRows()[rowIndex];
|
|
775
|
+
var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField]);
|
|
776
|
+
var row = this.parent.getRows()[parseInt(rowIndex.toString(), 10)];
|
|
774
777
|
var data = args.data[0];
|
|
775
778
|
if (this.dropPosition === 'middleSegment') {
|
|
776
779
|
var record = [];
|
|
@@ -778,14 +781,15 @@ var RowDD = /** @class */ (function () {
|
|
|
778
781
|
record.push(data);
|
|
779
782
|
rows.push(row);
|
|
780
783
|
var parentUniqueID = 'parentUniqueID';
|
|
781
|
-
data = getParentData(this.parent, args.data[0][parentUniqueID]);
|
|
782
|
-
rowIndex = this.parent.grid.getRowIndexByPrimaryKey(data[primaryKeyField]);
|
|
783
|
-
var parentrow = this.parent.getRows()[rowIndex];
|
|
784
|
+
data = getParentData(this.parent, args.data[0]["" + parentUniqueID]);
|
|
785
|
+
rowIndex = this.parent.grid.getRowIndexByPrimaryKey(data["" + primaryKeyField]);
|
|
786
|
+
var parentrow = this.parent.getRows()[parseInt(rowIndex.toString(), 10)];
|
|
784
787
|
record.push(data);
|
|
785
788
|
rows.push(parentrow);
|
|
786
789
|
for (var i = 0; i < record.length; i++) {
|
|
787
790
|
this.parent.renderModule.cellRender({
|
|
788
|
-
data: record[i
|
|
791
|
+
data: record[parseInt(i.toString(), 10)],
|
|
792
|
+
cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
|
|
789
793
|
column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
|
|
790
794
|
requestType: 'rowDragAndDrop'
|
|
791
795
|
});
|
|
@@ -798,7 +802,7 @@ var RowDD = /** @class */ (function () {
|
|
|
798
802
|
}
|
|
799
803
|
else {
|
|
800
804
|
this.parent.renderModule.cellRender({
|
|
801
|
-
data: data, cell: row.cells[index],
|
|
805
|
+
data: data, cell: row.cells[parseInt(index.toString(), 10)],
|
|
802
806
|
column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
|
|
803
807
|
requestType: 'rowDragAndDrop'
|
|
804
808
|
});
|
|
@@ -817,17 +821,17 @@ var RowDD = /** @class */ (function () {
|
|
|
817
821
|
var records = tObj.getSelectedRecords();
|
|
818
822
|
var indexes = [];
|
|
819
823
|
for (var i = 0; i < records.length; i++) {
|
|
820
|
-
indexes[i] = records[i].index;
|
|
824
|
+
indexes[parseInt(i.toString(), 10)] = records[parseInt(i.toString(), 10)].index;
|
|
821
825
|
}
|
|
822
826
|
var data = srcControl.dataSource;
|
|
823
827
|
if (this.parent.idMapping !== null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
|
|
824
828
|
var actualData = [];
|
|
825
829
|
for (var i = 0; i < records.length; i++) {
|
|
826
|
-
if (records[i].hasChildRecords) {
|
|
827
|
-
actualData.push(records[i]);
|
|
828
|
-
var child = findChildrenRecords(records[i]);
|
|
830
|
+
if (records[parseInt(i.toString(), 10)].hasChildRecords) {
|
|
831
|
+
actualData.push(records[parseInt(i.toString(), 10)]);
|
|
832
|
+
var child = findChildrenRecords(records[parseInt(i.toString(), 10)]);
|
|
829
833
|
for (var i_1 = 0; i_1 < child.length; i_1++) {
|
|
830
|
-
actualData.push(child[i_1]); // push child records to drop the parent record along with its child records
|
|
834
|
+
actualData.push(child[parseInt(i_1.toString(), 10)]); // push child records to drop the parent record along with its child records
|
|
831
835
|
}
|
|
832
836
|
}
|
|
833
837
|
}
|
|
@@ -840,10 +844,10 @@ var RowDD = /** @class */ (function () {
|
|
|
840
844
|
var srcControlFlatData = srcControl.rowDragAndDropModule.treeGridData;
|
|
841
845
|
if (!isNullOrUndefined(srcControlFlatData)) {
|
|
842
846
|
for (var i = 0; i < srcControlFlatData.length; i++) {
|
|
843
|
-
srcControlFlatData[i].index = i;
|
|
844
|
-
if (!isNullOrUndefined(srcControlFlatData[i].parentItem)) {
|
|
845
|
-
var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[i].parentUniqueID + '.index', srcControl);
|
|
846
|
-
srcControlFlatData[i].parentItem.index = actualIndex;
|
|
847
|
+
srcControlFlatData[parseInt(i.toString(), 10)].index = i;
|
|
848
|
+
if (!isNullOrUndefined(srcControlFlatData[parseInt(i.toString(), 10)].parentItem)) {
|
|
849
|
+
var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[parseInt(i.toString(), 10)].parentUniqueID + '.index', srcControl);
|
|
850
|
+
srcControlFlatData[parseInt(i.toString(), 10)].parentItem.index = actualIndex;
|
|
847
851
|
}
|
|
848
852
|
}
|
|
849
853
|
}
|
|
@@ -880,13 +884,13 @@ var RowDD = /** @class */ (function () {
|
|
|
880
884
|
if (this.dropPosition === 'bottomSegment') {
|
|
881
885
|
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
882
886
|
var rowIndex = selectedItemIndex === -1 ?
|
|
883
|
-
(this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField]))
|
|
887
|
+
(this.parent.grid.getRowIndexByPrimaryKey(data[0]["" + primaryKeyField]))
|
|
884
888
|
: this.parent.getSelectedRowIndexes()[0];
|
|
885
|
-
var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
|
|
889
|
+
var selectedRecord = this.parent.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
|
|
886
890
|
this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
|
|
887
891
|
}
|
|
888
892
|
if (this.dropPosition === 'middleSegment') {
|
|
889
|
-
var level = this.parent.getCurrentViewRecords()[selectedItemIndex].level;
|
|
893
|
+
var level = this.parent.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)].level;
|
|
890
894
|
if (level === parentItem.level) {
|
|
891
895
|
this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);
|
|
892
896
|
}
|
|
@@ -903,16 +907,16 @@ var RowDD = /** @class */ (function () {
|
|
|
903
907
|
if (isNullOrUndefined(args.dropIndex)) {
|
|
904
908
|
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
905
909
|
var rowIndex = tObj.selectedRowIndex === -1 ?
|
|
906
|
-
(this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField])) - 1
|
|
910
|
+
(this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField])) - 1
|
|
907
911
|
: tObj.getSelectedRowIndexes()[0] - 1;
|
|
908
|
-
var record = tObj.getCurrentViewRecords()[rowIndex];
|
|
912
|
+
var record = tObj.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
|
|
909
913
|
this.getParentData(record, args.data);
|
|
910
914
|
}
|
|
911
915
|
else {
|
|
912
916
|
args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
|
|
913
917
|
if (this.parent.enableVirtualization) {
|
|
914
918
|
var index = this.parent.getRowByIndex(args.dropIndex).rowIndex;
|
|
915
|
-
this.droppedRecord = tObj.getCurrentViewRecords()[index];
|
|
919
|
+
this.droppedRecord = tObj.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
916
920
|
}
|
|
917
921
|
else {
|
|
918
922
|
this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
|
|
@@ -941,7 +945,7 @@ var RowDD = /** @class */ (function () {
|
|
|
941
945
|
dragRecords.reverse();
|
|
942
946
|
}
|
|
943
947
|
var _loop_1 = function (i) {
|
|
944
|
-
draggedRecord_2 = dragRecords[i];
|
|
948
|
+
draggedRecord_2 = dragRecords[parseInt(i.toString(), 10)];
|
|
945
949
|
this_1.draggedRecord = draggedRecord_2;
|
|
946
950
|
if (this_1.dropPosition !== 'Invalid') {
|
|
947
951
|
if (!tObj.rowDropSettings.targetID || isByMethod) {
|
|
@@ -1058,10 +1062,10 @@ var RowDD = /** @class */ (function () {
|
|
|
1058
1062
|
if (tObj.parentIdMapping) {
|
|
1059
1063
|
this.treeData.splice(recordIndex1, 0, this.draggedRecord.taskData);
|
|
1060
1064
|
}
|
|
1061
|
-
this.draggedRecord.parentItem = this.treeGridData[recordIndex1].parentItem;
|
|
1062
|
-
this.draggedRecord.parentUniqueID = this.treeGridData[recordIndex1].parentUniqueID;
|
|
1063
|
-
this.draggedRecord.level = this.treeGridData[recordIndex1].level;
|
|
1064
|
-
this.treeGridData.splice(recordIndex1, 0, this.draggedRecord);
|
|
1065
|
+
this.draggedRecord.parentItem = this.treeGridData[parseInt(recordIndex1.toString(), 10)].parentItem;
|
|
1066
|
+
this.draggedRecord.parentUniqueID = this.treeGridData[parseInt(recordIndex1.toString(), 10)].parentUniqueID;
|
|
1067
|
+
this.draggedRecord.level = this.treeGridData[parseInt(recordIndex1.toString(), 10)].level;
|
|
1068
|
+
this.treeGridData.splice(parseInt(recordIndex1.toString(), 10), 0, this.draggedRecord);
|
|
1065
1069
|
if (this.draggedRecord.hasChildRecords) {
|
|
1066
1070
|
var level = 1;
|
|
1067
1071
|
this.updateChildRecord(this.draggedRecord, recordIndex1);
|
|
@@ -1085,8 +1089,8 @@ var RowDD = /** @class */ (function () {
|
|
|
1085
1089
|
droppedRecord.hasFilteredChildRecords = true;
|
|
1086
1090
|
if (isNullOrUndefined(droppedRecord.childRecords) || droppedRecord.childRecords.length === 0) {
|
|
1087
1091
|
droppedRecord.childRecords = [];
|
|
1088
|
-
if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData[childItem])) {
|
|
1089
|
-
droppedRecord.taskData[childItem] = [];
|
|
1092
|
+
if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData["" + childItem])) {
|
|
1093
|
+
droppedRecord.taskData["" + childItem] = [];
|
|
1090
1094
|
}
|
|
1091
1095
|
}
|
|
1092
1096
|
}
|
|
@@ -1097,11 +1101,11 @@ var RowDD = /** @class */ (function () {
|
|
|
1097
1101
|
draggedRecord.parentUniqueID = droppedRecord.uniqueID;
|
|
1098
1102
|
droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
|
|
1099
1103
|
var isSelfReference = 'isSelfReference';
|
|
1100
|
-
if (tObj[isSelfReference]) {
|
|
1104
|
+
if (tObj["" + isSelfReference]) {
|
|
1101
1105
|
droppedRecord[tObj.childMapping] = [];
|
|
1102
1106
|
droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
|
|
1103
1107
|
}
|
|
1104
|
-
if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
|
|
1108
|
+
if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData["" + childItem])) {
|
|
1105
1109
|
droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
|
|
1106
1110
|
}
|
|
1107
1111
|
if (!draggedRecord.hasChildRecords) {
|
|
@@ -1140,10 +1144,10 @@ var RowDD = /** @class */ (function () {
|
|
|
1140
1144
|
length = record.childRecords.length;
|
|
1141
1145
|
for (var i = 0; i < length; i++) {
|
|
1142
1146
|
if (!this.isMultipleGrid) {
|
|
1143
|
-
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
|
|
1147
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, tObj);
|
|
1144
1148
|
}
|
|
1145
1149
|
else {
|
|
1146
|
-
currentRecord = record.childRecords[i];
|
|
1150
|
+
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1147
1151
|
}
|
|
1148
1152
|
count++;
|
|
1149
1153
|
tObj.flatData.splice(count, 0, currentRecord);
|
|
@@ -1167,10 +1171,10 @@ var RowDD = /** @class */ (function () {
|
|
|
1167
1171
|
length = record.childRecords.length;
|
|
1168
1172
|
for (var i = 0; i < length; i++) {
|
|
1169
1173
|
if (!this.isMultipleGrid) {
|
|
1170
|
-
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
|
|
1174
|
+
currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, this.parent);
|
|
1171
1175
|
}
|
|
1172
1176
|
else {
|
|
1173
|
-
currentRecord = record.childRecords[i];
|
|
1177
|
+
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1174
1178
|
}
|
|
1175
1179
|
var parentData = void 0;
|
|
1176
1180
|
if (record.parentItem) {
|
|
@@ -1219,12 +1223,13 @@ var RowDD = /** @class */ (function () {
|
|
|
1219
1223
|
var idz = void 0;
|
|
1220
1224
|
var treeGridData = dataSource;
|
|
1221
1225
|
for (var i = 0; i < treeGridData.length; i++) {
|
|
1222
|
-
if (treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
|
|
1226
|
+
if (treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
|
|
1223
1227
|
idx = i;
|
|
1224
1228
|
}
|
|
1225
1229
|
}
|
|
1226
1230
|
for (var i = 0; i < this.treeGridData.length; i++) {
|
|
1227
|
-
if (this.treeGridData[i
|
|
1231
|
+
if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
|
|
1232
|
+
=== deletedRow.taskData[this.parent.idMapping]) {
|
|
1228
1233
|
idz = i;
|
|
1229
1234
|
}
|
|
1230
1235
|
}
|
|
@@ -1246,7 +1251,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1246
1251
|
if (recordIndex === -1 && !tObj.parentIdMapping) {
|
|
1247
1252
|
var primaryKeyField = tObj.getPrimaryKeyFieldNames()[0];
|
|
1248
1253
|
for (var j = 0; j < this.treeGridData.length; j++) {
|
|
1249
|
-
if (this.treeGridData[j][primaryKeyField] === deletedRow[primaryKeyField]) {
|
|
1254
|
+
if (this.treeGridData[parseInt(j.toString(), 10)]["" + primaryKeyField] === deletedRow["" + primaryKeyField]) {
|
|
1250
1255
|
recordIndex = j;
|
|
1251
1256
|
}
|
|
1252
1257
|
}
|
|
@@ -1287,7 +1292,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1287
1292
|
dataSource = this.parent.dataSource;
|
|
1288
1293
|
}
|
|
1289
1294
|
for (var i = 0; i < record.childRecords.length; i++) {
|
|
1290
|
-
currentRecord = record.childRecords[i];
|
|
1295
|
+
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1291
1296
|
if (!isNullOrUndefined(currentRecord.childRecords) && currentRecord.childRecords.length) {
|
|
1292
1297
|
currentRecord.hasChildRecords = true;
|
|
1293
1298
|
}
|
|
@@ -1299,12 +1304,13 @@ var RowDD = /** @class */ (function () {
|
|
|
1299
1304
|
treeGridData = this.parent.dataSource;
|
|
1300
1305
|
}
|
|
1301
1306
|
for (var i_2 = 0; i_2 < treeGridData.length; i_2++) {
|
|
1302
|
-
if (treeGridData[i_2][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {
|
|
1307
|
+
if (treeGridData[parseInt(i_2.toString(), 10)][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {
|
|
1303
1308
|
idx = i_2;
|
|
1304
1309
|
}
|
|
1305
1310
|
}
|
|
1306
1311
|
for (var i_3 = 0; i_3 < this.treeGridData.length; i_3++) {
|
|
1307
|
-
if (this.treeGridData[i_3
|
|
1312
|
+
if (this.treeGridData[parseInt(i_3.toString(), 10)][this.parent.idMapping]
|
|
1313
|
+
=== currentRecord.taskData[this.parent.idMapping]) {
|
|
1308
1314
|
idz = i_3;
|
|
1309
1315
|
break;
|
|
1310
1316
|
}
|
|
@@ -1326,7 +1332,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1326
1332
|
return 0;
|
|
1327
1333
|
}
|
|
1328
1334
|
for (var i = 0; i < record.childRecords.length; i++) {
|
|
1329
|
-
currentRecord = record.childRecords[i];
|
|
1335
|
+
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1330
1336
|
count++;
|
|
1331
1337
|
if (currentRecord.hasChildRecords) {
|
|
1332
1338
|
count = this.getChildCount(currentRecord, count);
|