@syncfusion/ej2-treegrid 29.2.4 → 30.1.37

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 (97) 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 +251 -149
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +311 -178
  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 +15 -51
  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/sort.js +6 -1
  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/interface.d.ts +5 -1
  27. package/src/treegrid/base/treegrid-model.d.ts +8 -1
  28. package/src/treegrid/base/treegrid.d.ts +7 -0
  29. package/src/treegrid/base/treegrid.js +87 -53
  30. package/src/treegrid/renderer/virtual-row-model-generator.js +10 -13
  31. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
  32. package/src/treegrid/renderer/virtual-tree-content-render.js +65 -6
  33. package/styles/bds-lite.css +30 -0
  34. package/styles/bds.css +30 -0
  35. package/styles/bootstrap-dark-lite.css +30 -0
  36. package/styles/bootstrap-dark.css +30 -0
  37. package/styles/bootstrap-lite.css +30 -0
  38. package/styles/bootstrap.css +30 -0
  39. package/styles/bootstrap4-lite.css +30 -0
  40. package/styles/bootstrap4.css +30 -0
  41. package/styles/bootstrap5-dark-lite.css +30 -0
  42. package/styles/bootstrap5-dark.css +30 -0
  43. package/styles/bootstrap5-lite.css +30 -0
  44. package/styles/bootstrap5.3-lite.css +30 -0
  45. package/styles/bootstrap5.3.css +30 -0
  46. package/styles/bootstrap5.css +30 -0
  47. package/styles/fabric-dark-lite.css +30 -0
  48. package/styles/fabric-dark.css +30 -0
  49. package/styles/fabric-lite.css +30 -0
  50. package/styles/fabric.css +30 -0
  51. package/styles/fluent-dark-lite.css +30 -0
  52. package/styles/fluent-dark.css +30 -0
  53. package/styles/fluent-lite.css +30 -0
  54. package/styles/fluent.css +30 -0
  55. package/styles/fluent2-lite.css +30 -0
  56. package/styles/fluent2.css +30 -3
  57. package/styles/highcontrast-light-lite.css +30 -0
  58. package/styles/highcontrast-light.css +30 -0
  59. package/styles/highcontrast-lite.css +30 -0
  60. package/styles/highcontrast.css +30 -0
  61. package/styles/material-dark-lite.css +30 -0
  62. package/styles/material-dark.css +30 -0
  63. package/styles/material-lite.css +30 -0
  64. package/styles/material.css +30 -0
  65. package/styles/material3-dark-lite.css +30 -0
  66. package/styles/material3-dark.css +30 -0
  67. package/styles/material3-lite.css +30 -0
  68. package/styles/material3.css +30 -0
  69. package/styles/tailwind-dark-lite.css +30 -0
  70. package/styles/tailwind-dark.css +30 -0
  71. package/styles/tailwind-lite.css +30 -0
  72. package/styles/tailwind.css +30 -0
  73. package/styles/tailwind3-lite.css +30 -0
  74. package/styles/tailwind3.css +30 -0
  75. package/styles/treegrid/_bigger.scss +66 -66
  76. package/styles/treegrid/_layout.scss +39 -0
  77. package/styles/treegrid/bds.css +30 -0
  78. package/styles/treegrid/bootstrap-dark.css +30 -0
  79. package/styles/treegrid/bootstrap.css +30 -0
  80. package/styles/treegrid/bootstrap4.css +30 -0
  81. package/styles/treegrid/bootstrap5-dark.css +30 -0
  82. package/styles/treegrid/bootstrap5.3.css +30 -0
  83. package/styles/treegrid/bootstrap5.css +30 -0
  84. package/styles/treegrid/fabric-dark.css +30 -0
  85. package/styles/treegrid/fabric.css +30 -0
  86. package/styles/treegrid/fluent-dark.css +30 -0
  87. package/styles/treegrid/fluent.css +30 -0
  88. package/styles/treegrid/fluent2.css +30 -3
  89. package/styles/treegrid/highcontrast-light.css +30 -0
  90. package/styles/treegrid/highcontrast.css +30 -0
  91. package/styles/treegrid/material-dark.css +30 -0
  92. package/styles/treegrid/material.css +30 -0
  93. package/styles/treegrid/material3-dark.css +30 -0
  94. package/styles/treegrid/material3.css +30 -0
  95. package/styles/treegrid/tailwind-dark.css +30 -0
  96. package/styles/treegrid/tailwind.css +30 -0
  97. package/styles/treegrid/tailwind3.css +30 -0
@@ -1,5 +1,5 @@
1
1
  import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, Component, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
2
- import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
2
+ import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { DataManager, ODataAdaptor, WebApiAdaptor, WebMethodAdaptor, CacheAdaptor, UrlAdaptor, Query, DataUtil, RemoteSaveAdaptor, Deferred, JsonAdaptor, Predicate as Predicate$1 } from '@syncfusion/ej2-data';
5
5
  import { showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
@@ -634,12 +634,13 @@ var TreeClipboard = /** @__PURE__ @class */ (function (_super) {
634
634
  if (i > 0) {
635
635
  this.treeCopyContent += '\n';
636
636
  }
637
- if (!rows[selectedIndexes[parseInt(i.toString(), 10)]].classList.contains('e-summaryrow')) {
638
- var cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell'));
637
+ var selectedRowIndex = selectedIndexes[parseInt(i.toString(), 10)];
638
+ if (!rows[selectedRowIndex].classList.contains('e-summaryrow')) {
639
+ var cells = [].slice.call(rows[selectedRowIndex].querySelectorAll('.e-rowcell'));
639
640
  var uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)]["" + uniqueID];
640
641
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
641
642
  if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
642
- this.parentContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], rows, withHeader, i);
643
+ this.parentContentData(currentRecords, selectedRowIndex, rows, withHeader, i);
643
644
  }
644
645
  this["" + getCopyData](cells, false, '\t', withHeader);
645
646
  this.treeCopyContent += this["" + copyContent];
@@ -652,11 +653,7 @@ var TreeClipboard = /** @__PURE__ @class */ (function (_super) {
652
653
  }
653
654
  }
654
655
  if (withHeader) {
655
- var headerTextArray = [];
656
- for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {
657
- headerTextArray[parseInt(i.toString(), 10)] =
658
- this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].headerText;
659
- }
656
+ var headerTextArray = this.treeGridParent.getVisibleColumns().map(function (col) { return col.headerText; });
660
657
  this["" + getCopyData](headerTextArray, false, '\t', withHeader);
661
658
  this.treeCopyContent = this["" + copyContent] + '\n' + this.treeCopyContent;
662
659
  }
@@ -2275,6 +2272,15 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2275
2272
  if (parentRec) {
2276
2273
  records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
2277
2274
  }
