@syncfusion/ej2-treegrid 29.2.8 → 30.1.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.
Files changed (96) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +254 -140
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +314 -169
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +5 -5
  13. package/src/treegrid/actions/batch-edit.d.ts +1 -0
  14. package/src/treegrid/actions/batch-edit.js +57 -29
  15. package/src/treegrid/actions/clipboard.js +5 -8
  16. package/src/treegrid/actions/crud-actions.js +3 -1
  17. package/src/treegrid/actions/detail-row.js +7 -8
  18. package/src/treegrid/actions/edit.d.ts +1 -0
  19. package/src/treegrid/actions/edit.js +26 -11
  20. package/src/treegrid/actions/filter.js +2 -5
  21. package/src/treegrid/actions/rowdragdrop.js +7 -13
  22. package/src/treegrid/actions/selection.js +7 -0
  23. package/src/treegrid/actions/summary.js +2 -16
  24. package/src/treegrid/actions/toolbar.js +2 -2
  25. package/src/treegrid/base/data.js +34 -14
  26. package/src/treegrid/base/treegrid-model.d.ts +7 -0
  27. package/src/treegrid/base/treegrid.d.ts +7 -0
  28. package/src/treegrid/base/treegrid.js +86 -52
  29. package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
  30. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
  31. package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
  32. package/styles/bds-lite.css +30 -0
  33. package/styles/bds.css +30 -0
  34. package/styles/bootstrap-dark-lite.css +30 -0
  35. package/styles/bootstrap-dark.css +30 -0
  36. package/styles/bootstrap-lite.css +30 -0
  37. package/styles/bootstrap.css +30 -0
  38. package/styles/bootstrap4-lite.css +30 -0
  39. package/styles/bootstrap4.css +30 -0
  40. package/styles/bootstrap5-dark-lite.css +30 -0
  41. package/styles/bootstrap5-dark.css +30 -0
  42. package/styles/bootstrap5-lite.css +30 -0
  43. package/styles/bootstrap5.3-lite.css +30 -0
  44. package/styles/bootstrap5.3.css +30 -0
  45. package/styles/bootstrap5.css +30 -0
  46. package/styles/fabric-dark-lite.css +30 -0
  47. package/styles/fabric-dark.css +30 -0
  48. package/styles/fabric-lite.css +30 -0
  49. package/styles/fabric.css +30 -0
  50. package/styles/fluent-dark-lite.css +30 -0
  51. package/styles/fluent-dark.css +30 -0
  52. package/styles/fluent-lite.css +30 -0
  53. package/styles/fluent.css +30 -0
  54. package/styles/fluent2-lite.css +30 -0
  55. package/styles/fluent2.css +30 -3
  56. package/styles/highcontrast-light-lite.css +30 -0
  57. package/styles/highcontrast-light.css +30 -0
  58. package/styles/highcontrast-lite.css +30 -0
  59. package/styles/highcontrast.css +30 -0
  60. package/styles/material-dark-lite.css +30 -0
  61. package/styles/material-dark.css +30 -0
  62. package/styles/material-lite.css +30 -0
  63. package/styles/material.css +30 -0
  64. package/styles/material3-dark-lite.css +30 -0
  65. package/styles/material3-dark.css +30 -0
  66. package/styles/material3-lite.css +30 -0
  67. package/styles/material3.css +30 -0
  68. package/styles/tailwind-dark-lite.css +30 -0
  69. package/styles/tailwind-dark.css +30 -0
  70. package/styles/tailwind-lite.css +30 -0
  71. package/styles/tailwind.css +30 -0
  72. package/styles/tailwind3-lite.css +30 -0
  73. package/styles/tailwind3.css +30 -0
  74. package/styles/treegrid/_bigger.scss +66 -66
  75. package/styles/treegrid/_layout.scss +39 -0
  76. package/styles/treegrid/bds.css +30 -0
  77. package/styles/treegrid/bootstrap-dark.css +30 -0
  78. package/styles/treegrid/bootstrap.css +30 -0
  79. package/styles/treegrid/bootstrap4.css +30 -0
  80. package/styles/treegrid/bootstrap5-dark.css +30 -0
  81. package/styles/treegrid/bootstrap5.3.css +30 -0
  82. package/styles/treegrid/bootstrap5.css +30 -0
  83. package/styles/treegrid/fabric-dark.css +30 -0
  84. package/styles/treegrid/fabric.css +30 -0
  85. package/styles/treegrid/fluent-dark.css +30 -0
  86. package/styles/treegrid/fluent.css +30 -0
  87. package/styles/treegrid/fluent2.css +30 -3
  88. package/styles/treegrid/highcontrast-light.css +30 -0
  89. package/styles/treegrid/highcontrast.css +30 -0
  90. package/styles/treegrid/material-dark.css +30 -0
  91. package/styles/treegrid/material.css +30 -0
  92. package/styles/treegrid/material3-dark.css +30 -0
  93. package/styles/treegrid/material3.css +30 -0
  94. package/styles/treegrid/tailwind-dark.css +30 -0
  95. package/styles/treegrid/tailwind.css +30 -0
  96. package/styles/treegrid/tailwind3.css +30 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 29.2.8
