@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.
Files changed (126) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +15 -32
  3. package/README.md +64 -51
  4. package/dist/ej2-treegrid.min.js +1 -0
  5. package/dist/ej2-treegrid.umd.min.js +1 -10
  6. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es2015.js +2046 -1076
  8. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  9. package/dist/es6/ej2-treegrid.es5.js +2131 -1113
  10. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  11. package/dist/global/ej2-treegrid.min.js +1 -10
  12. package/dist/global/ej2-treegrid.min.js.map +1 -1
  13. package/dist/global/index.d.ts +0 -9
  14. package/helpers/e2e/index.js +8 -6
  15. package/helpers/e2e/treegridhelper.js +82 -65
  16. package/package.json +64 -64
  17. package/src/treegrid/actions/batch-edit.js +115 -87
  18. package/src/treegrid/actions/clipboard.d.ts +3 -2
  19. package/src/treegrid/actions/clipboard.js +37 -35
  20. package/src/treegrid/actions/context-menu.js +53 -1
  21. package/src/treegrid/actions/crud-actions.js +67 -56
  22. package/src/treegrid/actions/detail-row.js +7 -7
  23. package/src/treegrid/actions/edit.d.ts +1 -0
  24. package/src/treegrid/actions/edit.js +168 -115
  25. package/src/treegrid/actions/excel-export.js +2 -2
  26. package/src/treegrid/actions/filter.js +13 -16
  27. package/src/treegrid/actions/freeze-column.d.ts +1 -0
  28. package/src/treegrid/actions/freeze-column.js +48 -11
  29. package/src/treegrid/actions/infinite-scroll.js +25 -22
  30. package/src/treegrid/actions/logger.js +10 -10
  31. package/src/treegrid/actions/page.d.ts +1 -0
  32. package/src/treegrid/actions/page.js +21 -8
  33. package/src/treegrid/actions/reorder.js +2 -2
  34. package/src/treegrid/actions/rowdragdrop.js +142 -86
  35. package/src/treegrid/actions/selection.d.ts +1 -0
  36. package/src/treegrid/actions/selection.js +71 -39
  37. package/src/treegrid/actions/sort.js +17 -5
  38. package/src/treegrid/actions/summary.js +24 -24
  39. package/src/treegrid/actions/toolbar.js +45 -43
  40. package/src/treegrid/actions/virtual-scroll.js +7 -4
  41. package/src/treegrid/base/constant.d.ts +30 -0
  42. package/src/treegrid/base/constant.js +30 -0
  43. package/src/treegrid/base/data.d.ts +1 -0
  44. package/src/treegrid/base/data.js +257 -57
  45. package/src/treegrid/base/treegrid-model.d.ts +50 -34
  46. package/src/treegrid/base/treegrid.d.ts +57 -35
  47. package/src/treegrid/base/treegrid.js +363 -200
  48. package/src/treegrid/enum.d.ts +8 -2
  49. package/src/treegrid/enum.js +2 -0
  50. package/src/treegrid/models/column.d.ts +6 -6
  51. package/src/treegrid/models/column.js +9 -9
  52. package/src/treegrid/models/index.d.ts +2 -0
  53. package/src/treegrid/models/index.js +1 -0
  54. package/src/treegrid/models/loading-indicator-model.d.ts +20 -0
  55. package/src/treegrid/models/loading-indicator.d.ts +17 -0
  56. package/src/treegrid/models/loading-indicator.js +34 -0
  57. package/src/treegrid/renderer/render.d.ts +4 -4
  58. package/src/treegrid/renderer/render.js +33 -24
  59. package/src/treegrid/renderer/virtual-row-model-generator.js +15 -6
  60. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -2
  61. package/src/treegrid/renderer/virtual-tree-content-render.js +224 -106
  62. package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
  63. package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
  64. package/src/treegrid/utils.js +13 -12
  65. package/styles/bootstrap-dark.css +14 -1
  66. package/styles/bootstrap.css +14 -1
  67. package/styles/bootstrap4.css +14 -1
  68. package/styles/bootstrap5-dark.css +16 -2
  69. package/styles/bootstrap5.css +16 -2
  70. package/styles/fabric-dark.css +14 -1
  71. package/styles/fabric.css +14 -1
  72. package/styles/fluent-dark.css +15 -2
  73. package/styles/fluent.css +15 -2
  74. package/styles/highcontrast-light.css +14 -1
  75. package/styles/highcontrast.css +14 -1
  76. package/styles/material-dark.css +14 -1
  77. package/styles/material.css +14 -1
  78. package/styles/tailwind-dark.css +14 -1
  79. package/styles/tailwind.css +14 -1
  80. package/styles/treegrid/_all.scss +1 -1
  81. package/styles/treegrid/_bootstrap-dark-definition.scss +1 -1
  82. package/styles/treegrid/_bootstrap-definition.scss +1 -2
  83. package/styles/treegrid/_bootstrap4-definition.scss +0 -1
  84. package/styles/treegrid/_bootstrap5-definition.scss +0 -1
  85. package/styles/treegrid/_fabric-dark-definition.scss +1 -2
  86. package/styles/treegrid/_fabric-definition.scss +1 -2
  87. package/styles/treegrid/_fluent-definition.scss +0 -1
  88. package/styles/treegrid/_fusionnew-definition.scss +28 -0
  89. package/styles/treegrid/_highcontrast-definition.scss +0 -1
  90. package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
  91. package/styles/treegrid/_icons.scss +12 -1
  92. package/styles/treegrid/_layout.scss +4 -4
  93. package/styles/treegrid/_material-definition.scss +0 -1
  94. package/styles/treegrid/_material3-definition.scss +28 -0
  95. package/styles/treegrid/_tailwind-definition.scss +0 -1
  96. package/styles/treegrid/_theme.scss +1 -0
  97. package/styles/treegrid/bootstrap-dark.css +14 -1
  98. package/styles/treegrid/bootstrap.css +14 -1
  99. package/styles/treegrid/bootstrap4.css +14 -1
  100. package/styles/treegrid/bootstrap5-dark.css +16 -2
  101. package/styles/treegrid/bootstrap5.css +16 -2
  102. package/styles/treegrid/fabric-dark.css +14 -1
  103. package/styles/treegrid/fabric.css +14 -1
  104. package/styles/treegrid/fluent-dark.css +15 -2
  105. package/styles/treegrid/fluent.css +15 -2
  106. package/styles/treegrid/highcontrast-light.css +14 -1
  107. package/styles/treegrid/highcontrast.css +14 -1
  108. package/styles/treegrid/icons/_bootstrap-dark.scss +12 -1
  109. package/styles/treegrid/icons/_bootstrap.scss +12 -1
  110. package/styles/treegrid/icons/_bootstrap4.scss +12 -1
  111. package/styles/treegrid/icons/_bootstrap5.scss +11 -0
  112. package/styles/treegrid/icons/_fabric-dark.scss +12 -1
  113. package/styles/treegrid/icons/_fabric.scss +12 -1
  114. package/styles/treegrid/icons/_fluent.scss +11 -0
  115. package/styles/treegrid/icons/_fusionnew.scss +26 -0
  116. package/styles/treegrid/icons/_highcontrast-light.scss +12 -1
  117. package/styles/treegrid/icons/_highcontrast.scss +11 -0
  118. package/styles/treegrid/icons/_material-dark.scss +12 -1
  119. package/styles/treegrid/icons/_material.scss +11 -0
  120. package/styles/treegrid/icons/_material3.scss +26 -0
  121. package/styles/treegrid/icons/_tailwind-dark.scss +11 -0
  122. package/styles/treegrid/icons/_tailwind.scss +11 -0
  123. package/styles/treegrid/material-dark.css +14 -1
  124. package/styles/treegrid/material.css +14 -1
  125. package/styles/treegrid/tailwind-dark.css +14 -1
  126. package/styles/treegrid/tailwind.css +14 -1
