@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
@@ -100,7 +100,7 @@ var BatchEdit = /** @class */ (function () {
100
100
  var index;
101
101
  if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
102
102
  for (var i = 0; i < this.batchAddedRecords.length; i++) {
103
- index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
103
+ index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
104
104
  data.splice(index, 1);
105
105
  }
106
106
  }
@@ -137,7 +137,7 @@ var BatchEdit = /** @class */ (function () {
137
137
  var indexvalue = void 0;
138
138
  var parentItem = 'parentItem';
139
139
  var uniqueID = 'uniqueID';
140
- var parentRecord = this.selectedIndex > -1 ? this.batchRecords[this.addRowIndex][parentItem] : null;
140
+ var parentRecord = this.selectedIndex > -1 ? this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + parentItem] : null;
141
141
  var idMapping = void 0;
142
142
  var parentUniqueID = void 0;
143
143
  var parentIdMapping = void 0;
@@ -149,14 +149,14 @@ var BatchEdit = /** @class */ (function () {
149
149
  if (this.batchRecords.length) {
150
150
  idMapping = this.batchRecords[this.addRowIndex][this.parent.idMapping];
151
151
  parentIdMapping = this.batchRecords[this.addRowIndex][this.parent.parentIdMapping];
152
- if (this.batchRecords[this.addRowIndex][parentItem]) {
153
- parentUniqueID = this.batchRecords[this.addRowIndex][parentItem][uniqueID];
152
+ if (this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + parentItem]) {
153
+ parentUniqueID = this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + parentItem]["" + uniqueID];
154
154
  }
155
155
  }
156
156
  this.batchAddedRecords = extendArray(this.batchAddedRecords);
157
157
  this.batchAddRowRecord = extendArray(this.batchAddRowRecord);
158
158
  this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]);
159
- added = this.parent.grid.getRowsObject()[rowObjectIndex].changes;
159
+ added = this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].changes;
160
160
  added.uniqueID = getUid(this.parent.element.id + '_data_');
161
161
  setValue('uniqueIDCollection.' + added.uniqueID, added, this.parent);
162
162
  if (!Object.prototype.hasOwnProperty.call(added, 'level')) {
@@ -173,7 +173,7 @@ var BatchEdit = /** @class */ (function () {
173
173
  var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;
174
174
  var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];
175
175
  record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;
176
- currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);
176
+ currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]);
177
177
  if (this.isSelfReference) {
178
178
  added[this.parent.parentIdMapping] = idMapping;
179
179
  }
@@ -182,7 +182,7 @@ var BatchEdit = /** @class */ (function () {
182
182
  }
183
183
  else if ((this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below')
184
184
  && !isNullOrUndefined(this.batchRecords[this.addRowIndex])) {
185
- added.level = this.batchRecords[this.addRowIndex][level];
185
+ added.level = this.batchRecords[parseInt(this.addRowIndex.toString(), 10)]["" + level];
186
186
  if (added.level && this.selectedIndex > -1) {
187
187
  added.parentItem = parentRecord;
188
188
  added.parentUniqueID = parentUniqueID;
@@ -194,11 +194,11 @@ var BatchEdit = /** @class */ (function () {
194
194
  var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;
195
195
  var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];
196
196
  record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;
197
- currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);
197
+ currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]);
198
198
  }
199
199
  if (this.parent.editSettings.newRowPosition === 'Above' && this.selectedIndex > -1) {
200
200
  var record = this.batchRecords[this.addRowIndex];
201
- currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);
201
+ currentDataIndex = data.map(function (e) { return e["" + primaryKey_1]; }).indexOf(record["" + primaryKey_1]);
202
202
  }
203
203
  if (this.isSelfReference) {
204
204
  added[this.parent.parentIdMapping] = parentIdMapping;
@@ -221,26 +221,28 @@ var BatchEdit = /** @class */ (function () {
221
221
  data.splice(indexvalue, 0, added);
222
222
  this.batchAddedRecords.push(added);
223
223
  }
224
- this.parent.grid.getRowsObject()[rowObjectIndex].data = added;
224
+ this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].data = added;
225
225
  this.newBatchRowAdded = false;
226
226
  }
227
227
  if (this.parent.frozenColumns || this.parent.getFrozenColumns()
228
- && this.parent.grid.getRowsObject()[rowObjectIndex].edit === 'add') {
229
- merge(this.currentViewRecords[rowObjectIndex], this.parent.grid.getRowsObject()[rowObjectIndex].changes);
228
+ && this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].edit === 'add') {
229
+ merge(this.currentViewRecords[parseInt(rowObjectIndex.toString(), 10)], this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].changes);
230
230
  }