2275
+ else {
2276
+ var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
2277
+ if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
2278
+ records[parseInt(rec.toString(), 10)].level = 1;
2279
+ }
2280
+ else {
2281
+ records[parseInt(rec.toString(), 10)].level = parentRec_1.level + 1;
2282
+ }
2283
+ }
2278
2284
  }
2279
2285
  else {
2280
2286
  records[parseInt(rec.toString(), 10)].level = 0;
@@ -2376,33 +2382,33 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2376
2382
  var _this = this;
2377
2383
  var args = { row: rowDetails.parentRow, data: rowDetails.record };
2378
2384
  var dm = this.parent.dataSource;
2379
- var qry = this.parent.grid.getDataModule().generateQuery();
2380
- var clonequries = qry.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
2381
- qry.queries = clonequries;
2382
- qry.isCountRequired = true;
2385
+ var query = this.parent.grid.getDataModule().generateQuery();
2386
+ var clonequries = query.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
2387
+ query.queries = clonequries;
2388
+ query.isCountRequired = true;
2383
2389
  var idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
2384
2390
  if (isNaN(idMappingValue)) {
2385
2391
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
2386
2392
  }
2387
2393
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2388
- qry.take(this.parent.pageSettings.pageSize);
2394
+ query.take(this.parent.grid.pageSettings.pageSize);
2389
2395
  var expandDetail = [];
2390
2396
  expandDetail.push('ExpandingAction', idMappingValue.toString());
2391
- qry.expand(expandDetail);
2397
+ query.expand(expandDetail);
2392
2398
  }
2393
2399
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
2394
- qry.take(this.parent.grid.pageSettings.pageSize);
2400
+ query.take(this.parent.grid.pageSettings.pageSize);
2395
2401
  var expandDetail = [];
2396
2402
  expandDetail.push('CollapsingAction', idMappingValue.toString());
2397
- qry.expand(expandDetail);
2403
+ query.expand(expandDetail);
2398
2404
  }
2399
- qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2405
+ query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2400
2406
  if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
2401
2407
  var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
2402
- qry.queries.push(filterqry[0]);
2408
+ query.queries.push(filterqry[0]);
2403
2409
  }
2404
2410
  showSpinner(this.parent.element);
2405
- dm.executeQuery(qry).then(function (e) {
2411
+ dm.executeQuery(query).then(function (e) {
2406
2412
  var remoteExpandedData = 'remoteExpandedData';
2407
2413
  var remoteCollapsedData = 'remoteCollapsedData';
2408
2414
  var level = 'level';
@@ -2465,7 +2471,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2465
2471
  else {
2466
2472
  rowDetails.record.childRecords = result;
2467
2473
  }
2468
- for (var r = 0; r < result.length; r++) {
2474
+ var _loop_2 = function (r) {
2469
2475
  var record = result[parseInt(r.toString(), 10)];
2470
2476
  if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
2471
2477
  _this.parent["" + remoteExpandedData].push(rowDetails.record);
@@ -2575,8 +2581,18 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2575
2581
  record.expanded = false;
2576
2582
  }
2577
2583
  }
2578
- datas.splice(inx + r + 1, 0, record);
2584
+ var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
2585
+ if (!exists) {
2586
+ datas.splice(inx + r + 1, 0, record);
2587
+ }
2588
+ };
2589
+ for (var r = 0; r < result.length; r++) {
2590
+ _loop_2(r);
2579
2591
  }
2592
+ var localIdMapping = _this.parent.idMapping;
2593
+ datas.sort(function (firstRecord, secondRecord) {
2594
+ return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
2595
+ });
2580
2596
  setValue('result', datas, e);
2581
2597
  setValue('action', 'beforecontentrender', e);
2582
2598
  _this.parent.trigger(actionComplete, e);
@@ -2619,7 +2635,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2619
2635
  var contentModule = getValue('grid.contentModule', this.parent);
2620
2636
  var currentInfo = getValue('currentInfo', contentModule);
2621
2637
  var prevInfo = getValue('prevInfo', contentModule);
2622
- if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {
2638
+ if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
2639
+ && !this.parent.loadChildOnDemand) {
2623
2640
  this.parent.grid.pageSettings.currentPage = prevInfo.page;
2624
2641
  }
2625
2642
  };
@@ -3610,7 +3627,9 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3610
3627
  }
3611
3628
  else {
3612
3629
  if (!isNullOrUndefined(child) && record["" + key] !== child["" + key]) {
3613
- record.childRecords.push(child);
3630
+ if (!record.childRecords.some(function (records) { return records.uniqueID === child.uniqueID; })) {
3631
+ record.childRecords.push(child);
3632
+ }
3614
3633
  }
3615
3634
  }
3616
3635
  if (record.childRecords.indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
@@ -4108,7 +4127,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4108
4127
  parentTarget = target.parentElement;
4109
4128
  if (!isNullOrUndefined(parentTarget)) {
4110
4129
  var cellIndex = parentTarget.cellIndex;
4111
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4130
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4112
4131
  parentTarget = target;
4113
4132
  }
4114
4133
  summaryElement = this.findnextRowElement(parentTarget);
@@ -4116,8 +4135,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4116
4135
  var cellIndex_1 = target.cellIndex;
4117
4136
  var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
4118
4137
  if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
4119
- addClass([row_1], 'e-focused');
4120
- addClass([row_1], 'e-focus');
4138
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
4139
+ focusedCells.forEach(function (cell) {
4140
+ removeClass([cell], ['e-focused', 'e-focus']);
4141
+ });
4142
+ addClass([row_1], ['e-focused', 'e-focus']);
4121
4143
  }
4122
4144
  }
4123
4145
  else {
@@ -4137,7 +4159,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4137
4159
  parentTarget = target.parentElement;
4138
4160
  if (!isNullOrUndefined(parentTarget)) {
4139
4161
  var cellIndex = parentTarget.cellIndex;
4140
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4162
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4141
4163
  parentTarget = target;
4142
4164
  }
4143
4165
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -4146,8 +4168,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4146
4168
  if (!isNullOrUndefined(cellIndex_2)) {
4147
4169
  var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
4148
4170
  if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
4149
- addClass([row_2], 'e-focused');
4150
- addClass([row_2], 'e-focus');
4171
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
4172
+ focusedCells.forEach(function (cell) {
4173
+ removeClass([cell], ['e-focused', 'e-focus']);
4174
+ });
4175
+ addClass([row_2], ['e-focused', 'e-focus']);
4151
4176
  }
4152
4177
  }
4153
4178
  }
@@ -4514,11 +4539,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4514
4539
  var destroyTemplate = 'destroyTemplate';
4515
4540
  var destroyTemplateFn = this.grid["" + destroyTemplate];