@@ -81,10 +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
- data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];
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)];
88
89
  }
89
90
  var isByMethod = true;
90
91
  var args = {
@@ -98,7 +99,7 @@ var RowDD = /** @class */ (function () {
98
99
  if (tObj.isLocalData) {
99
100
  tObj.flatData = this.orderToIndex(tObj.flatData);
100
101
  }
101
- if (this.parent[action] === 'outdenting') {
102
+ if (this.parent["" + action] === 'outdenting') {
102
103
  if (!isNullOrUndefined(data[0].parentItem)) {
103
104
  data[0].level = data[0].parentItem.level + 1;
104
105
  }
@@ -109,7 +110,7 @@ var RowDD = /** @class */ (function () {
109
110
  if (this.parent.allowRowDragAndDrop) {
110
111
  index = this.parent.treeColumnIndex + 1;
111
112
  }
112
- else if (this.parent[action] === 'indenting') {
113
+ else if (this.parent["" + action] === 'indenting') {
113
114
  index = this.parent.treeColumnIndex;
114
115
  }
115
116
  var row = this.parent.getRows()[fromIndexes[0]];
@@ -119,18 +120,18 @@ var RowDD = /** @class */ (function () {
119
120
  totalRecord.push(dropData);
120
121
  rows.push(row);
121
122
  var parentUniqueID = 'parentUniqueID';
122
- var parentData = getParentData(this.parent, args.data[0][parentUniqueID]);
123
- 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)];
124
125
  totalRecord.push(parentData);
125
126
  rows.push(parentrow);
126
- this.parent[updateRowAndCellElements](totalRecord, rows, index);
127
+ this.parent["" + updateRowAndCellElements](totalRecord, rows, index);
127
128
  }
128
- if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {
129
+ if (this.parent.enableImmutableMode && this.parent["" + action] === 'outdenting') {
129
130
  var index = void 0;
130
131
  if (this.parent.allowRowDragAndDrop) {
131
132
  index = this.parent.treeColumnIndex + 1;
132
133
  }
133
- else if (this.parent[action] === 'outdenting') {
134
+ else if (this.parent["" + action] === 'outdenting') {
134
135
  index = this.parent.treeColumnIndex;
135
136
  }
136
137
  var record = args.data[0];
@@ -139,7 +140,7 @@ var RowDD = /** @class */ (function () {
139
140
  var rows = [];
140
141
  totalRecord.push(record);
141
142
  rows.push(row);
142
- this.parent[updateRowAndCellElements](totalRecord, rows, index);
143
+ this.parent["" + updateRowAndCellElements](totalRecord, rows, index);
143
144
  }
144
145
  }
145
146
  else {
@@ -162,14 +163,14 @@ var RowDD = /** @class */ (function () {
162
163
  selectedItemIndex = this.parent.selectedRowIndex;
163
164
  }
164
165
  this.selectedItem = isNullOrUndefined(record) ?
165
- tObj.getCurrentViewRecords()[selectedItemIndex] : record;
166
+ tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)] : record;
166
167
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
167
- var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[primaryKeyField]);
168
+ var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem["" + primaryKeyField]);
168
169
  this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?
169
170
  this.parent.getSelectedRows()[0]
170
171
  : this.parent.grid.getRowByIndex(rowIndex);
171
172
  this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?
172
- tObj.getCurrentViewRecords()[selectedItemIndex]
173
+ tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)]
173
174
  : this.selectedItem;
174
175
  if (request === 'indent') {
175
176
  var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];
@@ -180,16 +181,23 @@ var RowDD = /** @class */ (function () {
180
181
  }
181
182
  if (record_1.level > this.selectedRecord.level) {
182
183
  for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
183
- if (tObj.getCurrentViewRecords()[i].taskData === record_1.parentItem.taskData) {
184
+ if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].taskData ===
185
+ record_1.parentItem.taskData) {
184
186
  dropIndex = i;
187
+ if (tObj.enableVirtualization) {
188
+ dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('data-rowindex'), 10);
189
+ }
185
190
  }
186
191
  }
187
192
  }
188
193
  else {
189
194
  dropIndex = this.selectedRow.rowIndex - 1;
190
195
  }
191
- tObj[action] = 'indenting';
192
- tObj[droppedIndex] = dropIndex;
196
+ if (this.parent.enableVirtualization && this.selectedRecord && !(record_1.level > this.selectedRecord.level)) {
197
+ dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
198
+ }
199
+ tObj["" + action] = 'indenting';
200
+ tObj["" + droppedIndex] = dropIndex;
193
201
  this.eventTrigger('indenting', dropIndex);
194
202
  }
195
203
  else if (request === 'outdent') {
@@ -200,12 +208,15 @@ var RowDD = /** @class */ (function () {
200
208
  var dropIndex = void 0;
201
209
  var parentItem = this.selectedRecord.parentItem;
202
210
  for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
203
- if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
211
+ if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].uniqueID === parentItem.uniqueID) {
204
212
  dropIndex = i;
205
213
  }
206
214
  }
207
- tObj[action] = 'outdenting';
208
- tObj[droppedIndex] = dropIndex;
215
+ if (this.parent.enableVirtualization && this.selectedRecord) {
216
+ dropIndex = parseInt(this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('data-rowindex'), 10);
217
+ }
218
+ tObj["" + action] = 'outdenting';
219
+ tObj["" + droppedIndex] = dropIndex;
209
220
  this.eventTrigger('outdenting', dropIndex);
210
221
  }
211
222
  }
@@ -221,20 +232,30 @@ var RowDD = /** @class */ (function () {
221
232
  this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
222
233
  if (!actionArgs.cancel) {
223
234
  if (actionArgs.action === 'indenting') {
224
- _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');
235
+ if (_this.parent.enableVirtualization) {
236
+ _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
237
+ }
238
+ else {
239
+ _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');
240
+ }
225
241
  }
226
242
  else if (actionArgs.action === 'outdenting') {
227
- _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');
243
+ if (_this.parent.enableVirtualization) {
244
+ _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
245
+ }
246
+ else {
247
+ _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');
248
+ }
228
249
  }
229
250
  }
230
251
  });
231
252
  };