231
231
  }
232
232
  };
233
233
  BatchEdit.prototype.beforeBatchAdd = function (e) {
234
234
  var isTabLastRow = 'isTabLastRow';
235
- if (this.parent.editSettings.mode === 'Cell' && this.parent.editModule[isTabLastRow]) {
235
+ if (this.parent.editSettings.mode === 'Cell' && this.parent.editModule["" + isTabLastRow]) {
236
236
  e.cancel = true;
237
- this.parent.editModule[isTabLastRow] = false;
237
+ this.parent.editModule["" + isTabLastRow] = false;
238
238
  return;
239
239
  }
240
- if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && this.parent.grid.selectedRowIndex === -1) {
240
+ if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) &&
241
+ !this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.grid.selectedRowIndex === -1 || this.parent.editModule['batchEditModule'].isAdd)) {
241
242
  this.selectedIndex = this.parent.editModule['selectedIndex'];
242
243
  this.addRowIndex = this.parent.editModule['addRowIndex'];
243
- this.addRowRecord = this.parent.getCurrentViewRecords()[this.selectedIndex];
244
+ this.addRowRecord = this.batchRecords.length ? this.batchRecords[this.selectedIndex]
245
+ : this.parent.getCurrentViewRecords()[this.selectedIndex];
244
246
  }
245
247
  else {
246
248
  this.selectedIndex = this.parent.grid.selectedRowIndex;
@@ -287,6 +289,11 @@ var BatchEdit = /** @class */ (function () {
287
289
  // }
288
290
  }
289
291
  focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
292
+ if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
293
+ var newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];
294
+ var index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('data-rowindex'), 10);
295
+ this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);
296
+ }
290
297
  }
291
298
  };
292
299
  BatchEdit.prototype.beforeBatchDelete = function (args) {
@@ -312,14 +319,14 @@ var BatchEdit = /** @class */ (function () {
312
319
  childs = findChildrenRecords(data);
313
320
  uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
314
321
  }
315
- var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);
322
+ var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('data-rowindex'), 10);
316
323
  if (childs.length) {
317
324
  var totalCount = parentRowIndex + childs.length;
318
325
  var firstChildIndex = parentRowIndex + 1;
319
326
  for (var i = firstChildIndex; i <= totalCount; i++) {
320
- row.push(this.parent.grid.getDataRows()[i]);
327
+ row.push(this.parent.grid.getDataRows()[parseInt(i.toString(), 10)]);
321
328
  if (this.parent.frozenRows || this.parent.frozenColumns || this.parent.getFrozenColumns()) {
322
- row.push(this.parent.grid.getMovableRows()[i]);
329
+ row.push(this.parent.grid.getMovableRows()[parseInt(i.toString(), 10)]);
323
330
  }
324
331
  }
325
332
  }