4516
4541
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4517
- this.grid["" + destroyTemplate] = function (args, index) {
4542
+ this.grid["" + destroyTemplate] = function (args, index, callback) {
4518
4543
  destroyTemplateFn.apply(_this.grid);
4519
4544
  var portals = 'portals';
4520
4545
  if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
4521
- _this.clearTemplate(args, index);
4546
+ _this.clearTemplate(args, index, callback);
4547
+ }
4548
+ else if (!isNullOrUndefined(callback)) {
4549
+ callback();
4522
4550
  }
4523
4551
  };
4524
4552
  };
@@ -4614,18 +4642,24 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4614
4642
  this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
4615
4643
  };
4616
4644
  TreeGrid.prototype.convertTreeData = function (data) {
4617
- var _this = this;
4618
4645
  if (isCountRequired(this)) {
4619
4646
  data = getValue('result', data);
4620
4647
  }
4621
4648
  if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
4622
4649
  this.flatData = data;
4623
- this.flatData.filter(function (e) {
4624
- setValue('uniqueIDCollection.' + e.uniqueID, e, _this);
4625
- if (e.level === 0 && !_this.parentData.some(function (record) { return record.uniqueID === e.uniqueID; })) {
4626
- _this.parentData.push(e);
4650
+ var _loop_1 = function (i, len) {
4651
+ var rowData = this_1.flatData[parseInt(i.toString(), 10)];
4652
+ setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
4653
+ if (rowData.level === 0 && !this_1.parentData.some(function (record) {
4654
+ return record.uniqueID === rowData.uniqueID;
4655
+ })) {
4656
+ this_1.parentData.push(rowData);
4627
4657
  }
4628
- });
4658
+ };
4659
+ var this_1 = this;
4660
+ for (var i = 0, len = this.flatData.length; i < len; i++) {
4661
+ _loop_1(i, len);
4662
+ }
4629
4663
  }
4630
4664
  else {
4631
4665
  if (isCountRequired(this)) {
@@ -4715,6 +4749,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4715
4749
  this.grid["" + isJsComponent] = true;
4716
4750
  var enableHtmlSanitizer = 'enableHtmlSanitizer';
4717
4751
  this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
4752
+ this.grid.enableStickyHeader = this.enableStickyHeader;
4753
+ var isTreeGrid = 'isTreeGrid';
4754
+ this.grid["" + isTreeGrid] = true;
4718
4755
  };
4719
4756
  TreeGrid.prototype.triggerEvents = function (args) {
4720
4757
  this.trigger(getObject('name', args), args);
@@ -4852,6 +4889,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4852
4889
  TreeGrid.prototype.extendedGridDataBoundEvent = function () {
4853
4890
  var _this = this;
4854
4891
  this.grid.dataBound = function (args) {
4892
+ _this.lastRowBorderEventListener();
4855
4893
  _this.updateRowTemplate();
4856
4894
  _this.updateColumnModel();
4857
4895
  _this.updateAltRow(_this.getRows());
@@ -4944,6 +4982,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4944
4982
  }
4945
4983
  };
4946
4984
  };
4985
+ TreeGrid.prototype.lastRowBorderEventListener = function () {
4986
+ this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
4987
+ };
4947
4988
  TreeGrid.prototype.bindCallBackEvents = function () {
4948
4989
  var _this = this;
4949
4990
  this.grid.toolbarClick = function (args) {
@@ -5111,6 +5152,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5111
5152
  if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
5112
5153
  args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
5113
5154
  args.cancel = true;
5155
+ return;
5114
5156
  }
5115
5157
  var requestType = getObject('requestType', args);
5116
5158
  if (requestType === 'reorder') {
@@ -5171,12 +5213,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5171
5213
  _this.grid.refresh();
5172
5214
  }
5173
5215
  if (args.action === 'filter') {
5174
- if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
5216
+ if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
5175
5217
  _this.expandAll();
5176
5218
  }
5177
5219
  }
5178
5220
  if (args.requestType === 'searching') {
5179
- if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
5221
+ if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
5180
5222
  _this.expandAll();
5181
5223
  }
5182
5224
  }
@@ -5301,6 +5343,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5301
5343
  * @returns {void}
5302
5344
  */
5303
5345
  TreeGrid.prototype.autoGenerateColumns = function () {
5346
+ var _this = this;
5304
5347
  if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
5305
5348
  this.columns = [];
5306
5349
  // if (this.dataSource instanceof DataManager) {
@@ -5309,11 +5352,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5309
5352
  var record = this.dataSource[0];
5310
5353
  // }
5311
5354
  var keys = Object.keys(record);
5312
- for (var i = 0; i < keys.length; i++) {
5313
- if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
5314
- this.columns.push(keys[parseInt(i.toString(), 10)]);
5315
- }
5316
- }
5355
+ this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
5317
5356
  }
5318
5357
  };
5319
5358
  TreeGrid.prototype.getGridEditSettings = function () {
@@ -5467,8 +5506,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5467
5506
  gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
5468
5507
  }
