@syncfusion/ej2-treegrid 26.2.12 → 27.1.48

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 (139) hide show
  1. package/dist/ej2-treegrid.min.js +2 -2
  2. package/dist/ej2-treegrid.umd.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +86 -121
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +86 -121
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +2 -2
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +11 -10
  12. package/src/treegrid/actions/batch-edit.js +3 -0
  13. package/src/treegrid/actions/edit.js +4 -3
  14. package/src/treegrid/actions/excel-export.js +3 -1
  15. package/src/treegrid/actions/virtual-scroll.d.ts +2 -0
  16. package/src/treegrid/actions/virtual-scroll.js +7 -1
  17. package/src/treegrid/base/data.js +27 -28
  18. package/src/treegrid/base/treegrid-model.d.ts +5 -2
  19. package/src/treegrid/base/treegrid.d.ts +7 -2
  20. package/src/treegrid/base/treegrid.js +41 -87
  21. package/src/treegrid/renderer/render.js +1 -1
  22. package/styles/bootstrap-dark-lite.css +427 -0
  23. package/styles/bootstrap-dark-lite.scss +18 -0
  24. package/styles/bootstrap-dark.css +24 -71
  25. package/styles/bootstrap-dark.scss +1 -0
  26. package/styles/bootstrap-lite.css +430 -0
  27. package/styles/bootstrap-lite.scss +18 -0
  28. package/styles/bootstrap.css +27 -74
  29. package/styles/bootstrap.scss +1 -0
  30. package/styles/bootstrap4-lite.css +463 -0
  31. package/styles/bootstrap4-lite.scss +18 -0
  32. package/styles/bootstrap4.css +24 -89
  33. package/styles/bootstrap4.scss +1 -0
  34. package/styles/bootstrap5-dark-lite.css +466 -0
  35. package/styles/bootstrap5-dark-lite.scss +18 -0
  36. package/styles/bootstrap5-dark.css +24 -75
  37. package/styles/bootstrap5-dark.scss +1 -0
  38. package/styles/bootstrap5-lite.css +466 -0
  39. package/styles/bootstrap5-lite.scss +18 -0
  40. package/styles/bootstrap5.3-lite.css +470 -0
  41. package/styles/bootstrap5.3-lite.scss +18 -0
  42. package/styles/bootstrap5.3.css +490 -0
  43. package/styles/bootstrap5.3.scss +19 -0
  44. package/styles/bootstrap5.css +24 -75
  45. package/styles/bootstrap5.scss +1 -0
  46. package/styles/fabric-dark-lite.css +406 -0
  47. package/styles/fabric-dark-lite.scss +18 -0
  48. package/styles/fabric-dark.css +27 -73
  49. package/styles/fabric-dark.scss +1 -0
  50. package/styles/fabric-lite.css +406 -0
  51. package/styles/fabric-lite.scss +18 -0
  52. package/styles/fabric.css +27 -66
  53. package/styles/fabric.scss +1 -0
  54. package/styles/fluent-dark-lite.css +469 -0
  55. package/styles/fluent-dark-lite.scss +18 -0
  56. package/styles/fluent-dark.css +31 -69
  57. package/styles/fluent-dark.scss +1 -0
  58. package/styles/fluent-lite.css +469 -0
  59. package/styles/fluent-lite.scss +18 -0
  60. package/styles/fluent.css +31 -69
  61. package/styles/fluent.scss +1 -0
  62. package/styles/fluent2-lite.css +657 -0
  63. package/styles/fluent2-lite.scss +18 -0
  64. package/styles/fluent2.css +50 -62
  65. package/styles/fluent2.scss +1 -0
  66. package/styles/highcontrast-light-lite.css +412 -0
  67. package/styles/highcontrast-light-lite.scss +18 -0
  68. package/styles/highcontrast-light.css +24 -58
  69. package/styles/highcontrast-light.scss +1 -0
  70. package/styles/highcontrast-lite.css +419 -0
  71. package/styles/highcontrast-lite.scss +18 -0
  72. package/styles/highcontrast.css +31 -65
  73. package/styles/highcontrast.scss +1 -0
  74. package/styles/material-dark-lite.css +488 -0
  75. package/styles/material-dark-lite.scss +18 -0
  76. package/styles/material-dark.css +24 -55
  77. package/styles/material-dark.scss +1 -0
  78. package/styles/material-lite.css +512 -0
  79. package/styles/material-lite.scss +18 -0
  80. package/styles/material.css +24 -76
  81. package/styles/material.scss +1 -0
  82. package/styles/material3-dark-lite.css +499 -0
  83. package/styles/material3-dark-lite.scss +18 -0
  84. package/styles/material3-dark.css +24 -80
  85. package/styles/material3-dark.scss +1 -0
  86. package/styles/material3-lite.css +501 -0
  87. package/styles/material3-lite.scss +18 -0
  88. package/styles/material3.css +24 -80
  89. package/styles/material3.scss +1 -0
  90. package/styles/tailwind-dark-lite.css +439 -0
  91. package/styles/tailwind-dark-lite.scss +18 -0
  92. package/styles/tailwind-dark.css +24 -56
  93. package/styles/tailwind-dark.scss +1 -0
  94. package/styles/tailwind-lite.css +439 -0
  95. package/styles/tailwind-lite.scss +18 -0
  96. package/styles/tailwind.css +24 -56
  97. package/styles/tailwind.scss +1 -0
  98. package/styles/treegrid/_bigger.scss +62 -0
  99. package/styles/treegrid/_bootstrap5.3-definition.scss +5 -5
  100. package/styles/treegrid/_fluent2-definition.scss +3 -3
  101. package/styles/treegrid/_layout.scss +19 -52
  102. package/styles/treegrid/bootstrap-dark.css +24 -71
  103. package/styles/treegrid/bootstrap-dark.scss +1 -0
  104. package/styles/treegrid/bootstrap.css +27 -74
  105. package/styles/treegrid/bootstrap.scss +1 -0
  106. package/styles/treegrid/bootstrap4.css +24 -89
  107. package/styles/treegrid/bootstrap4.scss +1 -0
  108. package/styles/treegrid/bootstrap5-dark.css +24 -75
  109. package/styles/treegrid/bootstrap5-dark.scss +1 -0
  110. package/styles/treegrid/bootstrap5.3.css +490 -0
  111. package/styles/treegrid/bootstrap5.3.scss +19 -0
  112. package/styles/treegrid/bootstrap5.css +24 -75
  113. package/styles/treegrid/bootstrap5.scss +1 -0
  114. package/styles/treegrid/fabric-dark.css +27 -73
  115. package/styles/treegrid/fabric-dark.scss +1 -0
  116. package/styles/treegrid/fabric.css +27 -66
  117. package/styles/treegrid/fabric.scss +1 -0
  118. package/styles/treegrid/fluent-dark.css +31 -69
  119. package/styles/treegrid/fluent-dark.scss +1 -0
  120. package/styles/treegrid/fluent.css +31 -69
  121. package/styles/treegrid/fluent.scss +1 -0
  122. package/styles/treegrid/fluent2.css +50 -62
  123. package/styles/treegrid/fluent2.scss +1 -0
  124. package/styles/treegrid/highcontrast-light.css +24 -58
  125. package/styles/treegrid/highcontrast-light.scss +1 -0
  126. package/styles/treegrid/highcontrast.css +31 -65
  127. package/styles/treegrid/highcontrast.scss +1 -0
  128. package/styles/treegrid/material-dark.css +24 -55
  129. package/styles/treegrid/material-dark.scss +1 -0
  130. package/styles/treegrid/material.css +24 -76
  131. package/styles/treegrid/material.scss +1 -0
  132. package/styles/treegrid/material3-dark.css +24 -80
  133. package/styles/treegrid/material3-dark.scss +1 -0
  134. package/styles/treegrid/material3.css +24 -80
  135. package/styles/treegrid/material3.scss +1 -0
  136. package/styles/treegrid/tailwind-dark.css +24 -56
  137. package/styles/treegrid/tailwind-dark.scss +1 -0
  138. package/styles/treegrid/tailwind.css +24 -56
  139. package/styles/treegrid/tailwind.scss +1 -0