232
253
  RowDD.prototype.orderToIndex = function (currentData) {
233
254
  for (var i = 0; i < currentData.length; i++) {
234
- currentData[i].index = i;
235
- if (!isNullOrUndefined(currentData[i].parentItem)) {
236
- var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);
237
- 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;
238
259
  }
239
260
  }
240
261
  return currentData;
@@ -243,7 +264,7 @@ var RowDD = /** @class */ (function () {
243
264
  var draggedRecord;
244
265
  var dragRecords = e.records;
245
266
  for (var i = e.records.length - 1; i > -1; i--) {
246
- draggedRecord = dragRecords[i];
267
+ draggedRecord = dragRecords[parseInt(i.toString(), 10)];
247
268
  if (draggedRecord.parentUniqueID) {
248
269
  var record = dragRecords.filter(function (data) {
249
270
  return data.uniqueID === draggedRecord.parentUniqueID;
@@ -270,7 +291,7 @@ var RowDD = /** @class */ (function () {
270
291
  var dragRecords_1 = e.records;
271
292
  var dragLength = e.records.length;
272
293
  for (var i = dragLength - 1; i > -1; i--) {
273
- draggedRecord_1 = dragRecords_1[i];
294
+ draggedRecord_1 = dragRecords_1[parseInt(i.toString(), 10)];
274
295
  if (!i && draggedRecord_1.hasChildRecords) {
275
296
  draggedRecord_1.taskData[this.parent.parentIdMapping] = null;
276
297
  }
@@ -287,9 +308,9 @@ var RowDD = /** @class */ (function () {
287
308
  !isNullOrUndefined(tObj.parentIdMapping)) {
288
309
  var childData = (draggedRecord_1[tObj.childMapping]);
289
310
  for (var j = 0; j < childData.length; j++) {
290
- if (dragRecords_1.indexOf(childData[j]) === -1) {
291
- dragRecords_1.splice(j, 0, childData[j]);
292
- 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)]);
293
314
  i += 1;
294
315
  }
295
316
  }
@@ -310,7 +331,7 @@ var RowDD = /** @class */ (function () {
310
331
  }
311
332
  else {
312
333
  for (var i = 0; i < dragRecords.length; i++) {
313
- 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);
314
335
  }
315
336
  var args = { data: e.records, dropIndex: e.toIndex };
316
337
  if (this.parent.dataSource instanceof DataManager) {
@@ -343,7 +364,7 @@ var RowDD = /** @class */ (function () {
343
364
  };
344
365
  RowDD.prototype.rowsRemoved = function (e) {
345
366
  for (var i = 0; i < e.records.length; i++) {
346
- this.draggedRecord = e.records[i];
367
+ this.draggedRecord = e.records[parseInt(i.toString(), 10)];
347
368
  if (this.draggedRecord.hasChildRecords || this.draggedRecord.parentItem &&
348
369
  this.parent.grid.dataSource.
349
370
  indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0]) !== -1 ||
@@ -368,7 +389,8 @@ var RowDD = /** @class */ (function () {
368
389
  if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {
369
390
  var keys = Object.keys(tempDataSource);
370
391
  for (var i = 0; i < keys.length; i++) {
371
- if (tempDataSource[i][this.parent.childMapping] === droppedRecord.taskData[this.parent.childMapping]) {
392
+ if (tempDataSource[parseInt(i.toString(), 10)][this.parent.childMapping] ===
393
+ droppedRecord.taskData[this.parent.childMapping]) {
372
394
  idx = i;
373
395
  }
374
396
  }
@@ -388,7 +410,8 @@ var RowDD = /** @class */ (function () {
388
410
  var record = this.getChildrecordsByParentID(droppedRecord.parentUniqueID)[0];
389
411
  var childRecords = record.childRecords;
390
412
  for (var i = 0; i < childRecords.length; i++) {
391
- droppedRecord.parentItem.taskData[this.parent.childMapping][i] = childRecords[i].taskData;
413
+ droppedRecord.parentItem.taskData[this.parent.childMapping][parseInt(i.toString(), 10)]
414
+ = childRecords[parseInt(i.toString(), 10)].taskData;
392
415
  }
393
416
  }
394
417
  }
@@ -419,9 +442,17 @@ var RowDD = /** @class */ (function () {
419
442
  RowDD.prototype.removeLastrowBorder = function (element) {
420
443
  var isEmptyRow = element && (element.classList.contains('e-emptyrow') || element.classList.contains('e-columnheader')
421
444
  || element.classList.contains('e-detailrow'));
422
- var islastRowIndex = element && !isEmptyRow &&
423
- this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==
424
- element.getAttribute('data-uid');
445
+ var islastRowIndex;
446
+ if (this.parent.enableVirtualization) {
447
+ islastRowIndex = element && !isEmptyRow &&
448
+ this.parent.getRows()[this.parent.getCurrentViewRecords().length - 1].getAttribute('data-uid') !==
449
+ element.getAttribute('data-uid');
450
+ }
451
+ else {
452
+ islastRowIndex = element && !isEmptyRow &&
453
+ this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==
454
+ element.getAttribute('data-uid');
455
+ }
425
456
  var canremove = islastRowIndex || this.dropPosition === 'topSegment';
426
457
  if (this.parent.element.getElementsByClassName('e-lastrow-border').length > 0 && element && (islastRowIndex || canremove)) {
427
458
  this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();
@@ -434,7 +465,7 @@ var RowDD = /** @class */ (function () {
434
465
  this.removeFirstrowBorder(rowEle);
435
466
  this.removeLastrowBorder(rowEle);
436
467
  for (var i = 0; i < args.rows.length; i++) {
437
- 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')
438
469
  || !parentsUntil(args.target, 'e-gridcontent')) {
439
470
  this.dropPosition = 'Invalid';
440
471
  this.addErrorElem();
@@ -455,7 +486,12 @@ var RowDD = /** @class */ (function () {
455
486
  rowPositionHeight = rowEle.offsetTop - scrollTop;
456
487
  }
457
488
  // let scrollTop = (tObj.grid.scrollModule as any).content.scrollTop;
458
- rowTop = rowPositionHeight + contentHeight + roundOff;
489
+ if (this.parent.enableVirtualization) {
490
+ rowTop = rowEle.getBoundingClientRect().top;
491
+ }
492
+ else {
493
+ rowTop = rowPositionHeight + contentHeight + roundOff;
494
+ }
459
495
  var rowBottom = rowTop + row[0].offsetHeight;
460
496
  var difference = rowBottom - rowTop;
461
497
  var divide = difference / 3;
@@ -535,7 +571,7 @@ var RowDD = /** @class */ (function () {
535
571
  RowDD.prototype.addLastRowborder = function (trElement) {
536
572
  var isEmptyRow = trElement && (trElement.classList.contains('e-emptyrow') ||
537
573
  trElement.classList.contains('e-columnheader') || trElement.classList.contains('e-detailrow'));
538
- if (trElement && !isEmptyRow && this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') ===
574
+ if (trElement && !isEmptyRow && this.parent.getRows()[this.parent.getCurrentViewRecords().length - 1].getAttribute('data-uid') ===
539
575
  trElement.getAttribute('data-uid')) {
540
576
  var bottomborder = this.parent.createElement('div', { className: 'e-lastrow-border' });
541
577
  var gridcontentEle = this.parent.getContent();
@@ -627,10 +663,10 @@ var RowDD = /** @class */ (function () {
627
663
  RowDD.prototype.addRemoveClasses = function (cells, add, className) {
628
664
  for (var i = 0, len = cells.length; i < len; i++) {
629
665
  if (add) {
630
- cells[i].classList.add(className);
666
+ cells[parseInt(i.toString(), 10)].classList.add(className);
631
667
  }
632
668
  else {
633
- cells[i].classList.remove(className);
669
+ cells[parseInt(i.toString(), 10)].classList.remove(className);
634
670
  }
635
671
  }
636
672
  };
@@ -653,7 +689,7 @@ var RowDD = /** @class */ (function () {
653
689
  var rowEle = args.target ? closest(args.target, 'tr') : null;
654
690
  var rowIdx = rowEle ? rowEle.rowIndex : -1;
655
691
  var dragRecords = [];
656
- var droppedRecord = tObj.getCurrentViewRecords()[rowIdx];
692
+ var droppedRecord = tObj.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
657
693
  this.removeErrorElem();
658
694
  this.canDrop = true;
659
695
  if (!args.data[0]) {
@@ -732,12 +768,12 @@ var RowDD = /** @class */ (function () {
732
768
  else if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-lastrow-border')[0])) {
733
769
  this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();
734
770
  }
735
- 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])) {
736
772
  var index = this.parent.treeColumnIndex;
737
773
  index = index + 1;
738
774
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
739
- var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField]);
740
- 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)];
741
777
  var data = args.data[0];
742
778
  if (this.dropPosition === 'middleSegment') {
743
779
  var record = [];
@@ -745,14 +781,15 @@ var RowDD = /** @class */ (function () {
745
781
  record.push(data);
746
782
  rows.push(row);
747
783
  var parentUniqueID = 'parentUniqueID';
748
- data = getParentData(this.parent, args.data[0][parentUniqueID]);
749
- rowIndex = this.parent.grid.getRowIndexByPrimaryKey(data[primaryKeyField]);
750
- 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)];
751
787
  record.push(data);
752
788
  rows.push(parentrow);
753
789
  for (var i = 0; i < record.length; i++) {
754
790
  this.parent.renderModule.cellRender({
755
- data: record[i], cell: rows[i].cells[index],
791
+ data: record[parseInt(i.toString(), 10)],
792
+ cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
756
793
  column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
757
794
  requestType: 'rowDragAndDrop'
758
795
  });
@@ -765,7 +802,7 @@ var RowDD = /** @class */ (function () {
765
802
  }
766
803
  else {
767
804
  this.parent.renderModule.cellRender({
768
- data: data, cell: row.cells[index],
805
+ data: data, cell: row.cells[parseInt(index.toString(), 10)],
769
806
  column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
770
807
  requestType: 'rowDragAndDrop'
771
808
  });
@@ -784,17 +821,17 @@ var RowDD = /** @class */ (function () {
784
821
  var records = tObj.getSelectedRecords();
785
822
  var indexes = [];
786
823
  for (var i = 0; i < records.length; i++) {
787
- indexes[i] = records[i].index;
824
+ indexes[parseInt(i.toString(), 10)] = records[parseInt(i.toString(), 10)].index;
788
825
  }
789
826
  var data = srcControl.dataSource;
790
827
  if (this.parent.idMapping !== null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {
791
828
  var actualData = [];
792
829
  for (var i = 0; i < records.length; i++) {
793
- if (records[i].hasChildRecords) {
794
- actualData.push(records[i]);
795
- 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)]);
796
833
  for (var i_1 = 0; i_1 < child.length; i_1++) {
797
- 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
798
835
  }
799
836
  }
800
837
  }
@@ -807,10 +844,10 @@ var RowDD = /** @class */ (function () {
807
844
  var srcControlFlatData = srcControl.rowDragAndDropModule.treeGridData;
808
845
  if (!isNullOrUndefined(srcControlFlatData)) {
809
846
  for (var i = 0; i < srcControlFlatData.length; i++) {
810
- srcControlFlatData[i].index = i;
811
- if (!isNullOrUndefined(srcControlFlatData[i].parentItem)) {
812
- var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[i].parentUniqueID + '.index', srcControl);
813
- 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;
814
851
  }
815
852
  }
816
853
  }
@@ -833,7 +870,7 @@ var RowDD = /** @class */ (function () {
833
870
  }
834
871
  };
835
872
  RowDD.prototype.getTargetIdx = function (targetRow) {
836
- return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;
873
+ return targetRow ? parseInt(targetRow.getAttribute('data-rowindex'), 10) : 0;
837
874
  };
838
875
  RowDD.prototype.getParentData = function (record, data) {
839
876
  var parentItem = record.parentItem;
@@ -847,13 +884,13 @@ var RowDD = /** @class */ (function () {
847
884
  if (this.dropPosition === 'bottomSegment') {
848
885
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
849
886
  var rowIndex = selectedItemIndex === -1 ?
850
- (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
851
- : this.parent.getSelectedRowIndexes()[0] - 1;
852
- var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
887
+ (this.parent.grid.getRowIndexByPrimaryKey(data[0]["" + primaryKeyField]))
888
+ : this.parent.getSelectedRowIndexes()[0];
889
+ var selectedRecord = this.parent.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
853
890
  this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
854
891
  }
855
892
  if (this.dropPosition === 'middleSegment') {
856
- var level = this.parent.getCurrentViewRecords()[selectedItemIndex].level;
893
+ var level = this.parent.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)].level;
857
894
  if (level === parentItem.level) {
858
895
  this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);
859
896
  }
@@ -870,14 +907,20 @@ var RowDD = /** @class */ (function () {
870
907
  if (isNullOrUndefined(args.dropIndex)) {
871
908
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
872
909
  var rowIndex = tObj.selectedRowIndex === -1 ?
873
- (this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField])) - 1
910
+ (this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField])) - 1
874
911
  : tObj.getSelectedRowIndexes()[0] - 1;
875
- var record = tObj.getCurrentViewRecords()[rowIndex];
912
+ var record = tObj.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
876
913
  this.getParentData(record, args.data);
877
914
  }
878
915
  else {
879
916
  args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
880
- this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
917
+ if (this.parent.enableVirtualization) {
918
+ var index = this.parent.getRowByIndex(args.dropIndex).rowIndex;
919
+ this.droppedRecord = tObj.getCurrentViewRecords()[parseInt(index.toString(), 10)];
920
+ }
921
+ else {
922
+ this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
923
+ }
881
924
  }
882
925
  var dragRecords = [];
883
926
  droppedRecord = this.droppedRecord;
@@ -902,7 +945,7 @@ var RowDD = /** @class */ (function () {
902
945
  dragRecords.reverse();
903
946
  }
904
947
  var _loop_1 = function (i) {
905
- draggedRecord_2 = dragRecords[i];
948
+ draggedRecord_2 = dragRecords[parseInt(i.toString(), 10)];
906
949
  this_1.draggedRecord = draggedRecord_2;
907
950
  if (this_1.dropPosition !== 'Invalid') {
908
951
  if (!tObj.rowDropSettings.targetID || isByMethod) {
@@ -954,6 +997,7 @@ var RowDD = /** @class */ (function () {
954
997
  childRecords.splice(droppedRecordIndex, 0, draggedRecord_2);
955
998
  draggedRecord_2.parentItem = droppedRecord.parentItem;
956
999
  draggedRecord_2.parentUniqueID = droppedRecord.parentUniqueID;
1000
+ draggedRecord_2.level = droppedRecord.level;
957
1001
  if (this_1.parent.parentIdMapping) {
958
1002
  draggedRecord_2[this_1.parent.parentIdMapping] = droppedRecord[this_1.parent.parentIdMapping];
959
1003
  draggedRecord_2.parentItem = droppedRecord.parentItem;
@@ -1018,10 +1062,10 @@ var RowDD = /** @class */ (function () {
1018
1062
  if (tObj.parentIdMapping) {
1019
1063
  this.treeData.splice(recordIndex1, 0, this.draggedRecord.taskData);
1020
1064
  }
1021
- this.draggedRecord.parentItem = this.treeGridData[recordIndex1].parentItem;
1022
- this.draggedRecord.parentUniqueID = this.treeGridData[recordIndex1].parentUniqueID;
1023
- this.draggedRecord.level = this.treeGridData[recordIndex1].level;
1024
- 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);
1025
1069
  if (this.draggedRecord.hasChildRecords) {
1026
1070
  var level = 1;
1027
1071
  this.updateChildRecord(this.draggedRecord, recordIndex1);
@@ -1045,8 +1089,8 @@ var RowDD = /** @class */ (function () {
1045
1089
  droppedRecord.hasFilteredChildRecords = true;
1046
1090
  if (isNullOrUndefined(droppedRecord.childRecords) || droppedRecord.childRecords.length === 0) {
1047
1091
  droppedRecord.childRecords = [];
1048
- if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData[childItem])) {
1049
- droppedRecord.taskData[childItem] = [];
1092
+ if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData["" + childItem])) {
1093
+ droppedRecord.taskData["" + childItem] = [];
1050
1094
  }
1051
1095
  }
1052
1096
  }
@@ -1057,11 +1101,11 @@ var RowDD = /** @class */ (function () {
1057
1101
  draggedRecord.parentUniqueID = droppedRecord.uniqueID;
1058
1102
  droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);
1059
1103
  var isSelfReference = 'isSelfReference';
1060
- if (tObj[isSelfReference]) {
1104
+ if (tObj["" + isSelfReference]) {
1061
1105
  droppedRecord[tObj.childMapping] = [];
1062
1106
  droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);
1063
1107
  }
1064
- if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {
1108
+ if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData["" + childItem])) {
1065
1109
  droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);
1066
1110
  }
1067
1111
  if (!draggedRecord.hasChildRecords) {
@@ -1099,7 +1143,12 @@ var RowDD = /** @class */ (function () {
1099
1143
  }
1100
1144
  length = record.childRecords.length;
1101
1145
  for (var i = 0; i < length; i++) {
1102
- currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);
1146
+ if (!this.isMultipleGrid) {
1147
+ currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, tObj);
1148
+ }
1149
+ else {
1150
+ currentRecord = record.childRecords[parseInt(i.toString(), 10)];
1151
+ }
1103
1152
  count++;
1104
1153
  tObj.flatData.splice(count, 0, currentRecord);
1105
1154
  setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
@@ -1121,7 +1170,12 @@ var RowDD = /** @class */ (function () {
1121
1170
  }
1122
1171
  length = record.childRecords.length;
1123
1172
  for (var i = 0; i < length; i++) {
1124
- currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);
1173
+ if (!this.isMultipleGrid) {
1174
+ currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, this.parent);
1175
+ }
1176
+ else {
1177
+ currentRecord = record.childRecords[parseInt(i.toString(), 10)];
1178
+ }
1125
1179
  var parentData = void 0;
1126
1180
  if (record.parentItem) {
1127
1181
  parentData = getParentData(this.parent, record.parentItem.uniqueID);
@@ -1169,12 +1223,13 @@ var RowDD = /** @class */ (function () {
1169
1223
  var idz = void 0;
1170
1224
  var treeGridData = dataSource;
1171
1225
  for (var i = 0; i < treeGridData.length; i++) {
1172
- 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]) {
1173
1227
  idx = i;
1174
1228
  }
1175
1229
  }
1176
1230
  for (var i = 0; i < this.treeGridData.length; i++) {
1177
- if (this.treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
1231
+ if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
1232
+ === deletedRow.taskData[this.parent.idMapping]) {
1178
1233
  idz = i;
1179
1234
  }
1180
1235
  }
@@ -1196,7 +1251,7 @@ var RowDD = /** @class */ (function () {
1196
1251
  if (recordIndex === -1 && !tObj.parentIdMapping) {
1197
1252
  var primaryKeyField = tObj.getPrimaryKeyFieldNames()[0];
1198
1253
  for (var j = 0; j < this.treeGridData.length; j++) {
1199
- if (this.treeGridData[j][primaryKeyField] === deletedRow[primaryKeyField]) {
1254
+ if (this.treeGridData[parseInt(j.toString(), 10)]["" + primaryKeyField] === deletedRow["" + primaryKeyField]) {
1200
1255
  recordIndex = j;
1201
1256
  }
1202
1257
  }
@@ -1237,7 +1292,7 @@ var RowDD = /** @class */ (function () {
1237
1292
  dataSource = this.parent.dataSource;
1238
1293
  }
1239
1294
  for (var i = 0; i < record.childRecords.length; i++) {
1240
- currentRecord = record.childRecords[i];
1295
+ currentRecord = record.childRecords[parseInt(i.toString(), 10)];
1241
1296
  if (!isNullOrUndefined(currentRecord.childRecords) && currentRecord.childRecords.length) {
1242
1297
  currentRecord.hasChildRecords = true;
1243
1298
  }
@@ -1249,12 +1304,13 @@ var RowDD = /** @class */ (function () {
1249
1304
  treeGridData = this.parent.dataSource;
1250
1305
  }
1251
1306
  for (var i_2 = 0; i_2 < treeGridData.length; i_2++) {
1252
- 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]) {
1253
1308
  idx = i_2;
1254
1309
  }
1255
1310
  }
1256
1311
  for (var i_3 = 0; i_3 < this.treeGridData.length; i_3++) {
1257
- if (this.treeGridData[i_3][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {
1312
+ if (this.treeGridData[parseInt(i_3.toString(), 10)][this.parent.idMapping]
1313
+ === currentRecord.taskData[this.parent.idMapping]) {
1258
1314
  idz = i_3;
1259
1315
  break;
1260
1316
  }
@@ -1276,7 +1332,7 @@ var RowDD = /** @class */ (function () {
1276
1332
  return 0;
1277
1333
  }
1278
1334
  for (var i = 0; i < record.childRecords.length; i++) {
1279
- currentRecord = record.childRecords[i];
1335
+ currentRecord = record.childRecords[parseInt(i.toString(), 10)];
1280
1336
  count++;
1281
1337
  if (currentRecord.hasChildRecords) {
1282
1338
  count = this.getChildCount(currentRecord, count);
@@ -10,6 +10,7 @@ export declare class Selection {
10
10
  private selectedItems;
11
11
  private selectedIndexes;
12
12
  private filteredList;
13
+ private searchingRecords;
13
14
  /**
14
15
  * Constructor for Selection module
15
16
  *