5469
5508
  else {
5470
- for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
5471
- var prop = _a[_i];
5509
+ var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
5510
+ for (var j = 0; j < columnProps.length; j++) {
5511
+ var prop = columnProps[parseInt(j.toString(), 10)];
5472
5512
  if (index === this.treeColumnIndex && prop === 'template') {
5473
5513
  treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
5474
5514
  }
@@ -5639,6 +5679,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5639
5679
  break;
5640
5680
  case 'rowHeight':
5641
5681
  this.grid.rowHeight = this.rowHeight;
5682
+ this.refresh();
5642
5683
  break;
5643
5684
  case 'height':
5644
5685
  if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
@@ -5714,6 +5755,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5714
5755
  case 'columnMenuItems':
5715
5756
  this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
5716
5757
  break;
5758
+ case 'enableStickyHeader':
5759
+ this.grid.enableStickyHeader = this.enableStickyHeader;
5760
+ break;
5717
5761
  case 'editSettings':
5718
5762
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
5719
5763
  (newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
@@ -6601,14 +6645,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6601
6645
  * @returns {Column[]} - Returns an array of visible column objects.
6602
6646
  */
6603
6647
  TreeGrid.prototype.getVisibleColumns = function () {
6604
- var cols = [];
6605
- for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {
6606
- var col = _a[_i];
6607
- if (col.visible) {
6608
- cols.push(col);
6609
- }
6610
- }
6611
- return cols;
6648
+ return this.columnModel.filter(function (col) { return col.visible; });
6612
6649
  };
6613
6650
  /**
6614
6651
  * Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
@@ -6736,17 +6773,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6736
6773
  TreeGrid.prototype.getTreeColumn = function () {
6737
6774
  var columnModel = 'columnModel';
6738
6775
  var treeColumn = this["" + columnModel][this.treeColumnIndex];
6739
- var treeIndex;
6740
6776
  var updatedCols = this.getColumns();
6741
- for (var f = 0; f < updatedCols.length; f++) {
6742
- var treeColumnfield = getObject('field', treeColumn);
6743
- var parentColumnfield = getObject('field', updatedCols[parseInt(f.toString(), 10)]);
6744
- if (treeColumnfield === parentColumnfield) {
6745
- treeIndex = f;
6746
- break;
6747
- }
6777
+ var treeColumnField = getObject('field', treeColumn);
6778
+ var treeIndex = updatedCols.findIndex(function (col) {
6779
+ return getObject('field', col) === treeColumnField;
6780
+ });
6781
+ if (!isNullOrUndefined(treeIndex)) {
6782
+ this.setProperties({ treeColumnIndex: treeIndex }, true);
6748
6783
  }
6749
- this.setProperties({ treeColumnIndex: treeIndex }, true);
6750
6784
  };
6751
6785
  /**
6752
6786
  * Refreshes the header section of the TreeGrid to reflect any structural or data changes.
@@ -7069,14 +7103,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7069
7103
  };
7070
7104
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
7071
7105
  if (isPaging === void 0) { isPaging = false; }
7072
- var _loop_1 = function (i) {
7106
+ var _loop_2 = function (i) {
7073
7107
  if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
7074
7108
  var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
7075
- var parentItem = this_1.flatData.filter(function (e) {
7109
+ var parentItem = this_2.flatData.filter(function (e) {
7076
7110
  return e.uniqueID === puniqueID_1;
7077
7111
  });
7078
- if (isRemoteData(this_1)) {
7079
- parentItem = this_1.getCurrentViewRecords().filter(function (e) {
7112
+ if (isRemoteData(this_2)) {
7113
+ parentItem = this_2.getCurrentViewRecords().filter(function (e) {
7080
7114
  return e.uniqueID === puniqueID_1;
7081
7115
  });
7082
7116
  }
@@ -7085,7 +7119,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7085
7119
  parentItem[0].expanded = true;
7086
7120
  }
7087
7121
  else {
7088
- if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
7122
+ if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
7089
7123
  if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
7090
7124
  record.push(parentItem[0]);
7091
7125
  }
@@ -7093,12 +7127,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7093
7127
  }
7094
7128
  }
7095
7129
  if (!isPaging) {
7096
- this_1.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
7130
+ this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
7097
7131
  }
7098
7132
  };
7099
- var this_1 = this;
7133
+ var this_2 = this;
7100
7134
  for (var i = 0; i < record.length; i++) {
7101
- _loop_1(i);
7135
+ _loop_2(i);
7102
7136
  }
7103
7137
  if (isPaging) {
7104
7138
  this.expandRow(null, record, key, level);
@@ -7202,8 +7236,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7202
7236
  if (this.editSettings.mode === 'Batch') {
7203
7237
  var obj = 'dialogObj';
7204
7238
  var showDialog = 'showDialog';
7205
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
7206
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
7239
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
7240
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
7241
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
7242
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
7243
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
7244
+ if (hasChanges && this.editSettings.showConfirmDialog) {
7207
7245
  var dialogObj = this.grid.editModule["" + obj];
7208
7246
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
7209
7247
  return;
@@ -7229,8 +7267,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7229
7267
  if (this.editSettings.mode === 'Batch') {
7230
7268
  var obj = 'dialogObj';
7231
7269
  var showDialog = 'showDialog';
7232
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
7233
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
7270
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
7271
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
7272
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
7273
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
7274
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
7275
+ if (hasChanges && this.editSettings.showConfirmDialog) {
7234
7276
  var dialogObj = this.grid.editModule["" + obj];
7235
7277
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
7236
7278
  return;
@@ -7520,6 +7562,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7520
7562
  TreeGrid.prototype.remoteExpand = function (action, row, record) {
7521
7563
  var gridRows = this.getRows();
7522
7564
  var fetchRemoteChildData = 'fetchRemoteChildData';
7565
+ var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
7566
+ this.grid.contentModule.requestType = requestType;
7523
7567
  if (this.rowTemplate) {
7524
7568
  var rows_1 = this.getContentTable().rows;
7525
7569
  gridRows = [].slice.call(rows_1);
@@ -7594,6 +7638,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7594
7638
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
7595
7639
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
7596
7640
  }
7641
+ if (this.detailTemplate) {
7642
+ gridRows.forEach(function (row) {
7643
+ if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
7644
+ row.style.display = '';
7645
+ }
7646
+ });
7647
+ }
7597
7648
  var detailrows = gridRows.filter(function (r) {
7598
7649
  return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
7599
7650
  });
@@ -7758,7 +7809,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7758
7809
  TreeGrid.prototype.addListener = function () {
7759
7810
  this.on('updateResults', this.updateResultModel, this);
7760
7811
  this.grid.on('initial-end', this.afterGridRender, this);
7761
- this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
7762
7812
  };
7763
7813
  TreeGrid.prototype.updateResultModel = function (returnResult) {
7764
7814
  this.dataResults = returnResult;
@@ -8351,6 +8401,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8351
8401
  __decorate$b([
8352
8402
  Property(false)
8353
8403
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
8404
+ __decorate$b([
8405
+ Property(false)
8406
+ ], TreeGrid.prototype, "enableStickyHeader", void 0);
8354
8407
  __decorate$b([
8355
8408
  Property('auto')
8356
8409
  ], TreeGrid.prototype, "height", void 0);
@@ -10335,6 +10388,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
10335
10388
  * @returns {void} - This method does not return a value.
10336
10389
  */
10337
10390
  RowDD.prototype.removeRecords = function (record) {
10391
+ var _this = this;
10338
10392
  var tObj = this.parent;
10339
10393
  var dataSource;
10340
10394
  if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {
@@ -10362,20 +10416,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
10362
10416
  if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {
10363
10417
  this.removeChildItem(deletedRow);
10364
10418
  }
10365
- var idx = void 0;
10366
- var idz = void 0;
10367
10419
  var treeGridData = dataSource;
10368
- for (var i = 0; i < treeGridData.length; i++) {
10369
- if (treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
10370
- idx = i;
10371
- }
10372
- }
10373
- for (var i = 0; i < this.treeGridData.length; i++) {
10374
- if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
10375
- === deletedRow.taskData[this.parent.idMapping]) {
10376
- idz = i;
10377
- }
10378
- }
10420
+ var idx = treeGridData.findIndex(function (data) {
10421
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
10422
+ });
10423
+ var idz = this.treeGridData.findIndex(function (data) {
10424
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
10425
+ });
10379
10426
  if (idx !== -1 && !isNullOrUndefined(idx)) {
10380
10427
  dataSource.splice(idx, 1);
10381
10428
  }
@@ -10645,19 +10692,13 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10645
10692
  return _super.prototype.getData.call(this);
10646
10693
  };
10647
10694
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
10648
- if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
10649
- notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
10650
- this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
10651
- }
10652
- else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
10653
- notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
10654
- this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
10655
- }
10656
10695
  var info = this.getDataInfo();
10657
- if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
10696
+ if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
10697
+ notifyArgs.virtualInfo = this['prevInfo'];
10698
+ }
10699
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
10658
10700
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
10659
- if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
10660
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
10701
+ if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
10661
10702
  || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10662