@@ -335,21 +342,21 @@ var BatchEdit = /** @class */ (function () {
335
342
  childs.push(data);
336
343
  records = childs;
337
344
  for (var i = 0; i < records.length; i++) {
338
- var indexvalue = this.batchRecords.map(function (e) { return e[primarykey]; }).indexOf(records[i][primarykey]);
345
+ var indexvalue = this.batchRecords.map(function (e) { return e["" + primarykey]; }).indexOf(records[parseInt(i.toString(), 10)]["" + primarykey]);
339
346
  if (indexvalue !== -1) {
340
347
  this.batchRecords.splice(indexvalue, 1);
341
348
  }
342
349
  }
343
350
  for (var i = 0; i < row.length; i++) {
344
- if (!isNullOrUndefined(row[i])) {
345
- this.parent.grid.selectionModule.selectedRecords.push(row[i]);
351
+ if (!isNullOrUndefined(row[parseInt(i.toString(), 10)])) {
352
+ this.parent.grid.selectionModule.selectedRecords.push(row[parseInt(i.toString(), 10)]);
346
353
  }
347
354
  }
348
355
  };
349
356
  BatchEdit.prototype.updateRowIndex = function () {
350
357
  var rows = this.parent.grid.getDataRows();
351
358
  for (var i = 0; i < rows.length; i++) {
352
- rows[i].setAttribute('aria-rowindex', i.toString());
359
+ rows[parseInt(i.toString(), 10)].setAttribute('data-rowindex', i.toString());
353
360
  }
354
361
  var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
355
362
  this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
@@ -357,9 +364,9 @@ var BatchEdit = /** @class */ (function () {
357
364
  var mRows = this.parent.grid.getMovableDataRows();
358
365
  var freezeRightRows = this.parent.grid.getFrozenRightDataRows();
359
366
  for (var i = 0; i < mRows.length; i++) {
360
- mRows[i].setAttribute('aria-rowindex', i.toString());
367
+ mRows[parseInt(i.toString(), 10)].setAttribute('data-rowindex', i.toString());
361
368
  if (freeze) {
362
- freezeRightRows[i].setAttribute('aria-rowindex', i.toString());
369
+ freezeRightRows[parseInt(i.toString(), 10)].setAttribute('data-rowindex', i.toString());
363
370
  }
364
371
  }
365
372
  }
@@ -368,9 +375,9 @@ var BatchEdit = /** @class */ (function () {
368
375
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
369
376
  var addedRecords = 'addedRecords';
370
377
  var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
371
- for (var i = 0; i < this.parent.getBatchChanges()[addedRecords].length; i++) {
372
- if (!isNullOrUndefined(this.parent.getBatchChanges()[addedRecords][i][parentItem])) {
373
- if (this.parent.getBatchChanges()[addedRecords][i][parentItem][primaryKey] === records[this.addRowIndex][primaryKey]) {
378
+ for (var i = 0; i < this.parent.getBatchChanges()["" + addedRecords].length; i++) {
379
+ if (!isNullOrUndefined(this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem])) {
380
+ if (this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
374
381
  this.batchChildCount = this.batchChildCount + 1;
375
382
  }
376
383
  }
@@ -379,32 +386,32 @@ var BatchEdit = /** @class */ (function () {
379
386
  BatchEdit.prototype.beforeBatchSave = function (e) {
380
387
  var changeRecords = 'changedRecords';
381
388
  var deleterecords = 'deletedRecords';
382
- var changedRecords = e.batchChanges[changeRecords];
383
- if (e.batchChanges[changeRecords].length) {
389
+ var changedRecords = e.batchChanges["" + changeRecords];
390
+ if (e.batchChanges["" + changeRecords].length) {
384
391
  var columnName = void 0;
385
392
  for (var i = 0; i < changedRecords.length; i++) {
386
- editAction({ value: changedRecords[i], action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName);
393
+ editAction({ value: changedRecords[parseInt(i.toString(), 10)], action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName);
387
394
  }
388
395
  }
389
- if (e.batchChanges[deleterecords].length) {
390
- var deletedRecords = e.batchChanges[deleterecords];
396
+ if (e.batchChanges["" + deleterecords].length) {
397
+ var deletedRecords = e.batchChanges["" + deleterecords];
391
398
  var record = deletedRecords;
392
399
  for (var i = 0; i < record.length; i++) {
393
- this.deleteUniqueID(record[i].uniqueID);
394
- var childs = findChildrenRecords(record[i]);
400
+ this.deleteUniqueID(record[parseInt(i.toString(), 10)].uniqueID);
401
+ var childs = findChildrenRecords(record[parseInt(i.toString(), 10)]);
395
402
  for (var c = 0; c < childs.length; c++) {
396
- this.deleteUniqueID(childs[c].uniqueID);
403
+ this.deleteUniqueID(childs[parseInt(c.toString(), 10)].uniqueID);
397
404
  }
398
- e.batchChanges[deleterecords] = e.batchChanges[deleterecords].concat(childs);
405
+ e.batchChanges["" + deleterecords] = e.batchChanges["" + deleterecords].concat(childs);
399
406
  }
400
407
  }
401
408
  this.isAdd = false;
402
409
  };
403
410
  BatchEdit.prototype.deleteUniqueID = function (value) {
404
411
  var idFilter = 'uniqueIDFilterCollection';
405
- delete this.parent[idFilter][value];
412
+ delete this.parent["" + idFilter]["" + value];
406
413
  var id = 'uniqueIDCollection';
407
- delete this.parent[id][value];
414
+ delete this.parent["" + id]["" + value];
408
415
  };
409
416
  BatchEdit.prototype.batchCancelAction = function () {
410
417
  var targetElement = 'targetElement';
@@ -418,37 +425,39 @@ var BatchEdit = /** @class */ (function () {
418
425
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
419
426
  if (!isNullOrUndefined(this.batchAddedRecords)) {
420
427
  for (var i = 0; i < this.batchAddedRecords.length; i++) {
421
- index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
422
- data.splice(index, 1);
428
+ index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
429
+ if (index !== -1) {
430
+ data.splice(index, 1);
431
+ }
423
432
  if (this.parent.editSettings.newRowPosition === 'Child') {
424
- index = currentViewRecords.map(function (e) { return e[primaryKey]; })
425
- .indexOf(this.batchAddedRecords[i][parentItem] ? this.batchAddedRecords[i][parentItem][primaryKey]
426
- : this.batchAddedRecords[i][primaryKey]);
427
- if (!isNullOrUndefined(currentViewRecords[index])) {
428
- var children = currentViewRecords[index][childRecords];
433
+ index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
434
+ .indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
435
+ : this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
436
+ if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
437
+ var children = currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords];
429
438
  for (var j = 0; children && j < children.length; j++) {
430
- if (children[j][primaryKey] === this.batchAddedRecords[i][primaryKey]) {
431
- currentViewRecords[index][childRecords].splice(j, 1);
439
+ if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
440
+ currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords].splice(j, 1);
432
441
  }
433
442
  }
434
443
  }
435
444
  }
436
445
  }
437
446
  }
438
- if (!isNullOrUndefined(this.parent[targetElement])) {
439
- var row = this.parent[targetElement].closest('tr');
447
+ if (!isNullOrUndefined(this.parent["" + targetElement])) {
448
+ var row = this.parent["" + targetElement].closest('tr');
440
449
  this.parent.collapseRow(row);
441
- this.parent[targetElement] = null;
450
+ this.parent["" + targetElement] = null;
442
451
  }
443
452
  if (!isNullOrUndefined(this.batchDeletedRecords)) {
444
453
  for (var i = 0; i < this.batchDeletedRecords.length; i++) {
445
- if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
446
- index = currentViewRecords.map(function (e) { return e[primaryKey]; })
447
- .indexOf(this.batchDeletedRecords[i][parentItem][primaryKey]);
448
- var positionIndex = this.batchDeletedRecords[i][indexvalue] === 0 ? this.batchDeletedRecords[i][indexvalue] :
449
- this.batchDeletedRecords[i][indexvalue] - 1;
450
- if (!isNullOrUndefined(currentViewRecords[index])) {
451
- currentViewRecords[index][childRecords].splice(positionIndex, 0, this.batchDeletedRecords[i]);
454
+ if (!isNullOrUndefined(this.batchDeletedRecords[parseInt(i.toString(), 10)]["" + parentItem])) {
455
+ index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
456
+ .indexOf(this.batchDeletedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]);
457
+ var positionIndex = this.batchDeletedRecords[parseInt(i.toString(), 10)]["" + indexvalue] === 0 ? this.batchDeletedRecords[parseInt(i.toString(), 10)]["" + indexvalue] :
458
+ this.batchDeletedRecords[parseInt(i.toString(), 10)]["" + indexvalue] - 1;
459
+ if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
460
+ currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords].splice(positionIndex, 0, this.batchDeletedRecords[parseInt(i.toString(), 10)]);
452
461
  }
453
462
  }
454
463
  }
@@ -473,7 +482,7 @@ var BatchEdit = /** @class */ (function () {
473
482
  var currentViewRecords = this.parent.grid.getCurrentViewRecords();
474
483
  var primarykey_1 = this.parent.grid.getPrimaryKeyFieldNames()[0];
475
484
  var level = 'level';
476
- var addRecords = batchChanges[addedRecords];
485
+ var addRecords = batchChanges["" + addedRecords];
477
486
  var parentItem = 'parentItem';
478
487
  var selectedIndex = void 0;
479
488
  var addRowIndex = void 0;
@@ -485,9 +494,12 @@ var BatchEdit = /** @class */ (function () {
485
494
  }
486
495
  if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {
487
496
  data.splice(data.length - addRecords.length, addRecords.length);
488
- if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {
489
- var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].getAttribute('aria-rowindex'), 10);
490
- data.splice(index_1, 0, addRecords[0]);
497
+ if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
498
+ addRecords.reverse();
499
+ for (var i_1 = 0; i_1 < addRecords.length; i_1++) {
500
+ var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i_1.toString(), 10)].getAttribute('data-rowindex'), 10);
501
+ data.splice(index_1, 0, addRecords[parseInt(i_1.toString(), 10)]);
502
+ }
491
503
  }
492
504
  if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {
493
505
  if (currentViewRecords.length > addRecords.length) {
@@ -497,8 +509,8 @@ var BatchEdit = /** @class */ (function () {
497
509
  else {
498
510
  var totalRecords = extendArray(data);
499
511
  if (totalRecords.length) {
500
- var startIndex = totalRecords.map(function (e) { return e[primarykey_1]; })
501
- .indexOf(currentViewRecords[0][primarykey_1]);
512
+ var startIndex = totalRecords.map(function (e) { return e["" + primarykey_1]; })
513
+ .indexOf(currentViewRecords[0]["" + primarykey_1]);
502
514
  var endIndex = startIndex + this.parent.grid.pageSettings.pageSize;
503
515
  currentViewRecords = totalRecords.splice(startIndex, endIndex);
504
516
  }
@@ -507,8 +519,11 @@ var BatchEdit = /** @class */ (function () {
507
519
  if (this.batchAddRowRecord.length === 0) {
508
520
  this.batchAddRowRecord.push(this.parent.flatData[args.index]);
509
521
  }
522
+ if (this.parent.editModule['isAddedRowByContextMenu']) {
523
+ addRecords.reverse();
524
+ }
510
525
  for (i = 0; i < addRecords.length; i++) {
511
- var taskData = extend({}, addRecords[i]);
526
+ var taskData = extend({}, addRecords[parseInt(i.toString(), 10)]);
512
527
  delete taskData.parentItem;
513
528
  delete taskData.uniqueID;
514
529
  delete taskData.index;
@@ -519,54 +534,62 @@ var BatchEdit = /** @class */ (function () {
519
534
  if (!isNullOrUndefined(taskData.primaryParent)) {
520
535
  delete taskData.primaryParent;
521
536
  }
522
- addRecords[i].taskData = taskData;
523
- addRowRecord = this.batchAddRowRecord[i];
537
+ if (addRecords.length > 1 && this.parent.editModule['isAddedRowByContextMenu']) {
538
+ var rowPosition = this.parent.editSettings.newRowPosition;
539
+ this.parent.editSettings.newRowPosition = this.parent.editModule['previousNewRowPosition'];
540
+ this.parent.editModule['previousNewRowPosition'] = rowPosition;
541
+ }
542
+ addRecords[parseInt(i.toString(), 10)].taskData = taskData;
543
+ addRowRecord = this.batchAddRowRecord[parseInt(i.toString(), 10)];
524
544
  if (isNullOrUndefined(addRowRecord)) {
525
545
  addRowRecord = this.batchAddRowRecord[i - 1];
526
546
  }
527
547
  if (this.isSelfReference) {
528
- if (!isNullOrUndefined(addRecords[i].parentItem)) {
529
- updateParentRow(primarykey_1, addRecords[i].parentItem, 'add', this.parent, this.isSelfReference, addRecords[i]);
548
+ if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {
549
+ updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);
530
550
  }
531
551
  }
532
552
  if (!isNullOrUndefined(addRowRecord)) {
533
553
  addRowIndex = addRowRecord.index;
534
554
  }
535
555
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
536
- if (isNullOrUndefined(addRecords[i].parentItem) && this.selectedIndex === -1) {
556
+ if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
537
557
  selectedIndex = -1;
538
558
  addRowRecord = null;
539
559
  }
540
560
  }
541
- editAction({ value: addRecords[i], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
561
+ editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
542
562
  selectedIndex = null;
543
- if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[i][parentItem]) &&
563
+ if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)]["" + parentItem]) &&
544
564
  (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
545
- var indexValue = currentViewRecords.map(function (e) { return e[primarykey_1]; })
546
- .indexOf(addRecords[i][parentItem][primarykey_1]);
547
- var children = currentViewRecords[indexValue][childRecords];
565
+ var indexValue = currentViewRecords.map(function (e) { return e["" + primarykey_1]; })
566
+ .indexOf(addRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primarykey_1]);
567
+ var children = currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords];
548
568
  for (var j = 0; j < children.length; j++) {
549
- if (children[j][primarykey_1] === addRecords[i][primarykey_1]) {
550
- currentViewRecords[indexValue][childRecords].splice(j, 1);
569
+ if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
570
+ currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
551
571
  }
552
572
  }
553
573
  }
554
574
  }
555
- if (batchChanges[deletedRecords].length) {
556
- for (i = 0; i < batchChanges[deletedRecords].length; i++) {
557
- editAction({ value: batchChanges[deletedRecords][i], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
575
+ if (batchChanges["" + deletedRecords].length) {
576
+ for (i = 0; i < batchChanges["" + deletedRecords].length; i++) {
577
+ editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
558
578
  }
559
579
  }
560
580
  this.parent.parentData = [];
561
- for (var i_1 = 0; i_1 < data.length; i_1++) {
562
- data[i_1][index] = i_1;
563
- setValue('uniqueIDCollection.' + data[i_1][uniqueID] + '.index', i_1, this.parent);
564
- if (!data[i_1][level]) {
565
- this.parent.parentData.push(data[i_1]);
581
+ for (var i_2 = 0; i_2 < data.length; i_2++) {
582
+ data[parseInt(i_2.toString(), 10)]["" + index] = i_2;
583
+ setValue('uniqueIDCollection.' + data[parseInt(i_2.toString(), 10)]["" + uniqueID] + '.index', i_2, this.parent);
584
+ if (!data[parseInt(i_2.toString(), 10)]["" + level]) {
585
+ this.parent.parentData.push(data[parseInt(i_2.toString(), 10)]);
566
586
  }
567
587
  }
568
588
  }
569
589
  this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];
590
+ if (this.parent.editModule['isAddedRowByContextMenu']) {
591
+ this.parent.editModule['isAddedRowByContextMenu'] = false;
592
+ }
570
593
  };
571
594
  BatchEdit.prototype.getActualRowObjectIndex = function (index) {
572
595
  var rows = this.parent.grid.getDataRows();
@@ -605,13 +628,18 @@ var BatchEdit = /** @class */ (function () {
605
628
  addedRecords = changes.addedRecords;
606
629
  }
607
630
  for (var i = 0; i < addedRecords.length; i++) {
608
- e.rows.splice(addedRecords[i][index], 1);
631
+ e.rows.splice(addedRecords[parseInt(i.toString(), 10)]["" + index], 1);
609
632
  }
610
633
  };
611
634
  BatchEdit.prototype.nextCellIndex = function (args) {
612
635
  var index = 'index';
613
636
  var rowIndex = 'rowIndex';
614
- args[index] = this.parent.getSelectedRows()[0][rowIndex];
637
+ if (this.parent.getSelectedRows().length) {
638
+ args["" + index] = this.parent.getSelectedRows()[0]["" + rowIndex];
639
+ }
640
+ else {
641
+ args["" + index] = this.batchIndex;
642
+ }
615
643
  };
616
644
  return BatchEdit;
617
645
  }());
@@ -2,7 +2,7 @@
2
2
  * clipboard.ts file
3
3
  */
4
4
  import { TreeGrid } from '../base/treegrid';
5
- import { Clipboard as GridClipboard } from '@syncfusion/ej2-grids';
5
+ import { Clipboard as GridClipboard, ServiceLocator } from '@syncfusion/ej2-grids';
6
6
  /**
7
7
  * The `Clipboard` module is used to handle clipboard copy action.
8
8
  *
@@ -12,7 +12,8 @@ export declare class TreeClipboard extends GridClipboard {
12
12
  private treeGridParent;
13
13
  private treeCopyContent;
14
14
  private copiedUniqueIdCollection;
15
- constructor(parent?: TreeGrid);
15
+ protected serviceLocator: ServiceLocator;
16
+ constructor(parent?: TreeGrid, serviceLocator?: ServiceLocator);
16
17
  protected setCopyData(withHeader?: boolean): void;
17
18
  private parentContentData;
18
19
  copy(withHeader?: boolean): void;
@@ -21,11 +21,12 @@ import { Clipboard as GridClipboard } from '@syncfusion/ej2-grids';
21
21
  */
22
22
  var TreeClipboard = /** @class */ (function (_super) {
23
23
  __extends(TreeClipboard, _super);
24
- function TreeClipboard(parent) {
25
- var _this = _super.call(this, parent.grid) || this;
24
+ function TreeClipboard(parent, serviceLocator) {
25
+ var _this = _super.call(this, parent.grid, serviceLocator) || this;
26
26
  _this.treeCopyContent = '';
27
27
  _this.copiedUniqueIdCollection = [];
28
28
  _this.treeGridParent = parent;
29
+ _this.serviceLocator = serviceLocator;
29
30
  return _this;
30
31
  }
31
32
  TreeClipboard.prototype.setCopyData = function (withHeader) {
@@ -35,7 +36,7 @@ var TreeClipboard = /** @class */ (function (_super) {
35
36
  var uniqueID = 'uniqueID';
36
37
  var currentRecords = this.treeGridParent.getCurrentViewRecords();
37
38
  if (window.getSelection().toString() === '') {
38
- this.clipBoardTextArea.value = this[copyContent] = '';
39
+ this.clipBoardTextArea.value = this["" + copyContent] = '';
39
40
  var rows = this.treeGridParent.grid.getRows();
40
41
  if (this.treeGridParent.selectionSettings.mode !== 'Cell') {
41
42
  var selectedIndexes = this.treeGridParent.getSelectedRowIndexes().sort(function (a, b) {
@@ -45,19 +46,19 @@ var TreeClipboard = /** @class */ (function (_super) {
45
46
  if (i > 0) {
46
47
  this.treeCopyContent += '\n';
47
48
  }
48
- if (!rows[selectedIndexes[i]].classList.contains('e-summaryrow')) {
49
- var cells = [].slice.call(rows[selectedIndexes[i]].querySelectorAll('.e-rowcell'));
50
- var uniqueid = this.treeGridParent.getSelectedRecords()[i][uniqueID];
49
+ if (!rows[selectedIndexes[parseInt(i.toString(), 10)]].classList.contains('e-summaryrow')) {
50
+ var cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell'));
51
+ var uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)]["" + uniqueID];
51
52
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
52
53
  if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
53
- this.parentContentData(currentRecords, selectedIndexes[i], rows, withHeader, i);
54
+ this.parentContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], rows, withHeader, i);
54
55
  }
55
- this[getCopyData](cells, false, '\t', withHeader);
56
- this.treeCopyContent += this[copyContent];
56
+ this["" + getCopyData](cells, false, '\t', withHeader);
57
+ this.treeCopyContent += this["" + copyContent];
57
58
  this.copiedUniqueIdCollection.push(uniqueid);
58
- this[copyContent] = '';
59
+ this["" + copyContent] = '';
59
60
  if (this.treeGridParent.copyHierarchyMode === 'Child' || this.treeGridParent.copyHierarchyMode === 'Both') {
60
- this.childContentData(currentRecords, selectedIndexes[i], rows, withHeader);
61
+ this.childContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], rows, withHeader);
61
62
  }
62
63
  }
63
64
  }
@@ -65,10 +66,11 @@ var TreeClipboard = /** @class */ (function (_super) {
65
66
  if (withHeader) {
66
67
  var headerTextArray = [];
67
68
  for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {
68
- headerTextArray[i] = this.treeGridParent.getVisibleColumns()[i].headerText;
69
+ headerTextArray[parseInt(i.toString(), 10)] =
70
+ this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].headerText;
69
71
  }
70
- this[getCopyData](headerTextArray, false, '\t', withHeader);
71
- this.treeCopyContent = this[copyContent] + '\n' + this.treeCopyContent;
72
+ this["" + getCopyData](headerTextArray, false, '\t', withHeader);
73
+ this.treeCopyContent = this["" + copyContent] + '\n' + this.treeCopyContent;
72
74
  }
73
75
  var args = {
74
76
  data: this.treeCopyContent,
@@ -78,14 +80,14 @@ var TreeClipboard = /** @class */ (function (_super) {
78
80
  if (args.cancel) {
79
81
  return;
80
82
  }
81
- this.clipBoardTextArea.value = this[copyContent] = args.data;
83
+ this.clipBoardTextArea.value = this["" + copyContent] = args.data;
82
84
  if (!Browser.userAgent.match(/ipad|ipod|iphone/i)) {
83
85
  this.clipBoardTextArea.select();
84
86
  }
85
87
  else {
86
88
  this.clipBoardTextArea.setSelectionRange(0, this.clipBoardTextArea.value.length);
87
89
  }
88
- this[isSelect] = true;
90
+ this["" + isSelect] = true;
89
91
  this.copiedUniqueIdCollection = [];
90
92
  this.treeCopyContent = '';
91
93
  }
@@ -100,25 +102,25 @@ var TreeClipboard = /** @class */ (function (_super) {
100
102
  var parentItem = 'parentItem';
101
103
  var uniqueID = 'uniqueID';
102
104
  var level = 'level';
103
- if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem])) {
104
- var treeLevel = currentRecords[selectedIndex][parentItem][level];
105
+ if (!isNullOrUndefined(currentRecords[parseInt(selectedIndex.toString(), 10)]["" + parentItem])) {
106
+ var treeLevel = currentRecords[parseInt(selectedIndex.toString(), 10)]["" + parentItem]["" + level];
105
107
  for (var i = 0; i < treeLevel + 1; i++) {
106
108
  for (var j = 0; j < currentRecords.length; j++) {
107
- if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem]) &&
108
- currentRecords[j][uniqueID] === currentRecords[selectedIndex][parentItem][uniqueID]) {
109
+ if (!isNullOrUndefined(currentRecords[parseInt(selectedIndex.toString(), 10)]["" + parentItem]) &&
110
+ currentRecords[parseInt(j.toString(), 10)]["" + uniqueID] === currentRecords[parseInt(selectedIndex.toString(), 10)]["" + parentItem]["" + uniqueID]) {
109
111
  selectedIndex = j;
110
- var cells = [].slice.call(rows[selectedIndex].querySelectorAll('.e-rowcell'));
111
- var uniqueid = currentRecords[j][uniqueID];
112
+ var cells = [].slice.call(rows[parseInt(selectedIndex.toString(), 10)].querySelectorAll('.e-rowcell'));
113
+ var uniqueid = currentRecords[parseInt(j.toString(), 10)]["" + uniqueID];
112
114
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
113
- this[getCopyData](cells, false, '\t', withHeader);
115
+ this["" + getCopyData](cells, false, '\t', withHeader);
114
116
  if (index > 0) {
115
- this.treeCopyContent = this.treeCopyContent + this[copyContent] + '\n';
117
+ this.treeCopyContent = this.treeCopyContent + this["" + copyContent] + '\n';
116
118
  }
117
119
  else {
118
- this.treeCopyContent = this[copyContent] + '\n' + this.treeCopyContent;
120
+ this.treeCopyContent = this["" + copyContent] + '\n' + this.treeCopyContent;
119
121
  }
120
122
  this.copiedUniqueIdCollection.push(uniqueid);
121
- this[copyContent] = '';
123
+ this["" + copyContent] = '';
122
124
  break;
123
125
  }
124
126
  }
@@ -156,18 +158,18 @@ var TreeClipboard = /** @class */ (function (_super) {
156
158
  var childRecords = 'childRecords';
157
159
  var hasChildRecords = 'hasChildRecords';
158
160
  var uniqueID = 'uniqueID';
159
- if (currentRecords[selectedIndex][hasChildRecords]) {
160
- var childData = currentRecords[selectedIndex][childRecords];
161
+ if (currentRecords[parseInt(selectedIndex.toString(), 10)]["" + hasChildRecords]) {
162
+ var childData = currentRecords[parseInt(selectedIndex.toString(), 10)]["" + childRecords];
161
163
  for (var i = 0; i < childData.length; i++) {
162
164
  for (var j = 0; j < currentRecords.length; j++) {
163
- if (!isNullOrUndefined(childData[i][uniqueID]) && currentRecords[j][uniqueID] === childData[i][uniqueID]) {
164
- if ((!isNullOrUndefined(rows[j])) && !rows[j].classList.contains('e-summaryrow')) {
165
- var cells = [].slice.call(rows[j].querySelectorAll('.e-rowcell'));
166
- var uniqueid = currentRecords[j][uniqueID];
165
+ if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)]["" + uniqueID]) && currentRecords[parseInt(j.toString(), 10)]["" + uniqueID] === childData[parseInt(i.toString(), 10)]["" + uniqueID]) {
166
+ if ((!isNullOrUndefined(rows[parseInt(j.toString(), 10)])) && !rows[parseInt(j.toString(), 10)].classList.contains('e-summaryrow')) {
167
+ var cells = [].slice.call(rows[parseInt(j.toString(), 10)].querySelectorAll('.e-rowcell'));
168
+ var uniqueid = currentRecords[parseInt(j.toString(), 10)]["" + uniqueID];
167
169
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
168
- this[getCopyData](cells, false, '\t', withHeader);
169
- this.treeCopyContent += ('\n' + this[copyContent]);
170
- this[copyContent] = '';
170
+ this["" + getCopyData](cells, false, '\t', withHeader);
171
+ this.treeCopyContent += ('\n' + this["" + copyContent]);
172
+ this["" + copyContent] = '';
171
173
  this.copiedUniqueIdCollection.push(uniqueid);
172
174
  this.childContentData(currentRecords, j, rows, withHeader);
173
175
  }