@syncfusion/ej2-treegrid 26.2.14 → 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 +83 -118
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +83 -118
  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 +38 -84
  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
@@ -1641,7 +1641,7 @@ class Render {
1641
1641
  let iconRequired = !isNullOrUndefined(data.hasFilteredChildRecords)
1642
1642
  ? data.hasFilteredChildRecords : data.hasChildRecords;
1643
1643
  if (iconRequired && !isNullOrUndefined(data.childRecords)) {
1644
- if (this.parent['isFromGantt'] && !this.parent.loadChildOnDemand) {
1644
+ if (this.parent['isFromGantt'] && this.parent.loadChildOnDemand) {
1645
1645
  iconRequired = data.hasChildRecords;
1646
1646
  }
1647
1647
  else {
@@ -2087,12 +2087,12 @@ class DataManipulation {
2087
2087
  this.parent.query.expands = [];
2088
2088
  }
2089
2089
  if (!this.parent.hasChildMapping && !this.parentItems.length &&
2090
- (!this.parent.loadChildOnDemand)) {
2090
+ (this.parent.loadChildOnDemand)) {
2091
2091
  this.zerothLevelData = args;
2092
2092
  setValue('cancel', true, args);
2093
2093
  }
2094
2094
  else {
2095
- if (!this.parent.loadChildOnDemand) {
2095
+ if (this.parent.loadChildOnDemand) {
2096
2096
  for (let rec = 0; rec < records.length; rec++) {
2097
2097
  if (isCountRequired(this.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&
2098
2098
  this.parent.initialRender) {
@@ -2133,22 +2133,22 @@ class DataManipulation {
2133
2133
  else {
2134
2134
  const dataResults = 'dataResults';
2135
2135
  const expandRecord = 'expandRecord';
2136
- if (!isNullOrUndefined(records) && !((this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent[`${dataResults}`][`${expandRecord}`])) &&
2137
- !(isRemoteData(this.parent) && this.parent.loadChildOnDemand && args[`${actionArgs}`].isExpandCollapse && this.parent.enableVirtualization)) {
2136
+ if (!isNullOrUndefined(records) && !((!this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent[`${dataResults}`][`${expandRecord}`])) &&
2137
+ !(isRemoteData(this.parent) && !this.parent.loadChildOnDemand && args[`${actionArgs}`].isExpandCollapse && this.parent.enableVirtualization)) {
2138
2138
  this.convertToFlatData(records);
2139
2139
  }
2140
2140
  }
2141
2141
  }
2142
- if (isRemoteData(this.parent) && this.parent.loadChildOnDemand && args[`${actionArgs}`].isExpandCollapse && this.parent.enableVirtualization) {
2142
+ if (isRemoteData(this.parent) && !this.parent.loadChildOnDemand && args[`${actionArgs}`].isExpandCollapse && this.parent.enableVirtualization) {
2143
2143
  args.result = records;
2144
2144
  }
2145
- else if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {
2145
+ else if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand) {
2146
2146
  args.result = records;
2147
2147
  }
2148
2148
  else {
2149
- args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;
2149
+ args.result = !this.parent.loadChildOnDemand ? this.parent.flatData : records;
2150
2150
  }
2151
- if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand
2151
+ if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand
2152
2152
  && this.parent.grid.aggregates.length && this.parent.grid.sortSettings.columns.length === 0
2153
2153
  && this.parent.grid.filterSettings.columns.length === 0 && !this.parent.grid.searchSettings.key.length) {
2154
2154
  const query = 'query';
@@ -2182,7 +2182,7 @@ class DataManipulation {
2182
2182
  }
2183
2183
  for (let i = 0; i < rowDetails.rows.length; i++) {
2184
2184
  rowDetails.rows[parseInt(i.toString(), 10)].style.display = 'table-row';
2185
- if (this.parent.loadChildOnDemand) {
2185
+ if (!this.parent.loadChildOnDemand) {
2186
2186
  const targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
2187
2187
  childRecord = this.parent.rowTemplate ?
2188
2188
  this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
@@ -2243,7 +2243,7 @@ class DataManipulation {
2243
2243
  let datas = this.parent.grid.currentViewData.slice();
2244
2244
  let inx;
2245
2245
  const idMapping = this.parent.idMapping;
2246
- if (this.parent['isGantt'] && !this.parent.loadChildOnDemand && this.parent.hasChildMapping) {
2246
+ if (this.parent['isGantt'] && this.parent.loadChildOnDemand && this.parent.hasChildMapping) {
2247
2247
  for (let i = 0; i < this.parent.grid.currentViewData.length; i++) {
2248
2248
  if (rowDetails.record[idMapping] === this.parent.grid.currentViewData[i][idMapping]) {
2249
2249
  inx = i;
@@ -2367,7 +2367,7 @@ class DataManipulation {
2367
2367
  this.parentItems.indexOf(result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`]) !== -1)
2368
2368
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
2369
2369
  result[parseInt(r.toString(), 10)].hasChildRecords = true;
2370
- if (this.parent.enableVirtualization && this.parent.loadChildOnDemand) {
2370
+ if (this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {
2371
2371
  for (let i = 0; i < this.parent[`${remoteCollapsedData}`].length; i++) {
2372
2372
  if (result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2373
2373
  result[parseInt(r.toString(), 10)].expanded = this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)]['expanded'];
@@ -2401,7 +2401,7 @@ class DataManipulation {
2401
2401
  else if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action !== 'collapse') {
2402
2402
  result[parseInt(r.toString(), 10)].expanded = true;
2403
2403
  }
2404
- else if (!(this.parent.enableVirtualization && this.parent.loadChildOnDemand)) {
2404
+ else if (!(this.parent.enableVirtualization && !this.parent.loadChildOnDemand)) {
2405
2405
  result[parseInt(r.toString(), 10)].expanded = false;
2406
2406
  }
2407
2407
  }
@@ -2423,7 +2423,7 @@ class DataManipulation {
2423
2423
  }
2424
2424
  }
2425
2425
  if (rowDetails.action === 'remoteExpand' && this.parent.allowPaging && this.parent.pageSettings.pageSizeMode === 'All') {
2426
- this.parent.grid.pageSettings.totalRecordsCount = this.parent.grid.currentViewData.length + result.length;
2426
+ this.parent.grid.pageSettings.totalRecordsCount = this.parent.grid.pageSettings.totalRecordsCount + result.length;
2427
2427
  }
2428
2428
  if (this.parent.enableVirtualization) {
2429
2429
  this.parent.grid.pageSettings.totalRecordsCount = e.count;
@@ -2476,21 +2476,20 @@ class DataManipulation {
2476
2476
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
2477
2477
  currentData.index = this.storedIndex;
2478
2478
  }
2479
- if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
2480
- ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent))) {
2481
- if (!isNullOrUndefined(currentData[this.parent.childMapping])) {
2482
- if (currentData[this.parent.childMapping].length > 0) {
2483
- currentData.hasChildRecords = true;
2484
- }
2485
- else {
2486
- currentData.hasChildRecords = false;
2487
- }
2488
- }
2489
- else {
2490
- currentData.hasChildRecords = true;
2491
- }
2479
+ const childMapping = currentData[this.parent.childMapping];
2480
+ const hasChildren = !isNullOrUndefined(childMapping) && childMapping.length > 0;
2481
+ const shouldCount = isCountRequired(this.parent);
2482
+ const hasChildMapping = currentData[this.parent.hasChildMapping];
2483
+ if ((hasChildren && !shouldCount) || (hasChildMapping && shouldCount)) {
2484
+ currentData.hasChildRecords = true;
2485
+ }
2486
+ else {
2487
+ currentData.hasChildRecords = false;
2488
+ }
2489
+ if ((!isNullOrUndefined(childMapping) && !shouldCount) ||
2490
+ (hasChildMapping) && shouldCount) {
2492
2491
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
2493
- && isNullOrUndefined(currentData[this.parent.childMapping])) {
2492
+ && isNullOrUndefined(childMapping)) {
2494
2493
  currentData.expanded = false;
2495
2494
  }
2496
2495
  else {
@@ -2522,7 +2521,7 @@ class DataManipulation {
2522
2521
  }
2523
2522
  currentData.checkboxState = 'uncheck';
2524
2523
  const remoteCollapsedData = 'remoteCollapsedData';
2525
- if (this.parent.enableVirtualization && this.parent.loadChildOnDemand && isRemoteData(this.parent)
2524
+ if (this.parent.enableVirtualization && !this.parent.loadChildOnDemand && isRemoteData(this.parent)
2526
2525
  && !this.parent.initialRender) {
2527
2526
  if (!currentData.hasChildRecords && isNullOrUndefined(currentData[`${this.parent.parentIdMapping}`])) {
2528
2527
  currentData.hasChildRecords = true;
@@ -3449,6 +3448,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3449
3448
  this.deletedRecords = 'deletedRecords';
3450
3449
  this.addedRecords = 'addedRecords';
3451
3450
  this.indentOutdentAction = 'indentOutdentAction';
3451
+ this.isFromChartSide = false;
3452
3452
  this.modifiedRecords = [];
3453
3453
  this.stackedHeader = false;
3454
3454
  this.objectEqualityChecker = (old, current) => {
@@ -3677,10 +3677,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3677
3677
  * @returns {void}
3678
3678
  */
3679
3679
  sortByColumn(columnName, direction, isMultiSort) {
3680
- if (isNullOrUndefined(columnName) && isNullOrUndefined(direction)) {
3681
- const error = 'The provided value for the columnName and direction is undefined. Please ensure the columnName and direction contains string.';
3682
- this.trigger(actionFailure, { error: error });
3683
- }
3684
3680
  if (this.sortModule) {
3685
3681
  this.sortModule.sortColumn(columnName, direction, isMultiSort);
3686
3682
  }
@@ -3741,10 +3737,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3741
3737
  * @returns {void}
3742
3738
  */
3743
3739
  reorderColumns(fromFName, toFName) {
3744
- if (isNullOrUndefined(fromFName) && isNullOrUndefined(toFName)) {
3745
- const error = 'The provided value for the fromFName and toFName is undefined. Please ensure the fromFName and toFName contains string.';
3746
- this.trigger(actionFailure, { error: error });
3747
- }
3748
3740
  this.grid.reorderColumns(fromFName, toFName);
3749
3741
  }
3750
3742
  TreeGridLocale() {
@@ -3824,8 +3816,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3824
3816
  if (summaryElement !== null) {
3825
3817
  const cellIndex = target.cellIndex;
3826
3818
  const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
3827
- addClass([row], 'e-focused');
3828
- addClass([row], 'e-focus');
3819
+ if (!isNullOrUndefined(row) && !this.grid.isEdit) {
3820
+ addClass([row], 'e-focused');
3821
+ addClass([row], 'e-focus');
3822
+ }
3829
3823
  }
3830
3824
  else {
3831
3825
  this.clearSelection();
@@ -3852,8 +3846,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3852
3846
  const cellIndex = target.cellIndex;
3853
3847
  if (!isNullOrUndefined(cellIndex)) {
3854
3848
  const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
3855
- addClass([row], 'e-focused');
3856
- addClass([row], 'e-focus');
3849
+ if (!isNullOrUndefined(row) && !this.grid.isEdit) {
3850
+ addClass([row], 'e-focused');
3851
+ addClass([row], 'e-focus');
3852
+ }
3857
3853
  }
3858
3854
  }
3859
3855
  else {
@@ -3983,7 +3979,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3983
3979
  name: 'Aggregate'
3984
3980
  });
3985
3981
  }
3986
- if (this.allowResizing) {
3982
+ if (this.resizeCheck()) {
3987
3983
  modules.push({
3988
3984
  member: 'resize', args: [this],
3989
3985
  name: 'Resize'
@@ -4032,6 +4028,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4032
4028
  this.extendRequiredModules(modules);
4033
4029
  return modules;
4034
4030
  }
4031
+ resizeCheck() {
4032
+ const columnMenu = this.showColumnMenu && (!this.columnMenuItems || this.columnMenuItems
4033
+ .filter((c) => c === 'AutoFit' || c === 'AutoFitAll').length) ? true : false;
4034
+ const contextMenu = this.contextMenuItems && this.contextMenuItems
4035
+ .filter((c) => c === 'AutoFit' || c === 'AutoFitAll').length ? true : false;
4036
+ return this.allowResizing || columnMenu || contextMenu;
4037
+ }
4035
4038
  extendRequiredModules(modules) {
4036
4039
  const IsRowDDInjected = this.injectedModules.filter((e) => {
4037
4040
  return e.prototype.getModuleName() === 'rowDragAndDrop';
@@ -4231,9 +4234,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4231
4234
  if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
4232
4235
  failureCases.push('Virtual scrolling is not compatible with the detail template');
4233
4236
  }
4234
- if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
4235
- failureCases.push('Virtual scrolling is not compatible with the detail template');
4236
- }
4237
4237
  if ((this.frozenColumns > 0 || this.columnModel.filter((col) => col.isFrozen) || this.frozenRows > 0)
4238
4238
  && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
4239
4239
  failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
@@ -4406,7 +4406,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4406
4406
  this.trigger(getObject('name', args), args);
4407
4407
  }
4408
4408
  IsExpandCollapseClicked(args) {
4409
- if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
4409
+ if (!this.isFromChartSide && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
4410
4410
  || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
4411
4411
  && !this.selectionSettings.checkboxOnly) {
4412
4412
  if ((!isNullOrUndefined(args.data) && args.data['hasChildRecords']) || (args.rowIndex !== -1 && isNullOrUndefined(args.data))) {
@@ -4428,9 +4428,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4428
4428
  if (this.pageSettings.pageSizeMode === 'Root') {
4429
4429
  this.grid.selectionModule['totalRecordsCount'] = this.grid.currentViewData.length;
4430
4430
  }
4431
- if (this.enableVirtualization && args.rowIndex === this.selectedRowIndex) {
4431
+ if (this.enableVirtualization && args.rowIndex === this.selectedRowIndex && !this.enablePersistence) {
4432
4432
  args.cancel = true;
4433
4433
  }
4434
+ if (!isNullOrUndefined(this.selectionSettings) && !this.selectionSettings.persistSelection &&
4435
+ this.enableVirtualization && args.rowIndex === this.selectedRowIndex && this.isGantt) {
4436
+ args.cancel = false;
4437
+ }
4434
4438
  this.trigger(rowSelecting, args);
4435
4439
  };
4436
4440
  this.grid.rowDeselecting = (args) => {
@@ -5541,7 +5545,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5541
5545
  }
5542
5546
  if (((target.classList.contains('e-flmenu-cancelbtn') || target.classList.contains('e-flmenu-okbtn')
5543
5547
  || target.classList.contains('e-content') || target.classList.contains('e-rowcell'))
5544
- && !isNullOrUndefined(this.filterModule) && this.isReact)) {
5548
+ && !isNullOrUndefined(this.grid.filterModule) && this.isReact)) {
5545
5549
  if (!isNullOrUndefined(this.grid.filterModule['column'])) {
5546
5550
  if (this.grid.filterModule['column'].filterTemplate) {
5547
5551
  const elem = document.getElementById(this.grid.filterModule.filterModule['dlgObj'].element.id);
@@ -5721,10 +5725,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5721
5725
  * @returns {void}
5722
5726
  */
5723
5727
  deleteRow(tr) {
5724
- if (isNullOrUndefined(tr)) {
5725
- const error = 'The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement.';
5726
- this.trigger(actionFailure, { error: error });
5727
- }
5728
5728
  if (this.grid.editModule) {
5729
5729
  this.grid.editModule.deleteRow(tr);
5730
5730
  }
@@ -5750,10 +5750,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5750
5750
  this.grid.setCellValue(key, field, value);
5751
5751
  const rowIndex = this.grid.getRowIndexByPrimaryKey(key);
5752
5752
  const record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
5753
- if (isNullOrUndefined(record)) {
5754
- const error = 'The provided value for the record is undefined. Please ensure the record contains ITreeData.';
5755
- this.trigger(actionFailure, { error: error });
5756
- }
5757
5753
  editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
5758
5754
  }
5759
5755
  /**
@@ -5805,10 +5801,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5805
5801
  * @returns {void}
5806
5802
  */
5807
5803
  goToPage(pageNo) {
5808
- if (isNullOrUndefined(pageNo)) {
5809
- const error = 'The provided value for the pageNo is undefined. Please ensure the pageNo contains number.';
5810
- this.trigger(actionFailure, { error: error });
5811
- }
5812
5804
  if (this.grid.pagerModule) {
5813
5805
  this.grid.pagerModule.goToPage(pageNo);
5814
5806
  }
@@ -5910,10 +5902,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5910
5902
  * @returns {void}
5911
5903
  */
5912
5904
  hideColumns(keys, hideBy) {
5913
- if (isNullOrUndefined(keys)) {
5914
- const error = 'The provided value for the keys is undefined. Please ensure the keys contains string.';
5915
- this.trigger(actionFailure, { error: error });
5916
- }
5917
5905
  this.grid.hideColumns(keys, hideBy);
5918
5906
  this.updateColumnModel();
5919
5907
  }
@@ -6010,6 +5998,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6010
5998
  if (this.grid.columns.length !== this.columnModel.length) {
6011
5999
  this.stackedHeader = true;
6012
6000
  }
6001
+ if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
6002
+ const error = 'Stacked header is not compatible with the detail template';
6003
+ this.trigger(actionFailure, { error: error });
6004
+ }
6013
6005
  if (this.stackedHeader && this.allowResizing && !isNullOrUndefined(this.columns)) {
6014
6006
  this.updateColumnsWidth(this.columns);
6015
6007
  }
@@ -6328,10 +6320,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6328
6320
  */
6329
6321
  expandRow(row, record, key, level) {
6330
6322
  this.isCollapseAll = false;
6331
- if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
6332
- const error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
6333
- this.trigger(actionFailure, { error: error });
6334
- }
6335
6323
  let parentRec = this.parentData;
6336
6324
  if (!this.enableVirtualization) {
6337
6325
  parentRec = this.flatData.filter((e) => {
@@ -6420,7 +6408,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6420
6408
  return e.hasChildRecords;
6421
6409
  });
6422
6410
  }
6423
- else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
6411
+ else if (isNullOrUndefined(record)) {
6424
6412
  if (this.detailTemplate) {
6425
6413
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
6426
6414
  }
@@ -6453,10 +6441,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6453
6441
  */
6454
6442
  collapseRow(row, record, key) {
6455
6443
  this.isExpandAll = false;
6456
- if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
6457
- const error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
6458
- this.trigger(actionFailure, { error: error });
6459
- }
6460
6444
  let parentRec = this.parentData;
6461
6445
  if (!this.enableVirtualization) {
6462
6446
  parentRec = this.flatData.filter((e) => {
@@ -6536,10 +6520,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6536
6520
  * @returns {void}
6537
6521
  */
6538
6522
  expandAtLevel(level) {
6539
- if (isNullOrUndefined(level)) {
6540
- const error = 'The provided value for the level is undefined. Please ensure the level contains number.';
6541
- this.trigger(actionFailure, { error: error });
6542
- }
6543
6523
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
6544
6524
  const rec = this.grid.dataSource.filter((e) => {
6545
6525
  if (e.hasChildRecords && e.level === level) {
@@ -6562,10 +6542,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6562
6542
  * @returns {void}
6563
6543
  */
6564
6544
  expandByKey(key) {
6565
- if (isNullOrUndefined(key)) {
6566
- const error = 'The provided value for the key is undefined. Please ensure the key contains number.';
6567
- this.trigger(actionFailure, { error: error });
6568
- }
6569
6545
  this.expandCollapseActionByKey(key, 'Expand');
6570
6546
  }
6571
6547
  expandAction(record, key, level, isPaging = false) {
@@ -6618,10 +6594,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6618
6594
  * @returns {void}
6619
6595
  */
6620
6596
  collapseAtLevel(level) {
6621
- if (isNullOrUndefined(level)) {
6622
- const error = 'The provided value for the level is undefined. Please ensure the level contains number.';
6623
- this.trigger(actionFailure, { error: error });
6624
- }
6625
6597
  if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
6626
6598
  const record = this.grid.dataSource.filter((e) => {
6627
6599
  if (e.hasChildRecords && e.level === level) {
@@ -6644,10 +6616,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6644
6616
  * @returns {void}
6645
6617
  */
6646
6618
  collapseByKey(key) {
6647
- if (isNullOrUndefined(key)) {
6648
- const error = 'The provided value for the key is undefined. Please ensure the key contains number.';
6649
- this.trigger(actionFailure, { error: error });
6650
- }
6651
6619
  this.expandCollapseActionByKey(key, 'Collapse');
6652
6620
  }
6653
6621
  expandCollapseActionByKey(key, action) {
@@ -6771,14 +6739,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6771
6739
  }
6772
6740
  expandCollapse(action, row, record, isChild) {
6773
6741
  const expandingArgs = { row: row, data: record, childData: [], requestType: action };
6774
- let childRecords;
6775
- if (!isNullOrUndefined(record)) {
6776
- childRecords = this.grid.currentViewData.filter((e) => {
6777
- return e.parentUniqueID === record.uniqueID;
6778
- });
6779
- }
6742
+ const childRecords = this.grid.currentViewData.filter((e) => {
6743
+ return e.parentUniqueID === record.uniqueID;
6744
+ });
6780
6745
  let targetEle;
6781
- if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
6746
+ if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && !this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
6782
6747
  this.updateChildOnDemand(expandingArgs);
6783
6748
  }
6784
6749
  let gridRows = this.getRows();
@@ -6805,7 +6770,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6805
6770
  let displayAction;
6806
6771
  if (action === 'expand') {
6807
6772
  displayAction = 'table-row';
6808
- if (!isChild && !isNullOrUndefined(record)) {
6773
+ if (!isChild) {
6809
6774
  record.expanded = true;
6810
6775
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
6811
6776
  }
@@ -6826,7 +6791,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6826
6791
  }
6827
6792
  else {
6828
6793
  displayAction = 'none';
6829
- if ((!isChild || isCountRequired(this)) && !isNullOrUndefined(row)) {
6794
+ if (!isChild || isCountRequired(this)) {
6830
6795
  record.expanded = false;
6831
6796
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
6832
6797
  }
@@ -6968,7 +6933,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6968
6933
  data.push(expandingArgs.childData[parseInt(j.toString(), 10)]);
6969
6934
  }
6970
6935
  }
6971
- if (isCountRequired(this) && this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
6936
+ if (isCountRequired(this) && !this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
6972
6937
  this.dataResults['expandRecord'] = {};
6973
6938
  this.dataResults['expandRecord'] = expandingArgs.data;
6974
6939
  }
@@ -7125,7 +7090,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7125
7090
  }
7126
7091
  }
7127
7092
  collapseRemoteChild(rowDetails, isChild) {
7128
- if (!isNullOrUndefined(isChild) && !isChild && !this.loadChildOnDemand) {
7093
+ if (!isNullOrUndefined(isChild) && !isChild && this.loadChildOnDemand) {
7129
7094
  rowDetails.record.expanded = false;
7130
7095
  }
7131
7096
  const rows = rowDetails.rows;
@@ -7252,10 +7217,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7252
7217
  * @returns {void}
7253
7218
  */
7254
7219
  filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
7255
- if (isNullOrUndefined(fieldName) && isNullOrUndefined(filterOperator) && isNullOrUndefined(filterValue)) {
7256
- const error = 'The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue.';
7257
- this.trigger(actionFailure, { error: error });
7258
- }
7259
7220
  this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
7260
7221
  }
7261
7222
  /**
@@ -7322,10 +7283,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7322
7283
  * @returns {void}
7323
7284
  */
7324
7285
  paste(data, rowIndex, colIndex) {
7325
- if (isNullOrUndefined(data) && isNullOrUndefined(rowIndex) && isNullOrUndefined(colIndex)) {
7326
- const error = 'The provided value for the index is undefined. Please ensure the index contains number.';
7327
- this.trigger(actionFailure, { error: error });
7328
- }
7329
7286
  this.clipboardModule.paste(data, rowIndex, colIndex);
7330
7287
  }
7331
7288
  /**
@@ -7594,10 +7551,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7594
7551
  * @returns {void}
7595
7552
  */
7596
7553
  reorderRows(fromIndexes, toIndex, position) {
7597
- if (isNullOrUndefined(fromIndexes) && isNullOrUndefined(toIndex) && isNullOrUndefined(position)) {
7598
- const error = 'The provided value for the fromIndexes, toIndex and position is undefined. Please ensure the fromIndexes and toIndex contains number and position contains string.';
7599
- this.trigger(actionFailure, { error: error });
7600
- }
7601
7554
  this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
7602
7555
  }
7603
7556
  /**
@@ -7677,7 +7630,7 @@ __decorate$b([
7677
7630
  Property(false)
7678
7631
  ], TreeGrid.prototype, "allowPaging", void 0);
7679
7632
  __decorate$b([
7680
- Property(false)
7633
+ Property(true)
7681
7634
  ], TreeGrid.prototype, "loadChildOnDemand", void 0);
7682
7635
  __decorate$b([
7683
7636
  Property(false)
@@ -9985,7 +9938,9 @@ class ExcelExport {
9985
9938
  manipulateExportProperties(property, dtSrc, queryResult) {
9986
9939
  //count not required for this query
9987
9940
  let args = Object();
9988
- setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
9941
+ if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
9942
+ setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
9943
+ }
9989
9944
  setValue('isExport', true, args);
9990
9945
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
9991
9946
  setValue('exportType', property.exportType, args);
@@ -11637,6 +11592,9 @@ class BatchEdit {
11637
11592
  if (!isNullOrUndefined(addRowRecord)) {
11638
11593
  addRowIndex = addRowRecord.index;
11639
11594
  }
11595
+ if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
11596
+ addRowIndex = 0;
11597
+ }
11640
11598
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
11641
11599
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
11642
11600
  selectedIndex = -1;
@@ -12155,7 +12113,7 @@ class Edit {
12155
12113
  else if (isRemoteData(this.parent) ||
12156
12114
  (this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {
12157
12115
  const query = this.parent.grid.query;
12158
- if (this.parent['isGantt'] && !this.parent.loadChildOnDemand) {
12116
+ if (this.parent['isGantt'] && this.parent.loadChildOnDemand) {
12159
12117
  this.updateCell(args, rowIndex);
12160
12118
  setValue('isEdit', false, this.parent.grid);
12161
12119
  this.afterCellSave(args, row);
@@ -12511,6 +12469,7 @@ class Edit {
12511
12469
  this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
12512
12470
  }
12513
12471
  }
12472
+ const selectedRecords = this.parent.getSelectedRecords()[0];
12514
12473
  if ((this.isAddedRowByMethod || (this.isAddedRowByContextMenu && this.parent.grid.selectedRowIndex !== -1)) &&
12515
12474
  (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
12516
12475
  this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
@@ -12518,8 +12477,8 @@ class Edit {
12518
12477
  this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
12519
12478
  }
12520
12479
  }
12521
- else {
12522
- this.addRowRecord = this.parent.getSelectedRecords()[0];
12480
+ else if (!isNullOrUndefined(selectedRecords)) {
12481
+ this.addRowRecord = selectedRecords;
12523
12482
  }
12524
12483
  }
12525
12484
  if (this.isAddedRowByMethod && args.index !== 0) {
@@ -13596,6 +13555,7 @@ class VirtualScroll {
13596
13555
  */
13597
13556
  constructor(parent) {
13598
13557
  this.prevstartIndex = -1;
13558
+ this.setEndIndexToGantt = true;
13599
13559
  this.prevendIndex = -1;
13600
13560
  this.prevSelectedRecord = [];
13601
13561
  this.parent = parent;
@@ -13694,11 +13654,16 @@ class VirtualScroll {
13694
13654
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13695
13655
  }
13696
13656
  if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13697
- if ((counts.endIndex + this.parent.pageSettings.pageSize >= counts.count && (this.parent.root && counts.count - counts.endIndex === this.visualData.length - this.parent.root['previousFlatData'].length))
13657
+ if (this.setEndIndexToGantt) {
13658
+ this.ganttEndIndex = counts.endIndex;
13659
+ }
13660
+ if ((counts.endIndex + this.parent.pageSettings.pageSize >= counts.count && (this.parent.root && counts.count - this.ganttEndIndex === this.visualData.length - this.parent.root['previousFlatData'].length))
13698
13661
  || !(this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13699
13662
  startIndex = counts.startIndex + (counts.count - counts.endIndex);
13700
13663
  endIndex = counts.count;
13664
+ this.setEndIndexToGantt = false;
13701
13665
  }
13666
+ this.ganttEndIndex = endIndex;
13702
13667
  this.parent['isAddedFromGantt'] = false;
13703
13668
  }
13704
13669
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&