10703
  notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10663
10704
  }
@@ -10701,7 +10742,10 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10701
10742
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
10702
10743
  this.cache[parseInt(currentPage.toString(), 10)].length >
10703
10744
  (this.parent.contentModule).getBlockSize()) {
10704
- delete this.cache[parseInt(currentPage.toString(), 10)];
10745
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
10746
+ this.cache[parseInt(currentPage.toString(), 10)] =
10747
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
10748
+ }
10705
10749
  }
10706
10750
  }
10707
10751
  else {
@@ -10789,11 +10833,11 @@ var Filter = /** @__PURE__ @class */ (function () {
10789
10833
  this.filteredParentRecs = [];
10790
10834
  this.filteredResult = [];
10791
10835
  this.isHierarchyFilter = false;
10836
+ var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10837
+ : this.parent.searchSettings.hierarchyMode;
10792
10838
  for (var f = 0; f < this.flatFilteredData.length; f++) {
10793
10839
  var rec = this.flatFilteredData[parseInt(f.toString(), 10)];
10794
10840
  this.addParentRecord(rec);
10795
- var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10796
- : this.parent.searchSettings.hierarchyMode;
10797
10841
  if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&
10798
10842
  (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {
10799
10843
  this.isHierarchyFilter = true;
@@ -10805,8 +10849,6 @@ var Filter = /** @__PURE__ @class */ (function () {
10805
10849
  var parent_1 = getObject('parentItem', rec);
10806
10850
  if (!isNullOrUndefined(parent_1)) {
10807
10851
  var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);
10808
- //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {
10809
- // return e.uniqueID === rec.parentItem.uniqueID; })[0];
10810
10852
  setValue('hasFilteredChildRecords', true, parRecord);
10811
10853
  if (parRecord && parRecord.parentItem) {
10812
10854
  this.updateParentFilteredRecord(parRecord);
@@ -10830,7 +10872,6 @@ var Filter = /** @__PURE__ @class */ (function () {
10830
10872
  };
10831
10873
  Filter.prototype.addParentRecord = function (record) {
10832
10874
  var parent = getParentData(this.parent, record.parentUniqueID);
10833
- //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];
10834
10875
  var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10835
10876
  : this.parent.searchSettings.hierarchyMode;
10836
10877
  if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0
@@ -11597,8 +11638,8 @@ var Toolbar = /** @__PURE__ @class */ (function () {
11597
11638
  }
11598
11639
  row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
11599
11640
  if (indentEle !== null && outdentEle !== null) {
11600
- indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
11601
- outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
11641
+ indentElement = indentEle.parentElement;
11642
+ outdentElement = outdentEle.parentElement;
11602
11643
  if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
11603
11644
  indentElement.classList.add('e-hidden');
11604
11645
  outdentElement.classList.add('e-hidden');
@@ -11732,14 +11773,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
11732
11773
  Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {
11733
11774
  this.summaryQuery = summaryQuery;
11734
11775
  var parentRecord;
11735
- var parentDataLength = Object.keys(filteredData).length;
11736
- var parentData = [];
11737
- for (var p = 0, len = parentDataLength; p < len; p++) {
11738
- var summaryRow = getObject('isSummaryRow', filteredData[parseInt(p.toString(), 10)]);
11739
- if (!summaryRow) {
11740
- parentData.push(filteredData[parseInt(p.toString(), 10)]);
11741
- }
11742
- }
11776
+ var parentData = filteredData.filter(function (data) { return !getObject('isSummaryRow', data); });
11743
11777
  var parentRecords = findParentRecords(parentData);
11744
11778
  var flatRecords = parentData.slice();
11745
11779
  var summaryLength = Object.keys(this.parent.aggregates).length;
@@ -11897,14 +11931,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
11897
11931
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
11898
11932
  }
11899
11933
  var value = single["" + summaryColumn.columnName]["" + summaryKey];
11900
- var summaryValue;
11901
- if (cellElement.innerHTML.indexOf(value) === -1) {
11902
- summaryValue = cellElement.innerHTML + value;
11903
- return summaryValue;
11904
- }
11905
- else {
11906
- return cellElement.innerHTML;
11907
- }
11934
+ return cellElement.innerHTML.indexOf(value) === -1 ? cellElement.innerHTML + value : cellElement.innerHTML;
11908
11935
  };
11909
11936
  Aggregate.prototype.getFormatFromType = function (summaryformat, type) {
11910
11937
  if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {
@@ -11987,8 +12014,13 @@ var Sort = /** @__PURE__ @class */ (function () {
11987
12014
  this.flatSortedData = [];
11988
12015
  };
11989
12016
  Sort.prototype.iterateSort = function (data, srtQry) {
12017
+ var gridQuery = this.parent.query;
12018
+ var filterQuery = [];
12019
+ if (!isNullOrUndefined(gridQuery)) {
12020
+ filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
12021
+ }
11990
12022
  for (var d = 0; d < data.length; d++) {
11991
- if (this.parent.grid.filterSettings.columns.length > 0 || this.parent.grid.searchSettings.key !== '') {
12023
+ if (filterQuery.length > 0 || this.parent.grid.filterSettings.columns.length > 0 || this.parent.grid.searchSettings.key !== '') {
11992
12024
  if (!isNullOrUndefined(getParentData(this.parent, data[parseInt(d.toString(), 10)].uniqueID, true))) {
11993
12025
  this.storedIndex++;
11994
12026
  this.flatSortedData[this.storedIndex] = data[parseInt(d.toString(), 10)];
@@ -12271,6 +12303,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12271
12303
  this.parent.on('batchCancelAction', this.batchCancelAction, this);
12272
12304
  this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);
12273
12305
  this.parent.grid.on('next-cell-index', this.nextCellIndex, this);
12306
+ this.parent.grid.on('cellfocused', this.onCellFocused, this);
12274
12307
  };
12275
12308
  /**
12276
12309
  * @hidden
@@ -12290,6 +12323,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12290
12323
  this.parent.off('batchCancelAction', this.batchCancelAction);
12291
12324
  this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);
12292
12325
  this.parent.grid.off('next-cell-index', this.nextCellIndex);
12326
+ this.parent.grid.off('cellfocused', this.onCellFocused);
12293
12327
  };
12294
12328
  /**
12295
12329
  * To destroy the editModule
@@ -12329,14 +12363,18 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12329
12363
  return this.batchChildCount;
12330
12364
  };
12331
12365
  BatchEdit.prototype.batchPageAction = function () {
12366
+ var _this = this;
12332
12367
  var data = (this.parent.grid.dataSource instanceof DataManager ?
12333
12368
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
12334
- var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12369
+ var primaryKeyField = this.parent.grid.getPrimaryKeyFieldNames()[0];
12335
12370
  var index;
12336
12371
  if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
12337
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
12338
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12372
+ var _loop_1 = function (i) {
12373
+ index = data.findIndex(function (e) { return e["" + primaryKeyField] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]; });
12339
12374
  data.splice(index, 1);
12375
+ };
12376
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
12377
+ _loop_1(i);
12340
12378
  }
12341
12379
  }
12342
12380
  this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
@@ -12561,11 +12599,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12561
12599
  }
12562
12600
  childs.push(data);
12563
12601
  records = childs;
12564
- for (var i = 0; i < records.length; i++) {
12565
- var indexvalue = this.batchRecords.map(function (e) { return e["" + primarykey]; }).indexOf(records[parseInt(i.toString(), 10)]["" + primarykey]);
12602
+ var _loop_2 = function (i) {
12603
+ var indexvalue = this_1.batchRecords.findIndex(function (e) { return e["" + primarykey] === records[parseInt(i.toString(), 10)]["" + primarykey]; });
12566
12604
  if (indexvalue !== -1) {
12567
- this.batchRecords.splice(indexvalue, 1);
12605
+ this_1.batchRecords.splice(indexvalue, 1);
12568
12606
  }
12607
+ };
12608
+ var this_1 = this;
12609
+ for (var i = 0; i < records.length; i++) {
12610
+ _loop_2(i);
12569
12611
  }
12570
12612
  for (var i = 0; i < row.length; i++) {
12571
12613
  if (!isNullOrUndefined(row[parseInt(i.toString(), 10)])) {
@@ -12581,11 +12623,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12581
12623
  };
12582
12624
  BatchEdit.prototype.updateChildCount = function (records) {
12583
12625
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12584
- var addedRecords = 'addedRecords';
12626
+ var addedRecords = this.parent.getBatchChanges().addedRecords || [];
12585
12627
  var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
12586
- for (var i = 0; i < this.parent.getBatchChanges()["" + addedRecords].length; i++) {
12587
- if (!isNullOrUndefined(this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem])) {
12588
- if (this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
12628
+ for (var i = 0; i < addedRecords.length; i++) {
12629
+ if (!isNullOrUndefined(addedRecords[parseInt(i.toString(), 10)]["" + parentItem])) {
12630
+ if (addedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
12589
12631
  this.batchChildCount = this.batchChildCount + 1;
12590
12632
  }
12591
12633
  }
@@ -12622,6 +12664,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12622
12664
  delete this.parent["" + id]["" + value];
12623
12665
  };
12624
12666
  BatchEdit.prototype.batchCancelAction = function () {
12667
+ var _this = this;
12625
12668
  var targetElement = 'targetElement';
12626
12669
  var index;
12627
12670
  var parentItem = 'parentItem';
@@ -12632,24 +12675,28 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12632
12675
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
12633
12676
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12634
12677
  if (!isNullOrUndefined(this.batchAddedRecords)) {
12635
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
12636
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12678
+ var _loop_3 = function (i) {
12679
+ index = data.findIndex(function (e) { return e["" + primaryKey] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]; });
12637
12680
  if (index !== -1) {
12638
12681
  data.splice(index, 1);
12639
12682
  }
12640
- if (this.parent.editSettings.newRowPosition === 'Child') {
12683
+ if (this_2.parent.editSettings.newRowPosition === 'Child') {
12641
12684
  index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
12642
- .indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
12643
- : this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12685
+ .indexOf(this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
12686
+ : this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12644
12687
  if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
12645
12688
  var children = currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords];
12646
12689
  for (var j = 0; children && j < children.length; j++) {
12647
- if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
12648
- currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords].splice(j, 1);
12690
+ if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
12691
+ children.splice(j, 1);
12649
12692
  }
12650
12693
  }
12651
12694
  }
12652
12695
  }
12696
+ };
12697
+ var this_2 = this;
12698
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
12699
+ _loop_3(i);
12653
12700
  }
12654
12701
  }
12655
12702
  if (!isNullOrUndefined(this.parent["" + targetElement])) {
@@ -12695,7 +12742,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12695
12742
  var selectedIndex = void 0;
12696
12743
  var addRowIndex = void 0;
12697
12744
  var columnName = void 0;
12698
- var addRowRecord = void 0;
12745
+ var addRowRecord_1;
12699
12746
  var childRecords = 'childRecords';
12700
12747
  if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {
12701
12748
  addRecords.reverse();
@@ -12748,17 +12795,17 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12748
12795
  this.parent.editModule['previousNewRowPosition'] = rowPosition;
12749
12796
  }
12750
12797
  addRecords[parseInt(i.toString(), 10)].taskData = taskData;
12751
- addRowRecord = this.batchAddRowRecord[parseInt(i.toString(), 10)];
12752
- if (isNullOrUndefined(addRowRecord)) {
12753
- addRowRecord = this.batchAddRowRecord[i - 1];
12798
+ addRowRecord_1 = this.batchAddRowRecord[parseInt(i.toString(), 10)];
12799
+ if (isNullOrUndefined(addRowRecord_1)) {
12800
+ addRowRecord_1 = this.batchAddRowRecord[i - 1];
12754
12801
  }
12755
12802
  if (this.isSelfReference) {
12756
12803
  if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {
12757
12804
  updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);
12758
12805
  }
12759
12806
  }
12760
- if (!isNullOrUndefined(addRowRecord)) {
12761
- addRowIndex = addRowRecord.index;
12807
+ if (!isNullOrUndefined(addRowRecord_1)) {
12808
+ addRowIndex = addRowRecord_1.index;
12762
12809
  }
12763
12810
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
12764
12811
  addRowIndex = 0;
@@ -12766,26 +12813,30 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12766
12813
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
12767
12814
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
12768
12815
  selectedIndex = -1;
12769
- addRowRecord = null;
12816
+ addRowRecord_1 = null;
12770
12817
  }
12771
12818
  }
12772
- editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
12819
+ editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
12773
12820
  selectedIndex = null;
12774
12821
  if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)]["" + parentItem]) &&
12775
12822
  (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
12776
12823
  var indexValue = currentViewRecords.map(function (e) { return e["" + primarykey_1]; })
12777
12824
  .indexOf(addRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primarykey_1]);
12778
12825
  var children = currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords];
12779
- for (var j = 0; j < children.length; j++) {
12780
- if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
12781
- currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
12826
+ if (!isNullOrUndefined(addRowIndex) && children.some(function (records) {
12827
+ return records.uniqueID === addRowRecord_1.uniqueID;
12828
+ })) {
12829
+ for (var j = 0; j < children.length; j++) {
12830
+ if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
12831
+ currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
12832
+ }
12782
12833
  }
12783
12834
  }
12784
12835
  }
12785
12836
  }
12786
12837
  if (batchChanges["" + deletedRecords].length) {
12787
12838
  for (i = 0; i < batchChanges["" + deletedRecords].length; i++) {
12788
- editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
12839
+ editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
12789
12840
  }
12790
12841
  }
12791
12842
  this.parent.parentData = [];
@@ -12859,6 +12910,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12859
12910
  args["" + index] = this.batchIndex;
12860
12911
  }
12861
12912
  };
12913
+ BatchEdit.prototype.onCellFocused = function (e) {
12914
+ if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.isEdit && e.keyArgs) {
12915
+ if (e.keyArgs.action === 'shiftEnter') {
12916
+ e.keyArgs.preventDefault();
12917
+ this.parent.endEdit();
12918
+ return;
12919
+ }
12920
+ }
12921
+ };
12862
12922
  return BatchEdit;
12863
12923
  }());
12864
12924
 
@@ -12878,6 +12938,7 @@ var Edit = /** @__PURE__ @class */ (function () {
12878
12938
  this.prevAriaRowIndex = '-1';
12879
12939
  this.isAddedRowByMethod = false;
12880
12940
  this.isAddedRowByContextMenu = false;
12941
+ this.isIndexUndefined = false;
12881
12942
  Grid.Inject(Edit$1);
12882
12943
  this.parent = parent;
12883
12944
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -13130,7 +13191,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13130
13191
  }
13131
13192
  };
13132
13193
  Edit.prototype.keyPressed = function (args) {
13133
- if (this.isOnBatch) {
13194
+ if (this.isOnBatch || args.action === 'tab' || args.action === 'shiftTab') {
13134
13195
  this.keyPress = args.action;
13135
13196
  }
13136
13197
  if (args.action === 'f2') {
@@ -13672,9 +13733,10 @@ var Edit = /** @__PURE__ @class */ (function () {
13672
13733
  this.addRowRecord = this.parent.flatData[args.index];
13673
13734
  this.addRowIndex = args.index;
13674
13735
  }
13675
- if (this.parent.editSettings.newRowPosition === 'Child' &&
13736
+ if (this.parent.editSettings.newRowPosition === 'Child' && this.isIndexUndefined &&
13676
13737
  !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
13677
13738
  this.addRowRecord = this.parent.getSelectedRecords()[0];
13739
+ this.isIndexUndefined = false;
13678
13740
  }
13679
13741
  if (isNullOrUndefined(this.addRowRecord) && this.parent.getCurrentViewRecords().length > this.addRowIndex &&
13680
13742
  args.requestType === 'save' && this.parent.getSelectedRecords().length !== 0) {
@@ -13730,7 +13792,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13730
13792
  var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
13731
13793
  var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
13732
13794
  this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
13733
- if (currentData.length) {
13795
+ if (currentData.length && !isNullOrUndefined(index)) {
13734
13796
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
13735
13797
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
13736
13798
  if (currentData[this.addRowIndex].parentItem) {
@@ -13738,7 +13800,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13738
13800
  }
13739
13801
  parentItem = currentData[this.addRowIndex].parentItem;
13740
13802
  }
13741
- if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {
13803
+ if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length && !isNullOrUndefined(index)) {
13742
13804
  level = currentData[this.addRowIndex].level;
13743
13805
  if (this.parent.editSettings.newRowPosition === 'Above') {
13744
13806
  position = 'before';
@@ -13814,14 +13876,24 @@ var Edit = /** @__PURE__ @class */ (function () {
13814
13876
  childRecords: value.childRecords };
13815
13877
  }
13816
13878
  if (args.requestType === 'delete') {
13817
- var deletedValues = args.data;
13818
- for (var i = 0; i < deletedValues.length; i++) {
13819
- if (deletedValues[parseInt(i.toString(), 10)].parentItem) {
13820
- var parentItem = getParentData(this.parent, deletedValues[parseInt(i.toString(), 10)].parentItem.uniqueID);
13821
- if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13822
- var childIndex = parentItem.childRecords.indexOf(deletedValues[parseInt(i.toString(), 10)]);
13823
- parentItem.childRecords.splice(childIndex, 1);
13879
+ var deletedValues_1 = args.data;
13880
+ var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames();
13881
+ if (!isNullOrUndefined(primaryKeyField_1) && primaryKeyField_1.length > 0) {
13882
+ var _loop_2 = function (i) {
13883
+ var deletevalue = deletedValues_1[parseInt(i.toString(), 10)].parentItem;
13884
+ if (deletevalue) {
13885
+ var parentItem = getParentData(this_2.parent, deletevalue.uniqueID);
13886
+ if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13887
+ var childIndex = parentItem.childRecords.findIndex(function (child) {
13888
+ return deletedValues_1[parseInt(i.toString(), 10)][primaryKeyField_1[0]] === child[primaryKeyField_1[0]];
13889
+ });
13890
+ parentItem.childRecords.splice(childIndex, 1);
13891
+ }
13824
13892
  }
13893
+ };
13894
+ var this_2 = this;
13895
+ for (var i = 0; i < deletedValues_1.length; i++) {
13896
+ _loop_2(i);
13825
13897
  }
13826
13898
  }
13827
13899
  }
@@ -13836,6 +13908,9 @@ var Edit = /** @__PURE__ @class */ (function () {
13836
13908
  if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {
13837
13909
  this.previousNewRowPosition = this.parent.editSettings.newRowPosition;
13838
13910
  }
13911
+ if (isNullOrUndefined(index)) {
13912
+ this.isIndexUndefined = true;
13913
+ }
13839
13914
  if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {
13840
13915
  var addRecords = [];
13841
13916
  var previousEditMode = this.parent.editSettings.mode;
@@ -14010,12 +14085,12 @@ var DetailRow = /** @__PURE__ @class */ (function () {
14010
14085
  args["" + visible] = false;
14011
14086
  };
14012
14087
  DetailRow.prototype.dataBoundArg = function () {
14013
- var detailele = this.parent.getRows().filter(function (e) {
14088
+ var detailRows = this.parent.getRows().filter(function (e) {
14014
14089
  return !e.classList.contains('e-detailrow');
14015
14090
  });
14016
- for (var i = 0; i < detailele.length; i++) {
14017
- var elements = detailele[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
14018
- var detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
14091
+ for (var i = 0; i < detailRows.length; i++) {
14092
+ var elements = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
14093
+ var detailData = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
14019
14094
  var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
14020
14095
  if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
14021
14096
  getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
@@ -14051,10 +14126,9 @@ var DetailRow = /** @__PURE__ @class */ (function () {
14051
14126
  };
14052
14127
  DetailRow.prototype.actioncomplete = function (args) {
14053
14128
  if (args.requestType === 'beginEdit' || args.requestType === 'add') {
14054
- var spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
14055
- var colum = parseInt(spann, 10) - 1;
14056
- var updtdcolum = colum.toString();
14057
- args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);
14129
+ var colSpan = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
14130
+ var colum = parseInt(colSpan, 10) - 1;
14131
+ args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
14058
14132
  }
14059
14133
  var focusElement = this.parent.grid.contentModule.getRows();
14060
14134
  for (var i = 0; i < focusElement.length; i++) {
@@ -14288,6 +14362,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14288
14362
  this.parent["" + action]('refresh-virtual-editform-cells', this.refreshCell, this);
14289
14363
  this.parent["" + action]('virtaul-cell-focus', this.cellFocus, this);
14290
14364
  this.parent["" + action]('virtual-scroll-edit', this.restoreEditState, this);
14365
+ this.parent["" + action]('set-virtual-page-query', this.SetVirtualPageQury, this);
14291
14366
  }
14292
14367
  else {
14293
14368
  _super.prototype.eventListener.call(this, 'on');
@@ -14540,6 +14615,18 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14540
14615
  var restoreEdit = 'restoreEdit';
14541
14616
  _super.prototype["" + restoreEdit].call(this);
14542
14617
  };
14618
+ VirtualTreeContentRenderer.prototype.SetVirtualPageQury = function (args) {
14619
+ var visiblePage = [];
14620
+ if (this.prevInfo && this.prevInfo.blockIndexes) {
14621
+ visiblePage = getVisiblePage(this.prevInfo.blockIndexes);
14622
+ }
14623
+ if ((this.requestType === 'refresh') && visiblePage.length) {
14624
+ args.query.skip(this.parent.pageSettings.pageSize * (visiblePage[0] - 1));
14625
+ args.query.take(this.parent.pageSettings.pageSize * visiblePage.length);
14626
+ args.skipPage = true;
14627
+ return;
14628
+ }
14629
+ };
14543
14630
  /**
14544
14631
  * Resets the edit state if certain conditions are met.
14545
14632
  *
@@ -14680,6 +14767,19 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14680
14767
  var xAxis = current.axis === 'X';
14681
14768
  var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]
14682
14769
  - 1);
14770
+ if (_this.parent.isFrozenGrid() && _this.parent.enableColumnVirtualization && _this.currentInfo &&
14771
+ _this.currentInfo.columnIndexes) {
14772
+ var cBlock = _this.currentInfo.columnIndexes[0] - 1;
14773
+ var frzLeftWidth_1 = 0;
14774
+ _this.parent.getColumns().filter(function (col) {
14775
+ if (col.visible && col.freeze === 'Left') {
14776
+ frzLeftWidth_1 += parseInt(col.width.toString(), 10);
14777
+ }
14778
+ });
14779
+ if (cBlock > _this.parent.getVisibleFrozenLeftCount()) {
14780
+ x = x - frzLeftWidth_1;
14781
+ }
14782
+ }
14683
14783
  if (xAxis) {
14684
14784
  var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;
14685
14785
  var maxLeft = _this.vgenerator.cOffsets[idx - 1];
@@ -14697,6 +14797,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14697
14797
  }
14698
14798
  if (_this.parent.enableColumnVirtualization) {
14699
14799
  _this.header.virtualEle.adjustTable(x, 0);
14800
+ if (_this.parent.isFrozenGrid()) {
14801
+ _this.parent.contentModule['resetStickyLeftPos'](x);
14802
+ }
14700
14803
  }
14701
14804
  }
14702
14805
  }
@@ -14841,14 +14944,15 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14841
14944
  if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14842
14945
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
14843
14946
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
14844
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
14947
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
14845
14948
  var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
14846
14949
  this.previousInfo = viewInfo;
14847
- if (this.prevInfo && viewInfo.event !== 'refresh-virtual-block' && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14950
+ if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14848
14951
  || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
14849
14952
  || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
14850
14953
  && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
14851
14954
  this.parent.removeMaskRow();
14955
+ this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });
14852
14956
  if (Browser.isIE) {
14853
14957
  this.parent.hideSpinner();
14854
14958
  }
@@ -14865,7 +14969,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14865
14969
  viewInfo.loadNext = false;
14866
14970
  }
14867
14971
  this.requestType = 'virtualscroll';
14868
- if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
14972
+ if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left' && !isRemoteData(this.parent.root)) {
14869
14973
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
14870
14974
  }
14871
14975
  if (this.parent.enableVirtualMaskRow) {
@@ -14938,9 +15042,33 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14938
15042
  if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
14939
15043
  this.isExpandCollapse = false;
14940
15044
  }
15045
+ var reduceWidth_1 = 0;
15046
+ if (this.parent.enableColumnVirtualization && this.parent.isFrozenGrid()) {
15047
+ var frzLeftWidth_2 = 0;
15048
+ this.parent.getColumns().filter(function (col) {
15049
+ if (col.visible) {
15050
+ reduceWidth_1 += parseInt(col.width.toString(), 10);
15051
+ if (col.freeze === 'Left') {
15052
+ frzLeftWidth_2 += parseInt(col.width.toString(), 10);
15053
+ }
15054
+ }
15055
+ });
15056
+ var cIndex = info.columnIndexes;
15057
+ width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
15058
+ if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
15059
+ cOffset = cOffset - frzLeftWidth_2;
15060
+ }
15061
+ this.resetStickyLeftPos(cOffset, newChild);
15062
+ }
14941
15063
  if (!this.isExpandCollapse || this.translateY === 0) {
14942
15064
  this.translateY = this.translateY < 0 ? 0 : this.translateY;
14943
15065
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
15066
+ if (this.parent.enableColumnVirtualization) {
15067
+ this.header.virtualEle.adjustTable(cOffset, 0);
15068
+ if (this.parent.isFrozenGrid()) {
15069
+ this.resetStickyLeftPos(cOffset);
15070
+ }
15071
+ }
14944
15072
  }
14945
15073
  else {
14946
15074
  this.isExpandCollapse = false;
@@ -15058,7 +15186,12 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
15058
15186
  this["" + options].prevTop = this["" + options].prevLeft = 0;
15059
15187
  var isScrollByFocus = 'isScrollByFocus';
15060
15188
  return function (e) {
15061
- if (instance.isEdit && instance.root.editModule["" + isScrollByFocus]) {
15189
+ var keyPress = 'keyPress';
15190
+ var keyaction;
15191
+ if (instance && instance.root && instance.root.editModule && instance.root.editModule["" + keyPress]) {
15192
+ keyaction = instance.root.editModule["" + keyPress];
15193
+ }
15194
+ if ((instance.isEdit && instance.root.editModule["" + isScrollByFocus]) || (instance.isEdit && (keyaction === 'tab' || keyaction === 'shiftTab'))) {
15062
15195
  instance.root.editModule["" + isScrollByFocus] = false;
15063
15196
  return;
15064
15197
  }