@@ -1799,7 +1799,7 @@ var Render = /** @__PURE__ @class */ (function () {
1799
1799
  var iconRequired = !isNullOrUndefined(data.hasFilteredChildRecords)
1800
1800
  ? data.hasFilteredChildRecords : data.hasChildRecords;
1801
1801
  if (iconRequired && !isNullOrUndefined(data.childRecords)) {
1802
- if (this.parent['isFromGantt'] && !this.parent.loadChildOnDemand) {
1802
+ if (this.parent['isFromGantt'] && this.parent.loadChildOnDemand) {
1803
1803
  iconRequired = data.hasChildRecords;
1804
1804
  }
1805
1805
  else {
@@ -2248,12 +2248,12 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2248
2248
  this.parent.query.expands = [];
2249
2249
  }
2250
2250
  if (!this.parent.hasChildMapping && !this.parentItems.length &&
2251
- (!this.parent.loadChildOnDemand)) {
2251
+ (this.parent.loadChildOnDemand)) {
2252
2252
  this.zerothLevelData = args;
2253
2253
  setValue('cancel', true, args);
2254
2254
  }
2255
2255
  else {
2256
- if (!this.parent.loadChildOnDemand) {
2256
+ if (this.parent.loadChildOnDemand) {
2257
2257
  var _loop_1 = function (rec) {
2258
2258
  if (isCountRequired(this_1.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&
2259
2259
  this_1.parent.initialRender) {
@@ -2298,22 +2298,22 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2298
2298
  else {
2299
2299
  var dataResults = 'dataResults';
2300
2300
  var expandRecord = 'expandRecord';
2301
- if (!isNullOrUndefined(records) && !((this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent["" + dataResults]["" + expandRecord])) &&
2302
- !(isRemoteData(this.parent) && this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization)) {
2301
+ if (!isNullOrUndefined(records) && !((!this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent["" + dataResults]["" + expandRecord])) &&
2302
+ !(isRemoteData(this.parent) && !this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization)) {
2303
2303
  this.convertToFlatData(records);
2304
2304
  }
2305
2305
  }
2306
2306
  }
2307
- if (isRemoteData(this.parent) && this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization) {
2307
+ if (isRemoteData(this.parent) && !this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization) {
2308
2308
  args.result = records;
2309
2309
  }
2310
- else if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {
2310
+ else if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand) {
2311
2311
  args.result = records;
2312
2312
  }
2313
2313
  else {
2314
- args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;
2314
+ args.result = !this.parent.loadChildOnDemand ? this.parent.flatData : records;
2315
2315
  }
2316
- if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand
2316
+ if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand
2317
2317
  && this.parent.grid.aggregates.length && this.parent.grid.sortSettings.columns.length === 0
2318
2318
  && this.parent.grid.filterSettings.columns.length === 0 && !this.parent.grid.searchSettings.key.length) {
2319
2319
  var query = 'query';
@@ -2347,7 +2347,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2347
2347
  }
2348
2348
  for (var i = 0; i < rowDetails.rows.length; i++) {
2349
2349
  rowDetails.rows[parseInt(i.toString(), 10)].style.display = 'table-row';
2350
- if (this.parent.loadChildOnDemand) {
2350
+ if (!this.parent.loadChildOnDemand) {
2351
2351
  var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
2352
2352
  childRecord = this.parent.rowTemplate ?
2353
2353
  this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
@@ -2411,7 +2411,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2411
2411
  var datas = _this.parent.grid.currentViewData.slice();
2412
2412
  var inx;
2413
2413
  var idMapping = _this.parent.idMapping;
2414
- if (_this.parent['isGantt'] && !_this.parent.loadChildOnDemand && _this.parent.hasChildMapping) {
2414
+ if (_this.parent['isGantt'] && _this.parent.loadChildOnDemand && _this.parent.hasChildMapping) {
2415
2415
  for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {
2416
2416
  if (rowDetails.record[idMapping] === _this.parent.grid.currentViewData[i][idMapping]) {
2417
2417
  inx = i;
@@ -2535,7 +2535,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2535
2535
  _this.parentItems.indexOf(result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping]) !== -1)
2536
2536
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
2537
2537
  result[parseInt(r.toString(), 10)].hasChildRecords = true;
2538
- if (_this.parent.enableVirtualization && _this.parent.loadChildOnDemand) {
2538
+ if (_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand) {
2539
2539
  for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
2540
2540
  if (result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
2541
2541
  result[parseInt(r.toString(), 10)].expanded = _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];
@@ -2569,7 +2569,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2569
2569
  else if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action !== 'collapse') {
2570
2570
  result[parseInt(r.toString(), 10)].expanded = true;
2571
2571
  }
2572
- else if (!(_this.parent.enableVirtualization && _this.parent.loadChildOnDemand)) {
2572
+ else if (!(_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand)) {
2573
2573
  result[parseInt(r.toString(), 10)].expanded = false;
2574
2574
  }
2575
2575
  }
@@ -2591,7 +2591,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2591
2591
  }
2592
2592
  }
2593
2593
  if (rowDetails.action === 'remoteExpand' && _this.parent.allowPaging && _this.parent.pageSettings.pageSizeMode === 'All') {
2594
- _this.parent.grid.pageSettings.totalRecordsCount = _this.parent.grid.currentViewData.length + result.length;
2594
+ _this.parent.grid.pageSettings.totalRecordsCount = _this.parent.grid.pageSettings.totalRecordsCount + result.length;
2595
2595
  }
2596
2596
  if (_this.parent.enableVirtualization) {
2597
2597
  _this.parent.grid.pageSettings.totalRecordsCount = e.count;
@@ -2644,21 +2644,20 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2644
2644
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
2645
2645
  currentData.index = this.storedIndex;
2646
2646
  }
2647
- if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
2648
- ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent))) {
2649
- if (!isNullOrUndefined(currentData[this.parent.childMapping])) {
2650
- if (currentData[this.parent.childMapping].length > 0) {
2651
- currentData.hasChildRecords = true;
2652
- }
2653
- else {
2654
- currentData.hasChildRecords = false;
2655
- }
2656
- }
2657
- else {
2658
- currentData.hasChildRecords = true;
2659
- }
2647
+ var childMapping = currentData[this.parent.childMapping];
2648
+ var hasChildren = !isNullOrUndefined(childMapping) && childMapping.length > 0;
2649
+ var shouldCount = isCountRequired(this.parent);
2650
+ var hasChildMapping = currentData[this.parent.hasChildMapping];
2651
+ if ((hasChildren && !shouldCount) || (hasChildMapping && shouldCount)) {
2652
+ currentData.hasChildRecords = true;
2653
+ }
2654
+ else {
2655
+ currentData.hasChildRecords = false;
2656
+ }
2657
+ if ((!isNullOrUndefined(childMapping) && !shouldCount) ||
2658
+ (hasChildMapping) && shouldCount) {
2660
2659
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
2661
- && isNullOrUndefined(currentData[this.parent.childMapping])) {
2660
+ && isNullOrUndefined(childMapping)) {
2662
2661
  currentData.expanded = false;
2663
2662
  }
2664
2663
  else {
@@ -2690,7 +2689,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2690
2689
  }
2691
2690
  currentData.checkboxState = 'uncheck';
2692
2691
  var remoteCollapsedData = 'remoteCollapsedData';
2693
- if (this.parent.enableVirtualization && this.parent.loadChildOnDemand && isRemoteData(this.parent)
2692
+ if (this.parent.enableVirtualization && !this.parent.loadChildOnDemand && isRemoteData(this.parent)
2694
2693
  && !this.parent.initialRender) {
2695
2694
  if (!currentData.hasChildRecords && isNullOrUndefined(currentData["" + this.parent.parentIdMapping])) {
2696
2695
  currentData.hasChildRecords = true;
@@ -3737,6 +3736,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3737
3736
  _this.deletedRecords = 'deletedRecords';
3738
3737
  _this.addedRecords = 'addedRecords';
3739
3738
  _this.indentOutdentAction = 'indentOutdentAction';
3739
+ _this.isFromChartSide = false;
3740
3740
  _this.modifiedRecords = [];
3741
3741
  _this.stackedHeader = false;
3742
3742
  _this.objectEqualityChecker = function (old, current) {
@@ -3967,10 +3967,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3967
3967
  * @returns {void}
3968
3968
  */
3969
3969
  TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {
3970
- if (isNullOrUndefined(columnName) && isNullOrUndefined(direction)) {
3971
- var error = 'The provided value for the columnName and direction is undefined. Please ensure the columnName and direction contains string.';
3972
- this.trigger(actionFailure, { error: error });
3973
- }
3974
3970
  if (this.sortModule) {
3975
3971
  this.sortModule.sortColumn(columnName, direction, isMultiSort);
3976
3972
  }
@@ -4031,10 +4027,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4031
4027
  * @returns {void}
4032
4028
  */
4033
4029
  TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {
4034
- if (isNullOrUndefined(fromFName) && isNullOrUndefined(toFName)) {
4035
- var error = 'The provided value for the fromFName and toFName is undefined. Please ensure the fromFName and toFName contains string.';
4036
- this.trigger(actionFailure, { error: error });
4037
- }
4038
4030
  this.grid.reorderColumns(fromFName, toFName);
4039
4031
  };
4040
4032
  TreeGrid.prototype.TreeGridLocale = function () {
@@ -4114,8 +4106,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4114
4106
  if (summaryElement !== null) {
4115
4107
  var cellIndex_1 = target.cellIndex;
4116
4108
  var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
4117
- addClass([row_1], 'e-focused');
4118
- addClass([row_1], 'e-focus');
4109
+ if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
4110
+ addClass([row_1], 'e-focused');
4111
+ addClass([row_1], 'e-focus');
4112
+ }
4119
4113
  }
4120
4114
  else {
4121
4115
  this.clearSelection();
@@ -4142,8 +4136,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4142
4136
  var cellIndex_2 = target.cellIndex;
4143
4137
  if (!isNullOrUndefined(cellIndex_2)) {
4144
4138
  var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
4145
- addClass([row_2], 'e-focused');
4146
- addClass([row_2], 'e-focus');
4139
+ if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
4140
+ addClass([row_2], 'e-focused');
4141
+ addClass([row_2], 'e-focus');
4142
+ }
4147
4143
  }
4148
4144
  }
4149
4145
  else {
@@ -4273,7 +4269,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4273
4269
  name: 'Aggregate'
4274
4270
  });
4275
4271
  }
4276
- if (this.allowResizing) {
4272
+ if (this.resizeCheck()) {
4277
4273
  modules.push({
4278
4274
  member: 'resize', args: [this],
4279
4275
  name: 'Resize'
@@ -4322,6 +4318,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4322
4318
  this.extendRequiredModules(modules);
4323
4319
  return modules;
4324
4320
  };
4321
+ TreeGrid.prototype.resizeCheck = function () {
4322
+ var columnMenu = this.showColumnMenu && (!this.columnMenuItems || this.columnMenuItems
4323
+ .filter(function (c) { return c === 'AutoFit' || c === 'AutoFitAll'; }).length) ? true : false;
4324
+ var contextMenu = this.contextMenuItems && this.contextMenuItems
4325
+ .filter(function (c) { return c === 'AutoFit' || c === 'AutoFitAll'; }).length ? true : false;
4326
+ return this.allowResizing || columnMenu || contextMenu;
4327
+ };
4325
4328
  TreeGrid.prototype.extendRequiredModules = function (modules) {
4326
4329
  var IsRowDDInjected = this.injectedModules.filter(function (e) {
4327
4330
  return e.prototype.getModuleName() === 'rowDragAndDrop';
@@ -4524,9 +4527,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4524
4527
  if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
4525
4528
  failureCases.push('Virtual scrolling is not compatible with the detail template');
4526
4529
  }
4527
- if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
4528
- failureCases.push('Virtual scrolling is not compatible with the detail template');
4529
- }
4530
4530
  if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }) || this.frozenRows > 0)
4531
4531
  && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
4532
4532
  failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
@@ -4543,9 +4543,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4543
4543
  if (this.treeColumnIndex >= this.columns.length) {
4544
4544
  failureCases.push('TreeColumnIndex value should not exceed the total column count.');
4545
4545
  }
4546
- if (this.enableVirtualization && (!/[0-9]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString())
4547
- && !/[px]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString()))
4548
- || (/[0-9]$/.test(this.height.toString()) && /[px]$/.test(this.height.toString()))) {
4546
+ if (this.enableVirtualization &&
4547
+ (this.columnModel.some(function (col) { return /%$/.test(col.width); }) ||
4548
+ /%$/.test(this.height.toString()))) {
4549
4549
  failureCases.push('column width and height should be in pixels');
4550
4550
  }
4551
4551
  if ((this.childMapping !== 'Children') && !isNullOrUndefined(this.idMapping)) {
@@ -4700,7 +4700,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4700
4700
  this.trigger(getObject('name', args), args);
4701
4701
  };
4702
4702
  TreeGrid.prototype.IsExpandCollapseClicked = function (args) {
4703
- if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
4703
+ if (!this.isFromChartSide && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
4704
4704
  || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
4705
4705
  && !this.selectionSettings.checkboxOnly) {
4706
4706
  if ((!isNullOrUndefined(args.data) && args.data['hasChildRecords']) || (args.rowIndex !== -1 && isNullOrUndefined(args.data))) {
@@ -4723,9 +4723,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4723
4723
  if (_this.pageSettings.pageSizeMode === 'Root') {
4724
4724
  _this.grid.selectionModule['totalRecordsCount'] = _this.grid.currentViewData.length;
4725
4725
  }
4726
- if (_this.enableVirtualization && args.rowIndex === _this.selectedRowIndex) {
4726
+ if (_this.enableVirtualization && args.rowIndex === _this.selectedRowIndex && !_this.enablePersistence) {
4727
4727
  args.cancel = true;
4728
4728
  }
4729
+ if (!isNullOrUndefined(_this.selectionSettings) && !_this.selectionSettings.persistSelection &&
4730
+ _this.enableVirtualization && args.rowIndex === _this.selectedRowIndex && _this.isGantt) {
4731
+ args.cancel = false;
4732
+ }
4729
4733
  _this.trigger(rowSelecting, args);
4730
4734
  };
4731
4735
  this.grid.rowDeselecting = function (args) {
@@ -5848,7 +5852,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5848
5852
  }
5849
5853
  if (((target.classList.contains('e-flmenu-cancelbtn') || target.classList.contains('e-flmenu-okbtn')
5850
5854
  || target.classList.contains('e-content') || target.classList.contains('e-rowcell'))
5851
- && !isNullOrUndefined(this.filterModule) && this.isReact)) {
5855
+ && !isNullOrUndefined(this.grid.filterModule) && this.isReact)) {
5852
5856
  if (!isNullOrUndefined(this.grid.filterModule['column'])) {
5853
5857
  if (this.grid.filterModule['column'].filterTemplate) {
5854
5858
  var elem = document.getElementById(this.grid.filterModule.filterModule['dlgObj'].element.id);
@@ -6028,10 +6032,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6028
6032
  * @returns {void}
6029
6033
  */
6030
6034
  TreeGrid.prototype.deleteRow = function (tr) {
6031
- if (isNullOrUndefined(tr)) {
6032
- var error = 'The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement.';
6033
- this.trigger(actionFailure, { error: error });
6034
- }
6035
6035
  if (this.grid.editModule) {
6036
6036
  this.grid.editModule.deleteRow(tr);
6037
6037
  }
@@ -6057,10 +6057,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6057
6057
  this.grid.setCellValue(key, field, value);
6058
6058
  var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
6059
6059
  var record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
6060
- if (isNullOrUndefined(record)) {
6061
- var error = 'The provided value for the record is undefined. Please ensure the record contains ITreeData.';
6062
- this.trigger(actionFailure, { error: error });
6063
- }
6064
6060
  editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
6065
6061
  };
6066
6062
  /**
@@ -6112,10 +6108,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6112
6108
  * @returns {void}
6113
6109
  */
6114
6110
  TreeGrid.prototype.goToPage = function (pageNo) {
6115
- if (isNullOrUndefined(pageNo)) {
6116
- var error = 'The provided value for the pageNo is undefined. Please ensure the pageNo contains number.';
6117
- this.trigger(actionFailure, { error: error });
6118
- }
6119
6111
  if (this.grid.pagerModule) {
6120
6112
  this.grid.pagerModule.goToPage(pageNo);
6121
6113
  }
@@ -6217,10 +6209,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6217
6209
  * @returns {void}
6218
6210
  */
6219
6211
  TreeGrid.prototype.hideColumns = function (keys, hideBy) {
6220
- if (isNullOrUndefined(keys)) {
6221
- var error = 'The provided value for the keys is undefined. Please ensure the keys contains string.';
6222
- this.trigger(actionFailure, { error: error });
6223
- }
6224
6212
  this.grid.hideColumns(keys, hideBy);
6225
6213
  this.updateColumnModel();
6226
6214
  };
@@ -6318,6 +6306,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6318
6306
  if (this.grid.columns.length !== this.columnModel.length) {
6319
6307
  this.stackedHeader = true;
6320
6308
  }
6309
+ if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
6310
+ var error = 'Stacked header is not compatible with the detail template';
6311
+ this.trigger(actionFailure, { error: error });
6312
+ }
6321
6313
  if (this.stackedHeader && this.allowResizing && !isNullOrUndefined(this.columns)) {
6322
6314
  this.updateColumnsWidth(this.columns);
6323
6315
  }
@@ -6639,10 +6631,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6639
6631
  TreeGrid.prototype.expandRow = function (row, record, key, level) {
6640
6632
  var _this = this;
6641
6633
  this.isCollapseAll = false;
6642
- if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
6643
- var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
6644
- this.trigger(actionFailure, { error: error });
6645
- }
6646
6634
  var parentRec = this.parentData;
6647
6635
  if (!this.enableVirtualization) {
6648
6636
  parentRec = this.flatData.filter(function (e) {
@@ -6731,7 +6719,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6731
6719
  return e.hasChildRecords;
6732
6720
  });
6733
6721
  }
6734
- else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
6722
+ else if (isNullOrUndefined(record)) {
6735
6723
  if (this.detailTemplate) {
6736
6724
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
6737
6725
  }
@@ -6765,10 +6753,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6765
6753
  TreeGrid.prototype.collapseRow = function (row, record, key) {
6766
6754
  var _this = this;
6767
6755
  this.isExpandAll = false;
6768
- if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
6769
- var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
6770
- this.trigger(actionFailure, { error: error });
6771
- }
6772
6756
  var parentRec = this.parentData;
6773
6757
  if (!this.enableVirtualization) {
6774
6758
  parentRec = this.flatData.filter(function (e) {
@@ -6848,10 +6832,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6848
6832
  * @returns {void}
6849
6833
  */
6850
6834
  TreeGrid.prototype.expandAtLevel = function (level) {
6851
- if (isNullOrUndefined(level)) {
6852
- var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
6853
- this.trigger(actionFailure, { error: error });
6854
- }
6855
6835
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
6856
6836
  var rec = this.grid.dataSource.filter(function (e) {
6857
6837
  if (e.hasChildRecords && e.level === level) {
@@ -6874,10 +6854,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6874
6854
  * @returns {void}
6875
6855
  */
6876
6856
  TreeGrid.prototype.expandByKey = function (key) {
6877
- if (isNullOrUndefined(key)) {
6878
- var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
6879
- this.trigger(actionFailure, { error: error });
6880
- }
6881
6857
  this.expandCollapseActionByKey(key, 'Expand');
6882
6858
  };
6883
6859
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
@@ -6935,10 +6911,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6935
6911
  * @returns {void}
6936
6912
  */
6937
6913
  TreeGrid.prototype.collapseAtLevel = function (level) {
6938
- if (isNullOrUndefined(level)) {
6939
- var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
6940
- this.trigger(actionFailure, { error: error });
6941
- }
6942
6914
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
6943
6915
  var record = this.grid.dataSource.filter(function (e) {
6944
6916
  if (e.hasChildRecords && e.level === level) {
@@ -6961,10 +6933,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6961
6933
  * @returns {void}
6962
6934
  */
6963
6935
  TreeGrid.prototype.collapseByKey = function (key) {
6964
- if (isNullOrUndefined(key)) {
6965
- var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
6966
- this.trigger(actionFailure, { error: error });
6967
- }
6968
6936
  this.expandCollapseActionByKey(key, 'Collapse');
6969
6937
  };
6970
6938
  TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
@@ -7090,14 +7058,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7090
7058
  TreeGrid.prototype.expandCollapse = function (action, row, record, isChild) {
7091
7059
  var _this = this;
7092
7060
  var expandingArgs = { row: row, data: record, childData: [], requestType: action };
7093
- var childRecords;
7094
- if (!isNullOrUndefined(record)) {
7095
- childRecords = this.grid.currentViewData.filter(function (e) {
7096
- return e.parentUniqueID === record.uniqueID;
7097
- });
7098
- }
7061
+ var childRecords = this.grid.currentViewData.filter(function (e) {
7062
+ return e.parentUniqueID === record.uniqueID;
7063
+ });
7099
7064
  var targetEle;
7100
- if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
7065
+ if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && !this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
7101
7066
  this.updateChildOnDemand(expandingArgs);
7102
7067
  }
7103
7068
  var gridRows = this.getRows();
@@ -7124,7 +7089,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7124
7089
  var displayAction = void 0;
7125
7090
  if (action === 'expand') {
7126
7091
  displayAction = 'table-row';
7127
- if (!isChild && !isNullOrUndefined(record)) {
7092
+ if (!isChild) {
7128
7093
  record.expanded = true;
7129
7094
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
7130
7095
  }
@@ -7145,7 +7110,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7145
7110
  }
7146
7111
  else {
7147
7112
  displayAction = 'none';
7148
- if ((!isChild || isCountRequired(this)) && !isNullOrUndefined(row)) {
7113
+ if (!isChild || isCountRequired(this)) {
7149
7114
  record.expanded = false;
7150
7115
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
7151
7116
  }
@@ -7290,7 +7255,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7290
7255
  data_1.push(expandingArgs.childData[parseInt(j.toString(), 10)]);
7291
7256
  }
7292
7257
  }
7293
- if (isCountRequired(_this) && _this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
7258
+ if (isCountRequired(_this) && !_this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
7294
7259
  _this.dataResults['expandRecord'] = {};
7295
7260
  _this.dataResults['expandRecord'] = expandingArgs.data;
7296
7261
  }
@@ -7457,7 +7422,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7457
7422
  }
7458
7423
  };
7459
7424
  TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {
7460
- if (!isNullOrUndefined(isChild) && !isChild && !this.loadChildOnDemand) {
7425
+ if (!isNullOrUndefined(isChild) && !isChild && this.loadChildOnDemand) {
7461
7426
  rowDetails.record.expanded = false;
7462
7427
  }
7463
7428
  var rows = rowDetails.rows;
@@ -7588,10 +7553,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7588
7553
  * @returns {void}
7589
7554
  */
7590
7555
  TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
7591
- if (isNullOrUndefined(fieldName) && isNullOrUndefined(filterOperator) && isNullOrUndefined(filterValue)) {
7592
- var error = 'The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue.';
7593
- this.trigger(actionFailure, { error: error });
7594
- }
7595
7556
  this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
7596
7557
  };
7597
7558
  /**
@@ -7658,10 +7619,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7658
7619
  * @returns {void}
7659
7620
  */
7660
7621
  TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {
7661
- if (isNullOrUndefined(data) && isNullOrUndefined(rowIndex) && isNullOrUndefined(colIndex)) {
7662
- var error = 'The provided value for the index is undefined. Please ensure the index contains number.';
7663
- this.trigger(actionFailure, { error: error });
7664
- }
7665
7622
  this.clipboardModule.paste(data, rowIndex, colIndex);
7666
7623
  };
7667
7624
  /**
@@ -7930,10 +7887,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7930
7887
  * @returns {void}
7931
7888
  */
7932
7889
  TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
7933
- if (isNullOrUndefined(fromIndexes) && isNullOrUndefined(toIndex) && isNullOrUndefined(position)) {
7934
- var error = 'The provided value for the fromIndexes, toIndex and position is undefined. Please ensure the fromIndexes and toIndex contains number and position contains string.';
7935
- this.trigger(actionFailure, { error: error });
7936
- }
7937
7890
  this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
7938
7891
  };
7939
7892
  /**
@@ -8013,7 +7966,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8013
7966
  Property(false)
8014
7967
  ], TreeGrid.prototype, "allowPaging", void 0);
8015
7968
  __decorate$b([
8016
- Property(false)
7969
+ Property(true)
8017
7970
  ], TreeGrid.prototype, "loadChildOnDemand", void 0);
8018
7971
  __decorate$b([
8019
7972
  Property(false)
@@ -10368,7 +10321,9 @@ var ExcelExport = /** @__PURE__ @class */ (function () {
10368
10321
  ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {
10369
10322
  //count not required for this query
10370
10323
  var args = Object();
10371
- setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
10324
+ if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
10325
+ setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
10326
+ }
10372
10327
  setValue('isExport', true, args);
10373
10328
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
10374
10329
  setValue('exportType', property.exportType, args);
@@ -12041,6 +11996,9 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12041
11996
  if (!isNullOrUndefined(addRowRecord)) {
12042
11997
  addRowIndex = addRowRecord.index;
12043
11998
  }
11999
+ if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
12000
+ addRowIndex = 0;
12001
+ }
12044
12002
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
12045
12003
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
12046
12004
  selectedIndex = -1;
@@ -12563,7 +12521,7 @@ var Edit = /** @__PURE__ @class */ (function () {
12563
12521
  else if (isRemoteData(this.parent) ||
12564
12522
  (this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {
12565
12523
  var query = this.parent.grid.query;
12566
- if (this.parent['isGantt'] && !this.parent.loadChildOnDemand) {
12524
+ if (this.parent['isGantt'] && this.parent.loadChildOnDemand) {
12567
12525
  this.updateCell(args, rowIndex_1);
12568
12526
  setValue('isEdit', false, this.parent.grid);
12569
12527
  this.afterCellSave(args, row_1);
@@ -12923,6 +12881,7 @@ var Edit = /** @__PURE__ @class */ (function () {
12923
12881
  this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
12924
12882
  }
12925
12883
  }
12884
+ var selectedRecords = this.parent.getSelectedRecords()[0];
12926
12885
  if ((this.isAddedRowByMethod || (this.isAddedRowByContextMenu && this.parent.grid.selectedRowIndex !== -1)) &&
12927
12886
  (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
12928
12887
  this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
@@ -12930,8 +12889,8 @@ var Edit = /** @__PURE__ @class */ (function () {
12930
12889
  this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
12931
12890
  }
12932
12891
  }
12933
- else {
12934
- this.addRowRecord = this.parent.getSelectedRecords()[0];
12892
+ else if (!isNullOrUndefined(selectedRecords)) {
12893
+ this.addRowRecord = selectedRecords;
12935
12894
  }
12936
12895
  }
12937
12896
  if (this.isAddedRowByMethod && args.index !== 0) {
@@ -14046,6 +14005,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14046
14005
  */
14047
14006
  function VirtualScroll(parent) {
14048
14007
  this.prevstartIndex = -1;
14008
+ this.setEndIndexToGantt = true;
14049
14009
  this.prevendIndex = -1;
14050
14010
  this.prevSelectedRecord = [];
14051
14011
  this.parent = parent;
@@ -14145,11 +14105,16 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14145
14105
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
14146
14106
  }
14147
14107
  if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
14148
- if ((counts.endIndex + this.parent.pageSettings.pageSize >= counts.count && (this.parent.root && counts.count - counts.endIndex === this.visualData.length - this.parent.root['previousFlatData'].length))
14108
+ if (this.setEndIndexToGantt) {
14109
+ this.ganttEndIndex = counts.endIndex;
14110
+ }
14111
+ if ((counts.endIndex + this.parent.pageSettings.pageSize >= counts.count && (this.parent.root && counts.count - this.ganttEndIndex === this.visualData.length - this.parent.root['previousFlatData'].length))
14149
14112
  || !(this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
14150
14113
  startIndex = counts.startIndex + (counts.count - counts.endIndex);
14151
14114
  endIndex = counts.count;
14115
+ this.setEndIndexToGantt = false;
14152
14116
  }
14117
+ this.ganttEndIndex = endIndex;
14153
14118
  this.parent['isAddedFromGantt'] = false;
14154
14119
  }
14155
14120
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&