3
+ * version : 30.1.38
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-treegrid",
3
- "version": "29.2.8",
3
+ "version": "30.1.38",
4
4
  "description": "Essential JS 2 TreeGrid Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,10 +8,10 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-treegrid.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~29.2.4",
12
- "@syncfusion/ej2-data": "~29.2.4",
13
- "@syncfusion/ej2-grids": "~29.2.8",
14
- "@syncfusion/ej2-popups": "~29.2.8"
11
+ "@syncfusion/ej2-base": "~30.1.38",
12
+ "@syncfusion/ej2-data": "~30.1.38",
13
+ "@syncfusion/ej2-grids": "~30.1.38",
14
+ "@syncfusion/ej2-popups": "~30.1.37"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -70,4 +70,5 @@ export declare class BatchEdit {
70
70
  private getActualRowObjectIndex;
71
71
  private immutableBatchAction;
72
72
  private nextCellIndex;
73
+ private onCellFocused;
73
74
  }
@@ -36,6 +36,7 @@ var BatchEdit = /** @class */ (function () {
36
36
  this.parent.on('batchCancelAction', this.batchCancelAction, this);
37
37
  this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);
38
38
  this.parent.grid.on('next-cell-index', this.nextCellIndex, this);
39
+ this.parent.grid.on('cellfocused', this.onCellFocused, this);
39
40
  };
40
41
  /**
41
42
  * @hidden
@@ -55,6 +56,7 @@ var BatchEdit = /** @class */ (function () {
55
56
  this.parent.off('batchCancelAction', this.batchCancelAction);
56
57
  this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);
57
58
  this.parent.grid.off('next-cell-index', this.nextCellIndex);
59
+ this.parent.grid.off('cellfocused', this.onCellFocused);
58
60
  };
59
61
  /**
60
62
  * To destroy the editModule
@@ -94,14 +96,18 @@ var BatchEdit = /** @class */ (function () {
94
96
  return this.batchChildCount;
95
97
  };
96
98
  BatchEdit.prototype.batchPageAction = function () {
99
+ var _this = this;
97
100
  var data = (this.parent.grid.dataSource instanceof DataManager ?
98
101
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
99
- var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
102
+ var primaryKeyField = this.parent.grid.getPrimaryKeyFieldNames()[0];
100
103
  var index;
101
104
  if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
102
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
103
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
105
+ var _loop_1 = function (i) {
106
+ index = data.findIndex(function (e) { return e["" + primaryKeyField] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]; });
104
107
  data.splice(index, 1);
108
+ };
109
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
110
+ _loop_1(i);
105
111
  }
106
112
  }
107
113
  this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
@@ -326,11 +332,15 @@ var BatchEdit = /** @class */ (function () {
326
332
  }
327
333
  childs.push(data);
328
334
  records = childs;
329
- for (var i = 0; i < records.length; i++) {
330
- var indexvalue = this.batchRecords.map(function (e) { return e["" + primarykey]; }).indexOf(records[parseInt(i.toString(), 10)]["" + primarykey]);
335
+ var _loop_2 = function (i) {
336
+ var indexvalue = this_1.batchRecords.findIndex(function (e) { return e["" + primarykey] === records[parseInt(i.toString(), 10)]["" + primarykey]; });
331
337
  if (indexvalue !== -1) {
332
- this.batchRecords.splice(indexvalue, 1);
338
+ this_1.batchRecords.splice(indexvalue, 1);
333
339
  }
340
+ };
341
+ var this_1 = this;
342
+ for (var i = 0; i < records.length; i++) {
343
+ _loop_2(i);
334
344
  }
335
345
  for (var i = 0; i < row.length; i++) {
336
346
  if (!isNullOrUndefined(row[parseInt(i.toString(), 10)])) {
@@ -346,11 +356,11 @@ var BatchEdit = /** @class */ (function () {
346
356
  };
347
357
  BatchEdit.prototype.updateChildCount = function (records) {
348
358
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
349
- var addedRecords = 'addedRecords';
359
+ var addedRecords = this.parent.getBatchChanges().addedRecords || [];
350
360
  var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
351
- for (var i = 0; i < this.parent.getBatchChanges()["" + addedRecords].length; i++) {
352
- if (!isNullOrUndefined(this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem])) {
353
- if (this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
361
+ for (var i = 0; i < addedRecords.length; i++) {
362
+ if (!isNullOrUndefined(addedRecords[parseInt(i.toString(), 10)]["" + parentItem])) {
363
+ if (addedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
354
364
  this.batchChildCount = this.batchChildCount + 1;
355
365
  }
356
366
  }
@@ -387,6 +397,7 @@ var BatchEdit = /** @class */ (function () {
387
397
  delete this.parent["" + id]["" + value];
388
398
  };
389
399
  BatchEdit.prototype.batchCancelAction = function () {
400
+ var _this = this;
390
401
  var targetElement = 'targetElement';
391
402
  var index;
392
403
  var parentItem = 'parentItem';
@@ -397,24 +408,28 @@ var BatchEdit = /** @class */ (function () {
397
408
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
398
409
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
399
410
  if (!isNullOrUndefined(this.batchAddedRecords)) {
400
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
401
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
411
+ var _loop_3 = function (i) {
412
+ index = data.findIndex(function (e) { return e["" + primaryKey] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]; });
402
413
  if (index !== -1) {
403
414
  data.splice(index, 1);
404
415
  }
405
- if (this.parent.editSettings.newRowPosition === 'Child') {
416
+ if (this_2.parent.editSettings.newRowPosition === 'Child') {
406
417
  index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
407
- .indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
408
- : this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
418
+ .indexOf(this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
419
+ : this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
409
420
  if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
410
421
  var children = currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords];
411
422
  for (var j = 0; children && j < children.length; j++) {
412
- if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
413
- currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords].splice(j, 1);
423
+ if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
424
+ children.splice(j, 1);
414
425
  }
415
426
  }
416
427
  }
417
428
  }
429
+ };
430
+ var this_2 = this;
431
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
432
+ _loop_3(i);
418
433
  }
419
434
  }
420
435
  if (!isNullOrUndefined(this.parent["" + targetElement])) {
@@ -460,7 +475,7 @@ var BatchEdit = /** @class */ (function () {
460
475
  var selectedIndex = void 0;
461
476
  var addRowIndex = void 0;
462
477
  var columnName = void 0;
463
- var addRowRecord = void 0;
478
+ var addRowRecord_1;
464
479
  var childRecords = 'childRecords';
465
480
  if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {
466
481
  addRecords.reverse();
@@ -513,17 +528,17 @@ var BatchEdit = /** @class */ (function () {
513
528
  this.parent.editModule['previousNewRowPosition'] = rowPosition;
514
529
  }
515
530
  addRecords[parseInt(i.toString(), 10)].taskData = taskData;
516
- addRowRecord = this.batchAddRowRecord[parseInt(i.toString(), 10)];
517
- if (isNullOrUndefined(addRowRecord)) {
518
- addRowRecord = this.batchAddRowRecord[i - 1];
531
+ addRowRecord_1 = this.batchAddRowRecord[parseInt(i.toString(), 10)];
532
+ if (isNullOrUndefined(addRowRecord_1)) {
533
+ addRowRecord_1 = this.batchAddRowRecord[i - 1];
519
534
  }
520
535
  if (this.isSelfReference) {
521
536
  if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {
522
537
  updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);
523
538
  }
524
539
  }
525
- if (!isNullOrUndefined(addRowRecord)) {
526
- addRowIndex = addRowRecord.index;
540
+ if (!isNullOrUndefined(addRowRecord_1)) {
541
+ addRowIndex = addRowRecord_1.index;
527
542
  }
528
543
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
529
544
  addRowIndex = 0;
@@ -531,26 +546,30 @@ var BatchEdit = /** @class */ (function () {
531
546
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
532
547
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
533
548
  selectedIndex = -1;
534
- addRowRecord = null;
549
+ addRowRecord_1 = null;
535
550
  }
536
551
  }
537
- editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
552
+ editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
538
553
  selectedIndex = null;
539
554
  if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)]["" + parentItem]) &&
540
555
  (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
541
556
  var indexValue = currentViewRecords.map(function (e) { return e["" + primarykey_1]; })
542
557
  .indexOf(addRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primarykey_1]);
543
558
  var children = currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords];
544
- for (var j = 0; j < children.length; j++) {
545
- if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
546
- currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
559
+ if (!isNullOrUndefined(addRowIndex) && children.some(function (records) {
560
+ return records.uniqueID === addRowRecord_1.uniqueID;
561
+ })) {
562
+ for (var j = 0; j < children.length; j++) {
563
+ if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
564
+ currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
565
+ }
547
566
  }
548
567
  }
549
568
  }
550
569
  }
551
570
  if (batchChanges["" + deletedRecords].length) {
552
571
  for (i = 0; i < batchChanges["" + deletedRecords].length; i++) {
553
- editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
572
+ editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
554
573
  }
555
574
  }
556
575
  this.parent.parentData = [];
@@ -624,6 +643,15 @@ var BatchEdit = /** @class */ (function () {
624
643
  args["" + index] = this.batchIndex;
625
644
  }
626
645
  };
646
+ BatchEdit.prototype.onCellFocused = function (e) {
647
+ if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.isEdit && e.keyArgs) {
648
+ if (e.keyArgs.action === 'shiftEnter') {
649
+ e.keyArgs.preventDefault();
650
+ this.parent.endEdit();
651
+ return;
652
+ }
653
+ }
654
+ };
627
655
  return BatchEdit;
628
656
  }());
629
657
  export { BatchEdit };
@@ -46,12 +46,13 @@ var TreeClipboard = /** @class */ (function (_super) {
46
46
  if (i > 0) {
47
47
  this.treeCopyContent += '\n';
48
48
  }
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'));
49
+ var selectedRowIndex = selectedIndexes[parseInt(i.toString(), 10)];
50
+ if (!rows[selectedRowIndex].classList.contains('e-summaryrow')) {
51
+ var cells = [].slice.call(rows[selectedRowIndex].querySelectorAll('.e-rowcell'));
51
52
  var uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)]["" + uniqueID];
52
53
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
53
54
  if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
54
- this.parentContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], rows, withHeader, i);
55
+ this.parentContentData(currentRecords, selectedRowIndex, rows, withHeader, i);
55
56
  }
56
57
  this["" + getCopyData](cells, false, '\t', withHeader);
57
58
  this.treeCopyContent += this["" + copyContent];
@@ -64,11 +65,7 @@ var TreeClipboard = /** @class */ (function (_super) {
64
65
  }
65
66
  }
66
67
  if (withHeader) {
67
- var headerTextArray = [];
68
- for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {
69
- headerTextArray[parseInt(i.toString(), 10)] =
70
- this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].headerText;
71
- }
68
+ var headerTextArray = this.treeGridParent.getVisibleColumns().map(function (col) { return col.headerText; });
72
69
  this["" + getCopyData](headerTextArray, false, '\t', withHeader);
73
70
  this.treeCopyContent = this["" + copyContent] + '\n' + this.treeCopyContent;
74
71
  }
@@ -349,7 +349,9 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
349
349
  }
350
350
  else {
351
351
  if (!isNullOrUndefined(child) && record["" + key] !== child["" + key]) {
352
- record.childRecords.push(child);
352
+ if (!record.childRecords.some(function (records) { return records.uniqueID === child.uniqueID; })) {
353
+ record.childRecords.push(child);
354
+ }
353
355
  }
354
356
  }
355
357
  if (record.childRecords.indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
@@ -53,12 +53,12 @@ var DetailRow = /** @class */ (function () {
53
53
  args["" + visible] = false;
54
54
  };
55
55
  DetailRow.prototype.dataBoundArg = function () {
56
- var detailele = this.parent.getRows().filter(function (e) {
56
+ var detailRows = this.parent.getRows().filter(function (e) {
57
57
  return !e.classList.contains('e-detailrow');
58
58
  });
59
- for (var i = 0; i < detailele.length; i++) {
60
- var elements = detailele[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
61
- var detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
59
+ for (var i = 0; i < detailRows.length; i++) {
60
+ var elements = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
61
+ var detailData = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
62
62
  var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
63
63
  if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
64
64
  getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
@@ -94,10 +94,9 @@ var DetailRow = /** @class */ (function () {
94
94
  };
95
95
  DetailRow.prototype.actioncomplete = function (args) {
96
96
  if (args.requestType === 'beginEdit' || args.requestType === 'add') {
97
- var spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
98
- var colum = parseInt(spann, 10) - 1;
99
- var updtdcolum = colum.toString();
100
- args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);
97
+ var colSpan = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
98
+ var colum = parseInt(colSpan, 10) - 1;
99
+ args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
101
100
  }
102
101
  var focusElement = this.parent.grid.contentModule.getRows();
103
102
  for (var i = 0; i < focusElement.length; i++) {
@@ -25,6 +25,7 @@ export declare class Edit {
25
25
  private isAddedRowByContextMenu;
26
26
  private editedRowIndex;
27
27
  private isScrollByFocus;
28
+ private isIndexUndefined;
28
29
  /**
29
30
  * Constructor for Edit module
30
31
  *
@@ -22,6 +22,7 @@ var Edit = /** @class */ (function () {
22
22
  this.prevAriaRowIndex = '-1';
23
23
  this.isAddedRowByMethod = false;
24
24
  this.isAddedRowByContextMenu = false;
25
+ this.isIndexUndefined = false;
25
26
  Grid.Inject(GridEdit);
26
27
  this.parent = parent;
27
28
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -274,7 +275,7 @@ var Edit = /** @class */ (function () {
274
275
  }
275
276
  };
276
277
  Edit.prototype.keyPressed = function (args) {
277
- if (this.isOnBatch) {
278
+ if (this.isOnBatch || args.action === 'tab' || args.action === 'shiftTab') {
278
279
  this.keyPress = args.action;
279
280
  }
280
281
  if (args.action === 'f2') {
@@ -816,9 +817,10 @@ var Edit = /** @class */ (function () {
816
817
  this.addRowRecord = this.parent.flatData[args.index];
817
818
  this.addRowIndex = args.index;
818
819
  }
819
- if (this.parent.editSettings.newRowPosition === 'Child' &&
820
+ if (this.parent.editSettings.newRowPosition === 'Child' && this.isIndexUndefined &&
820
821
  !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
821
822
  this.addRowRecord = this.parent.getSelectedRecords()[0];
823
+ this.isIndexUndefined = false;
822
824
  }
823
825
  if (isNullOrUndefined(this.addRowRecord) && this.parent.getCurrentViewRecords().length > this.addRowIndex &&
824
826
  args.requestType === 'save' && this.parent.getSelectedRecords().length !== 0) {
@@ -874,7 +876,7 @@ var Edit = /** @class */ (function () {
874
876
  var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
875
877
  var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
876
878
  this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
877
- if (currentData.length) {
879
+ if (currentData.length && !isNullOrUndefined(index)) {
878
880
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
879
881
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
880
882
  if (currentData[this.addRowIndex].parentItem) {
@@ -882,7 +884,7 @@ var Edit = /** @class */ (function () {
882
884
  }
883
885
  parentItem = currentData[this.addRowIndex].parentItem;
884
886
  }
885
- if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {
887
+ if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length && !isNullOrUndefined(index)) {
886
888
  level = currentData[this.addRowIndex].level;
887
889
  if (this.parent.editSettings.newRowPosition === 'Above') {
888
890
  position = 'before';
@@ -958,14 +960,24 @@ var Edit = /** @class */ (function () {
958
960
  childRecords: value.childRecords };
959
961
  }
960
962
  if (args.requestType === 'delete') {
961
- var deletedValues = args.data;
962
- for (var i = 0; i < deletedValues.length; i++) {
963
- if (deletedValues[parseInt(i.toString(), 10)].parentItem) {
964
- var parentItem = getParentData(this.parent, deletedValues[parseInt(i.toString(), 10)].parentItem.uniqueID);
965
- if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
966
- var childIndex = parentItem.childRecords.indexOf(deletedValues[parseInt(i.toString(), 10)]);
967
- parentItem.childRecords.splice(childIndex, 1);
963
+ var deletedValues_1 = args.data;
964
+ var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames();
965
+ if (!isNullOrUndefined(primaryKeyField_1) && primaryKeyField_1.length > 0) {
966
+ var _loop_2 = function (i) {
967
+ var deletevalue = deletedValues_1[parseInt(i.toString(), 10)].parentItem;
968
+ if (deletevalue) {
969
+ var parentItem = getParentData(this_2.parent, deletevalue.uniqueID);
970
+ if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
971
+ var childIndex = parentItem.childRecords.findIndex(function (child) {
972
+ return deletedValues_1[parseInt(i.toString(), 10)][primaryKeyField_1[0]] === child[primaryKeyField_1[0]];
973
+ });
974
+ parentItem.childRecords.splice(childIndex, 1);
975
+ }
968
976
  }
977
+ };
978
+ var this_2 = this;
979
+ for (var i = 0; i < deletedValues_1.length; i++) {
980
+ _loop_2(i);
969
981
  }
970
982
  }
971
983
  }
@@ -980,6 +992,9 @@ var Edit = /** @class */ (function () {
980
992
  if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {
981
993
  this.previousNewRowPosition = this.parent.editSettings.newRowPosition;
982
994
  }
995
+ if (isNullOrUndefined(index)) {
996
+ this.isIndexUndefined = true;
997
+ }
983
998
  if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {
984
999
  var addRecords = [];
985
1000
  var previousEditMode = this.parent.editSettings.mode;
@@ -72,11 +72,11 @@ var Filter = /** @class */ (function () {
72
72
  this.filteredParentRecs = [];
73
73
  this.filteredResult = [];
74
74
  this.isHierarchyFilter = false;
75
+ var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
76
+ : this.parent.searchSettings.hierarchyMode;
75
77
  for (var f = 0; f < this.flatFilteredData.length; f++) {
76
78
  var rec = this.flatFilteredData[parseInt(f.toString(), 10)];
77
79
  this.addParentRecord(rec);
78
- var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
79
- : this.parent.searchSettings.hierarchyMode;
80
80
  if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&
81
81
  (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {
82
82
  this.isHierarchyFilter = true;
@@ -88,8 +88,6 @@ var Filter = /** @class */ (function () {
88
88
  var parent_1 = getObject('parentItem', rec);
89
89
  if (!isNullOrUndefined(parent_1)) {
90
90
  var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);
91
- //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {
92
- // return e.uniqueID === rec.parentItem.uniqueID; })[0];
93
91
  setValue('hasFilteredChildRecords', true, parRecord);
94
92
  if (parRecord && parRecord.parentItem) {
95
93
  this.updateParentFilteredRecord(parRecord);
@@ -113,7 +111,6 @@ var Filter = /** @class */ (function () {
113
111
  };
114
112
  Filter.prototype.addParentRecord = function (record) {
115
113
  var parent = getParentData(this.parent, record.parentUniqueID);
116
- //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];
117
114
  var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
118
115
  : this.parent.searchSettings.hierarchyMode;
119
116
  if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0
@@ -1645,6 +1645,7 @@ var RowDD = /** @class */ (function () {
1645
1645
  * @returns {void} - This method does not return a value.
1646
1646
  */
1647
1647
  RowDD.prototype.removeRecords = function (record) {
1648
+ var _this = this;
1648
1649
  var tObj = this.parent;
1649
1650
  var dataSource;
1650
1651
  if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {
@@ -1672,20 +1673,13 @@ var RowDD = /** @class */ (function () {
1672
1673
  if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {
1673
1674
  this.removeChildItem(deletedRow);
1674
1675
  }
1675
- var idx = void 0;
1676
- var idz = void 0;
1677
1676
  var treeGridData = dataSource;
1678
- for (var i = 0; i < treeGridData.length; i++) {
1679
- if (treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
1680
- idx = i;
1681
- }
1682
- }
1683
- for (var i = 0; i < this.treeGridData.length; i++) {
1684
- if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
1685
- === deletedRow.taskData[this.parent.idMapping]) {
1686
- idz = i;
1687
- }
1688
- }
1677
+ var idx = treeGridData.findIndex(function (data) {
1678
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
1679
+ });
1680
+ var idz = this.treeGridData.findIndex(function (data) {
1681
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
1682
+ });
1689
1683
  if (idx !== -1 && !isNullOrUndefined(idx)) {
1690
1684
  dataSource.splice(idx, 1);
1691
1685
  }
@@ -508,6 +508,13 @@ var Selection = /** @class */ (function () {
508
508
  this.headerSelection();
509
509
  }
510
510
  }
511
+ else {
512
+ if ((requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh')
513
+ && !isRemoteData(this.parent)) {
514
+ this.selectedItems = [];
515
+ this.selectedIndexes = [];
516
+ }
517
+ }
511
518
  }
512
519
  };
513
520
  Selection.prototype.getCheckedrecords = function () {
@@ -45,14 +45,7 @@ var Aggregate = /** @class */ (function () {
45
45
  Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {
46
46
  this.summaryQuery = summaryQuery;
47
47
  var parentRecord;
48
- var parentDataLength = Object.keys(filteredData).length;
49
- var parentData = [];
50
- for (var p = 0, len = parentDataLength; p < len; p++) {
51
- var summaryRow = getObject('isSummaryRow', filteredData[parseInt(p.toString(), 10)]);
52
- if (!summaryRow) {
53
- parentData.push(filteredData[parseInt(p.toString(), 10)]);
54
- }
55
- }
48
+ var parentData = filteredData.filter(function (data) { return !getObject('isSummaryRow', data); });
56
49
  var parentRecords = findParentRecords(parentData);
57
50
  var flatRecords = parentData.slice();
58
51
  var summaryLength = Object.keys(this.parent.aggregates).length;
@@ -210,14 +203,7 @@ var Aggregate = /** @class */ (function () {
210
203
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
211
204
  }
212
205
  var value = single["" + summaryColumn.columnName]["" + summaryKey];
213
- var summaryValue;
214
- if (cellElement.innerHTML.indexOf(value) === -1) {
215
- summaryValue = cellElement.innerHTML + value;
216
- return summaryValue;
217
- }
218
- else {
219
- return cellElement.innerHTML;
220
- }
206
+ return cellElement.innerHTML.indexOf(value) === -1 ? cellElement.innerHTML + value : cellElement.innerHTML;
221
207
  };
222
208
  Aggregate.prototype.getFormatFromType = function (summaryformat, type) {
223
209
  if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {
@@ -59,8 +59,8 @@ var Toolbar = /** @class */ (function () {
59
59
  }
60
60
  row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
61
61
  if (indentEle !== null && outdentEle !== null) {
62
- indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
63
- outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
62
+ indentElement = indentEle.parentElement;
63
+ outdentElement = outdentEle.parentElement;
64
64
  if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
65
65
  indentElement.classList.add('e-hidden');
66
66
  outdentElement.classList.add('e-hidden');