@syncfusion/ej2-treegrid 29.2.8 → 30.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +254 -140
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +314 -169
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +5 -5
  13. package/src/treegrid/actions/batch-edit.d.ts +1 -0
  14. package/src/treegrid/actions/batch-edit.js +57 -29
  15. package/src/treegrid/actions/clipboard.js +5 -8
  16. package/src/treegrid/actions/crud-actions.js +3 -1
  17. package/src/treegrid/actions/detail-row.js +7 -8
  18. package/src/treegrid/actions/edit.d.ts +1 -0
  19. package/src/treegrid/actions/edit.js +26 -11
  20. package/src/treegrid/actions/filter.js +2 -5
  21. package/src/treegrid/actions/rowdragdrop.js +7 -13
  22. package/src/treegrid/actions/selection.js +7 -0
  23. package/src/treegrid/actions/summary.js +2 -16
  24. package/src/treegrid/actions/toolbar.js +2 -2
  25. package/src/treegrid/base/data.js +34 -14
  26. package/src/treegrid/base/treegrid-model.d.ts +7 -0
  27. package/src/treegrid/base/treegrid.d.ts +7 -0
  28. package/src/treegrid/base/treegrid.js +86 -52
  29. package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
  30. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
  31. package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
  32. package/styles/bds-lite.css +30 -0
  33. package/styles/bds.css +30 -0
  34. package/styles/bootstrap-dark-lite.css +30 -0
  35. package/styles/bootstrap-dark.css +30 -0
  36. package/styles/bootstrap-lite.css +30 -0
  37. package/styles/bootstrap.css +30 -0
  38. package/styles/bootstrap4-lite.css +30 -0
  39. package/styles/bootstrap4.css +30 -0
  40. package/styles/bootstrap5-dark-lite.css +30 -0
  41. package/styles/bootstrap5-dark.css +30 -0
  42. package/styles/bootstrap5-lite.css +30 -0
  43. package/styles/bootstrap5.3-lite.css +30 -0
  44. package/styles/bootstrap5.3.css +30 -0
  45. package/styles/bootstrap5.css +30 -0
  46. package/styles/fabric-dark-lite.css +30 -0
  47. package/styles/fabric-dark.css +30 -0
  48. package/styles/fabric-lite.css +30 -0
  49. package/styles/fabric.css +30 -0
  50. package/styles/fluent-dark-lite.css +30 -0
  51. package/styles/fluent-dark.css +30 -0
  52. package/styles/fluent-lite.css +30 -0
  53. package/styles/fluent.css +30 -0
  54. package/styles/fluent2-lite.css +30 -0
  55. package/styles/fluent2.css +30 -3
  56. package/styles/highcontrast-light-lite.css +30 -0
  57. package/styles/highcontrast-light.css +30 -0
  58. package/styles/highcontrast-lite.css +30 -0
  59. package/styles/highcontrast.css +30 -0
  60. package/styles/material-dark-lite.css +30 -0
  61. package/styles/material-dark.css +30 -0
  62. package/styles/material-lite.css +30 -0
  63. package/styles/material.css +30 -0
  64. package/styles/material3-dark-lite.css +30 -0
  65. package/styles/material3-dark.css +30 -0
  66. package/styles/material3-lite.css +30 -0
  67. package/styles/material3.css +30 -0
  68. package/styles/tailwind-dark-lite.css +30 -0
  69. package/styles/tailwind-dark.css +30 -0
  70. package/styles/tailwind-lite.css +30 -0
  71. package/styles/tailwind.css +30 -0
  72. package/styles/tailwind3-lite.css +30 -0
  73. package/styles/tailwind3.css +30 -0
  74. package/styles/treegrid/_bigger.scss +66 -66
  75. package/styles/treegrid/_layout.scss +39 -0
  76. package/styles/treegrid/bds.css +30 -0
  77. package/styles/treegrid/bootstrap-dark.css +30 -0
  78. package/styles/treegrid/bootstrap.css +30 -0
  79. package/styles/treegrid/bootstrap4.css +30 -0
  80. package/styles/treegrid/bootstrap5-dark.css +30 -0
  81. package/styles/treegrid/bootstrap5.3.css +30 -0
  82. package/styles/treegrid/bootstrap5.css +30 -0
  83. package/styles/treegrid/fabric-dark.css +30 -0
  84. package/styles/treegrid/fabric.css +30 -0
  85. package/styles/treegrid/fluent-dark.css +30 -0
  86. package/styles/treegrid/fluent.css +30 -0
  87. package/styles/treegrid/fluent2.css +30 -3
  88. package/styles/treegrid/highcontrast-light.css +30 -0
  89. package/styles/treegrid/highcontrast.css +30 -0
  90. package/styles/treegrid/material-dark.css +30 -0
  91. package/styles/treegrid/material.css +30 -0
  92. package/styles/treegrid/material3-dark.css +30 -0
  93. package/styles/treegrid/material3.css +30 -0
  94. package/styles/treegrid/tailwind-dark.css +30 -0
  95. package/styles/treegrid/tailwind.css +30 -0
  96. package/styles/treegrid/tailwind3.css +30 -0
@@ -1,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
  }
@@ -1476,6 +1473,13 @@ var Selection = /** @__PURE__ @class */ (function () {
1476
1473
  this.headerSelection();
1477
1474
  }
1478
1475
  }
1476
+ else {
1477
+ if ((requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh')
1478
+ && !isRemoteData(this.parent)) {
1479
+ this.selectedItems = [];
1480
+ this.selectedIndexes = [];
1481
+ }
1482
+ }
1479
1483
  }
1480
1484
  };
1481
1485
  Selection.prototype.getCheckedrecords = function () {
@@ -2275,6 +2279,15 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2275
2279
  if (parentRec) {
2276
2280
  records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
2277
2281
  }
2282
+ else {
2283
+ var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
2284
+ if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
2285
+ records[parseInt(rec.toString(), 10)].level = 1;
2286
+ }
2287
+ else {
2288
+ records[parseInt(rec.toString(), 10)].level = parentRec_1.level + 1;
2289
+ }
2290
+ }
2278
2291
  }
2279
2292
  else {
2280
2293
  records[parseInt(rec.toString(), 10)].level = 0;
@@ -2376,33 +2389,33 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2376
2389
  var _this = this;
2377
2390
  var args = { row: rowDetails.parentRow, data: rowDetails.record };
2378
2391
  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;
2392
+ var query = this.parent.grid.getDataModule().generateQuery();
2393
+ var clonequries = query.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
2394
+ query.queries = clonequries;
2395
+ query.isCountRequired = true;
2383
2396
  var idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
2384
2397
  if (isNaN(idMappingValue)) {
2385
2398
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
2386
2399
  }
2387
2400
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2388
- qry.take(this.parent.pageSettings.pageSize);
2401
+ query.take(this.parent.grid.pageSettings.pageSize);
2389
2402
  var expandDetail = [];
2390
2403
  expandDetail.push('ExpandingAction', idMappingValue.toString());
2391
- qry.expand(expandDetail);
2404
+ query.expand(expandDetail);
2392
2405
  }
2393
2406
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
2394
- qry.take(this.parent.grid.pageSettings.pageSize);
2407
+ query.take(this.parent.grid.pageSettings.pageSize);
2395
2408
  var expandDetail = [];
2396
2409
  expandDetail.push('CollapsingAction', idMappingValue.toString());
2397
- qry.expand(expandDetail);
2410
+ query.expand(expandDetail);
2398
2411
  }
2399
- qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2412
+ query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2400
2413
  if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
2401
2414
  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]);
2415
+ query.queries.push(filterqry[0]);
2403
2416
  }
2404
2417
  showSpinner(this.parent.element);
2405
- dm.executeQuery(qry).then(function (e) {
2418
+ dm.executeQuery(query).then(function (e) {
2406
2419
  var remoteExpandedData = 'remoteExpandedData';
2407
2420
  var remoteCollapsedData = 'remoteCollapsedData';
2408
2421
  var level = 'level';
@@ -2465,7 +2478,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2465
2478
  else {
2466
2479
  rowDetails.record.childRecords = result;
2467
2480
  }
2468
- for (var r = 0; r < result.length; r++) {
2481
+ var _loop_2 = function (r) {
2469
2482
  var record = result[parseInt(r.toString(), 10)];
2470
2483
  if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
2471
2484
  _this.parent["" + remoteExpandedData].push(rowDetails.record);
@@ -2575,8 +2588,18 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2575
2588
  record.expanded = false;
2576
2589
  }
2577
2590
  }
2578
- datas.splice(inx + r + 1, 0, record);
2591
+ var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
2592
+ if (!exists) {
2593
+ datas.splice(inx + r + 1, 0, record);
2594
+ }
2595
+ };
2596
+ for (var r = 0; r < result.length; r++) {
2597
+ _loop_2(r);
2579
2598
  }
2599
+ var localIdMapping = _this.parent.idMapping;
2600
+ datas.sort(function (firstRecord, secondRecord) {
2601
+ return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
2602
+ });
2580
2603
  setValue('result', datas, e);
2581
2604
  setValue('action', 'beforecontentrender', e);
2582
2605
  _this.parent.trigger(actionComplete, e);
@@ -2619,7 +2642,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2619
2642
  var contentModule = getValue('grid.contentModule', this.parent);
2620
2643
  var currentInfo = getValue('currentInfo', contentModule);
2621
2644
  var prevInfo = getValue('prevInfo', contentModule);
2622
- if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {
2645
+ if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
2646
+ && !this.parent.loadChildOnDemand) {
2623
2647
  this.parent.grid.pageSettings.currentPage = prevInfo.page;
2624
2648
  }
2625
2649
  };
@@ -3610,7 +3634,9 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3610
3634
  }
3611
3635
  else {
3612
3636
  if (!isNullOrUndefined(child) && record["" + key] !== child["" + key]) {
3613
- record.childRecords.push(child);
3637
+ if (!record.childRecords.some(function (records) { return records.uniqueID === child.uniqueID; })) {
3638
+ record.childRecords.push(child);
3639
+ }
3614
3640
  }
3615
3641
  }
3616
3642
  if (record.childRecords.indexOf(childRecords) === -1 && record["" + key] !== child["" + key]) {
@@ -4108,7 +4134,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4108
4134
  parentTarget = target.parentElement;
4109
4135
  if (!isNullOrUndefined(parentTarget)) {
4110
4136
  var cellIndex = parentTarget.cellIndex;
4111
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4137
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4112
4138
  parentTarget = target;
4113
4139
  }
4114
4140
  summaryElement = this.findnextRowElement(parentTarget);
@@ -4116,8 +4142,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4116
4142
  var cellIndex_1 = target.cellIndex;
4117
4143
  var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
4118
4144
  if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
4119
- addClass([row_1], 'e-focused');
4120
- addClass([row_1], 'e-focus');
4145
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
4146
+ focusedCells.forEach(function (cell) {
4147
+ removeClass([cell], ['e-focused', 'e-focus']);
4148
+ });
4149
+ addClass([row_1], ['e-focused', 'e-focus']);
4121
4150
  }
4122
4151
  }
4123
4152
  else {
@@ -4137,7 +4166,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4137
4166
  parentTarget = target.parentElement;
4138
4167
  if (!isNullOrUndefined(parentTarget)) {
4139
4168
  var cellIndex = parentTarget.cellIndex;
4140
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4169
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4141
4170
  parentTarget = target;
4142
4171
  }
4143
4172
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -4146,8 +4175,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4146
4175
  if (!isNullOrUndefined(cellIndex_2)) {
4147
4176
  var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
4148
4177
  if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
4149
- addClass([row_2], 'e-focused');
4150
- addClass([row_2], 'e-focus');
4178
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
4179
+ focusedCells.forEach(function (cell) {
4180
+ removeClass([cell], ['e-focused', 'e-focus']);
4181
+ });
4182
+ addClass([row_2], ['e-focused', 'e-focus']);
4151
4183
  }
4152
4184
  }
4153
4185
  }
@@ -4514,11 +4546,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4514
4546
  var destroyTemplate = 'destroyTemplate';
4515
4547
  var destroyTemplateFn = this.grid["" + destroyTemplate];
4516
4548
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4517
- this.grid["" + destroyTemplate] = function (args, index) {
4549
+ this.grid["" + destroyTemplate] = function (args, index, callback) {
4518
4550
  destroyTemplateFn.apply(_this.grid);
4519
4551
  var portals = 'portals';
4520
4552
  if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
4521
- _this.clearTemplate(args, index);
4553
+ _this.clearTemplate(args, index, callback);
4554
+ }
4555
+ else if (!isNullOrUndefined(callback)) {
4556
+ callback();
4522
4557
  }
4523
4558
  };
4524
4559
  };
@@ -4614,18 +4649,24 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4614
4649
  this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
4615
4650
  };
4616
4651
  TreeGrid.prototype.convertTreeData = function (data) {
4617
- var _this = this;
4618
4652
  if (isCountRequired(this)) {
4619
4653
  data = getValue('result', data);
4620
4654
  }
4621
4655
  if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
4622
4656
  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);
4657
+ var _loop_1 = function (i, len) {
4658
+ var rowData = this_1.flatData[parseInt(i.toString(), 10)];
4659
+ setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
4660
+ if (rowData.level === 0 && !this_1.parentData.some(function (record) {
4661
+ return record.uniqueID === rowData.uniqueID;
4662
+ })) {
4663
+ this_1.parentData.push(rowData);
4627
4664
  }
4628
- });
4665
+ };
4666
+ var this_1 = this;
4667
+ for (var i = 0, len = this.flatData.length; i < len; i++) {
4668
+ _loop_1(i, len);
4669
+ }
4629
4670
  }
4630
4671
  else {
4631
4672
  if (isCountRequired(this)) {
@@ -4715,6 +4756,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4715
4756
  this.grid["" + isJsComponent] = true;
4716
4757
  var enableHtmlSanitizer = 'enableHtmlSanitizer';
4717
4758
  this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
4759
+ this.grid.enableStickyHeader = this.enableStickyHeader;
4760
+ var isTreeGrid = 'isTreeGrid';
4761
+ this.grid["" + isTreeGrid] = true;
4718
4762
  };
4719
4763
  TreeGrid.prototype.triggerEvents = function (args) {
4720
4764
  this.trigger(getObject('name', args), args);
@@ -4852,6 +4896,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4852
4896
  TreeGrid.prototype.extendedGridDataBoundEvent = function () {
4853
4897
  var _this = this;
4854
4898
  this.grid.dataBound = function (args) {
4899
+ _this.lastRowBorderEventListener();
4855
4900
  _this.updateRowTemplate();
4856
4901
  _this.updateColumnModel();
4857
4902
  _this.updateAltRow(_this.getRows());
@@ -4944,6 +4989,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4944
4989
  }
4945
4990
  };
4946
4991
  };
4992
+ TreeGrid.prototype.lastRowBorderEventListener = function () {
4993
+ this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
4994
+ };
4947
4995
  TreeGrid.prototype.bindCallBackEvents = function () {
4948
4996
  var _this = this;
4949
4997
  this.grid.toolbarClick = function (args) {
@@ -5111,6 +5159,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5111
5159
  if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
5112
5160
  args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
5113
5161
  args.cancel = true;
5162
+ return;
5114
5163
  }
5115
5164
  var requestType = getObject('requestType', args);
5116
5165
  if (requestType === 'reorder') {
@@ -5301,6 +5350,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5301
5350
  * @returns {void}
5302
5351
  */
5303
5352
  TreeGrid.prototype.autoGenerateColumns = function () {
5353
+ var _this = this;
5304
5354
  if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
5305
5355
  this.columns = [];
5306
5356
  // if (this.dataSource instanceof DataManager) {
@@ -5309,11 +5359,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5309
5359
  var record = this.dataSource[0];
5310
5360
  // }
5311
5361
  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
- }
5362
+ this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
5317
5363
  }
5318
5364
  };
5319
5365
  TreeGrid.prototype.getGridEditSettings = function () {
@@ -5467,8 +5513,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5467
5513
  gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
5468
5514
  }
5469
5515
  else {
5470
- for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
5471
- var prop = _a[_i];
5516
+ var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
5517
+ for (var j = 0; j < columnProps.length; j++) {
5518
+ var prop = columnProps[parseInt(j.toString(), 10)];
5472
5519
  if (index === this.treeColumnIndex && prop === 'template') {
5473
5520
  treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
5474
5521
  }
@@ -5639,6 +5686,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5639
5686
  break;
5640
5687
  case 'rowHeight':
5641
5688
  this.grid.rowHeight = this.rowHeight;
5689
+ this.refresh();
5642
5690
  break;
5643
5691
  case 'height':
5644
5692
  if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
@@ -5714,6 +5762,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5714
5762
  case 'columnMenuItems':
5715
5763
  this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
5716
5764
  break;
5765
+ case 'enableStickyHeader':
5766
+ this.grid.enableStickyHeader = this.enableStickyHeader;
5767
+ break;
5717
5768
  case 'editSettings':
5718
5769
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
5719
5770
  (newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
@@ -5865,7 +5916,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5865
5916
  var checkedTarget = this.grid.getHeaderContent().querySelector('.e-checkselectall');
5866
5917
  var checkedLen = this.grid.getSelectedRowIndexes().length;
5867
5918
  var totalRecords = this.getCurrentViewRecords().length;
5868
- if (checkedLen === totalRecords) {
5919
+ if (totalRecords > 0 && checkedLen === totalRecords) {
5869
5920
  var spanEle = checkedTarget.nextElementSibling;
5870
5921
  removeClass([spanEle], ['e-stop', 'e-uncheck']);
5871
5922
  addClass([spanEle], ['e-check']);
@@ -6601,14 +6652,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6601
6652
  * @returns {Column[]} - Returns an array of visible column objects.
6602
6653
  */
6603
6654
  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;
6655
+ return this.columnModel.filter(function (col) { return col.visible; });
6612
6656
  };
6613
6657
  /**
6614
6658
  * Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
@@ -6736,17 +6780,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6736
6780
  TreeGrid.prototype.getTreeColumn = function () {
6737
6781
  var columnModel = 'columnModel';
6738
6782
  var treeColumn = this["" + columnModel][this.treeColumnIndex];
6739
- var treeIndex;
6740
6783
  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
- }
6784
+ var treeColumnField = getObject('field', treeColumn);
6785
+ var treeIndex = updatedCols.findIndex(function (col) {
6786
+ return getObject('field', col) === treeColumnField;
6787
+ });
6788
+ if (!isNullOrUndefined(treeIndex)) {
6789
+ this.setProperties({ treeColumnIndex: treeIndex }, true);
6748
6790
  }
6749
- this.setProperties({ treeColumnIndex: treeIndex }, true);
6750
6791
  };
6751
6792
  /**
6752
6793
  * Refreshes the header section of the TreeGrid to reflect any structural or data changes.
@@ -7069,14 +7110,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7069
7110
  };
7070
7111
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
7071
7112
  if (isPaging === void 0) { isPaging = false; }
7072
- var _loop_1 = function (i) {
7113
+ var _loop_2 = function (i) {
7073
7114
  if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
7074
7115
  var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
7075
- var parentItem = this_1.flatData.filter(function (e) {
7116
+ var parentItem = this_2.flatData.filter(function (e) {
7076
7117
  return e.uniqueID === puniqueID_1;
7077
7118
  });
7078
- if (isRemoteData(this_1)) {
7079
- parentItem = this_1.getCurrentViewRecords().filter(function (e) {
7119
+ if (isRemoteData(this_2)) {
7120
+ parentItem = this_2.getCurrentViewRecords().filter(function (e) {
7080
7121
  return e.uniqueID === puniqueID_1;
7081
7122
  });
7082
7123
  }
@@ -7085,7 +7126,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7085
7126
  parentItem[0].expanded = true;
7086
7127
  }
7087
7128
  else {
7088
- if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
7129
+ if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
7089
7130
  if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
7090
7131
  record.push(parentItem[0]);
7091
7132
  }
@@ -7093,12 +7134,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7093
7134
  }
7094
7135
  }
7095
7136
  if (!isPaging) {
7096
- this_1.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
7137
+ this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
7097
7138
  }
7098
7139
  };
7099
- var this_1 = this;
7140
+ var this_2 = this;
7100
7141
  for (var i = 0; i < record.length; i++) {
7101
- _loop_1(i);
7142
+ _loop_2(i);
7102
7143
  }
7103
7144
  if (isPaging) {
7104
7145
  this.expandRow(null, record, key, level);
@@ -7202,8 +7243,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7202
7243
  if (this.editSettings.mode === 'Batch') {
7203
7244
  var obj = 'dialogObj';
7204
7245
  var showDialog = 'showDialog';
7205
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
7206
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
7246
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
7247
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
7248
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
7249
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
7250
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
7251
+ if (hasChanges && this.editSettings.showConfirmDialog) {
7207
7252
  var dialogObj = this.grid.editModule["" + obj];
7208
7253
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
7209
7254
  return;
@@ -7229,8 +7274,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7229
7274
  if (this.editSettings.mode === 'Batch') {
7230
7275
  var obj = 'dialogObj';
7231
7276
  var showDialog = 'showDialog';
7232
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
7233
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
7277
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
7278
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
7279
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
7280
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
7281
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
7282
+ if (hasChanges && this.editSettings.showConfirmDialog) {
7234
7283
  var dialogObj = this.grid.editModule["" + obj];
7235
7284
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
7236
7285
  return;
@@ -7520,6 +7569,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7520
7569
  TreeGrid.prototype.remoteExpand = function (action, row, record) {
7521
7570
  var gridRows = this.getRows();
7522
7571
  var fetchRemoteChildData = 'fetchRemoteChildData';
7572
+ var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
7573
+ this.grid.contentModule.requestType = requestType;
7523
7574
  if (this.rowTemplate) {
7524
7575
  var rows_1 = this.getContentTable().rows;
7525
7576
  gridRows = [].slice.call(rows_1);
@@ -7594,6 +7645,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7594
7645
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
7595
7646
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
7596
7647
  }
7648
+ if (this.detailTemplate) {
7649
+ gridRows.forEach(function (row) {
7650
+ if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
7651
+ row.style.display = '';
7652
+ }
7653
+ });
7654
+ }
7597
7655
  var detailrows = gridRows.filter(function (r) {
7598
7656
  return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
7599
7657
  });
@@ -7758,7 +7816,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7758
7816
  TreeGrid.prototype.addListener = function () {
7759
7817
  this.on('updateResults', this.updateResultModel, this);
7760
7818
  this.grid.on('initial-end', this.afterGridRender, this);
7761
- this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
7762
7819
  };
7763
7820
  TreeGrid.prototype.updateResultModel = function (returnResult) {
7764
7821
  this.dataResults = returnResult;
@@ -8351,6 +8408,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8351
8408
  __decorate$b([
8352
8409
  Property(false)
8353
8410
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
8411
+ __decorate$b([
8412
+ Property(false)
8413
+ ], TreeGrid.prototype, "enableStickyHeader", void 0);
8354
8414
  __decorate$b([
8355
8415
  Property('auto')
8356
8416
  ], TreeGrid.prototype, "height", void 0);
@@ -10335,6 +10395,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
10335
10395
  * @returns {void} - This method does not return a value.
10336
10396
  */
10337
10397
  RowDD.prototype.removeRecords = function (record) {
10398
+ var _this = this;
10338
10399
  var tObj = this.parent;
10339
10400
  var dataSource;
10340
10401
  if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {
@@ -10362,20 +10423,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
10362
10423
  if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {
10363
10424
  this.removeChildItem(deletedRow);
10364
10425
  }
10365
- var idx = void 0;
10366
- var idz = void 0;
10367
10426
  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
- }
10427
+ var idx = treeGridData.findIndex(function (data) {
10428
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
10429
+ });
10430
+ var idz = this.treeGridData.findIndex(function (data) {
10431
+ return data[_this.parent.idMapping] === deletedRow.taskData[_this.parent.idMapping];
10432
+ });
10379
10433
  if (idx !== -1 && !isNullOrUndefined(idx)) {
10380
10434
  dataSource.splice(idx, 1);
10381
10435
  }
@@ -10646,10 +10700,15 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10646
10700
  };
10647
10701
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
10648
10702
  var info = this.getDataInfo();
10649
- if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
10650
- if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
10651
- || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10652
- notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10703
+ if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
10704
+ notifyArgs.virtualInfo = this['prevInfo'];
10705
+ }
10706
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
10707
+ if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
10708
+ if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
10709
+ || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10710
+ notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10711
+ }
10653
10712
  }
10654
10713
  else {
10655
10714
  notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
@@ -10690,7 +10749,10 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10690
10749
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
10691
10750
  this.cache[parseInt(currentPage.toString(), 10)].length >
10692
10751
  (this.parent.contentModule).getBlockSize()) {
10693
- delete this.cache[parseInt(currentPage.toString(), 10)];
10752
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
10753
+ this.cache[parseInt(currentPage.toString(), 10)] =
10754
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
10755
+ }
10694
10756
  }
10695
10757
  }
10696
10758
  else {
@@ -10778,11 +10840,11 @@ var Filter = /** @__PURE__ @class */ (function () {
10778
10840
  this.filteredParentRecs = [];
10779
10841
  this.filteredResult = [];
10780
10842
  this.isHierarchyFilter = false;
10843
+ var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10844
+ : this.parent.searchSettings.hierarchyMode;
10781
10845
  for (var f = 0; f < this.flatFilteredData.length; f++) {
10782
10846
  var rec = this.flatFilteredData[parseInt(f.toString(), 10)];
10783
10847
  this.addParentRecord(rec);
10784
- var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10785
- : this.parent.searchSettings.hierarchyMode;
10786
10848
  if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&
10787
10849
  (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {
10788
10850
  this.isHierarchyFilter = true;
@@ -10794,8 +10856,6 @@ var Filter = /** @__PURE__ @class */ (function () {
10794
10856
  var parent_1 = getObject('parentItem', rec);
10795
10857
  if (!isNullOrUndefined(parent_1)) {
10796
10858
  var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);
10797
- //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {
10798
- // return e.uniqueID === rec.parentItem.uniqueID; })[0];
10799
10859
  setValue('hasFilteredChildRecords', true, parRecord);
10800
10860
  if (parRecord && parRecord.parentItem) {
10801
10861
  this.updateParentFilteredRecord(parRecord);
@@ -10819,7 +10879,6 @@ var Filter = /** @__PURE__ @class */ (function () {
10819
10879
  };
10820
10880
  Filter.prototype.addParentRecord = function (record) {
10821
10881
  var parent = getParentData(this.parent, record.parentUniqueID);
10822
- //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];
10823
10882
  var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10824
10883
  : this.parent.searchSettings.hierarchyMode;
10825
10884
  if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0
@@ -11586,8 +11645,8 @@ var Toolbar = /** @__PURE__ @class */ (function () {
11586
11645
  }
11587
11646
  row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
11588
11647
  if (indentEle !== null && outdentEle !== null) {
11589
- indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
11590
- outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
11648
+ indentElement = indentEle.parentElement;
11649
+ outdentElement = outdentEle.parentElement;
11591
11650
  if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
11592
11651
  indentElement.classList.add('e-hidden');
11593
11652
  outdentElement.classList.add('e-hidden');
@@ -11721,14 +11780,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
11721
11780
  Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {
11722
11781
  this.summaryQuery = summaryQuery;
11723
11782
  var parentRecord;
11724
- var parentDataLength = Object.keys(filteredData).length;
11725
- var parentData = [];
11726
- for (var p = 0, len = parentDataLength; p < len; p++) {
11727
- var summaryRow = getObject('isSummaryRow', filteredData[parseInt(p.toString(), 10)]);
11728
- if (!summaryRow) {
11729
- parentData.push(filteredData[parseInt(p.toString(), 10)]);
11730
- }
11731
- }
11783
+ var parentData = filteredData.filter(function (data) { return !getObject('isSummaryRow', data); });
11732
11784
  var parentRecords = findParentRecords(parentData);
11733
11785
  var flatRecords = parentData.slice();
11734
11786
  var summaryLength = Object.keys(this.parent.aggregates).length;
@@ -11886,14 +11938,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
11886
11938
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
11887
11939
  }
11888
11940
  var value = single["" + summaryColumn.columnName]["" + summaryKey];
11889
- var summaryValue;
11890
- if (cellElement.innerHTML.indexOf(value) === -1) {
11891
- summaryValue = cellElement.innerHTML + value;
11892
- return summaryValue;
11893
- }
11894
- else {
11895
- return cellElement.innerHTML;
11896
- }
11941
+ return cellElement.innerHTML.indexOf(value) === -1 ? cellElement.innerHTML + value : cellElement.innerHTML;
11897
11942
  };
11898
11943
  Aggregate.prototype.getFormatFromType = function (summaryformat, type) {
11899
11944
  if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {
@@ -12265,6 +12310,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12265
12310
  this.parent.on('batchCancelAction', this.batchCancelAction, this);
12266
12311
  this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);
12267
12312
  this.parent.grid.on('next-cell-index', this.nextCellIndex, this);
12313
+ this.parent.grid.on('cellfocused', this.onCellFocused, this);
12268
12314
  };
12269
12315
  /**
12270
12316
  * @hidden
@@ -12284,6 +12330,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12284
12330
  this.parent.off('batchCancelAction', this.batchCancelAction);
12285
12331
  this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);
12286
12332
  this.parent.grid.off('next-cell-index', this.nextCellIndex);
12333
+ this.parent.grid.off('cellfocused', this.onCellFocused);
12287
12334
  };
12288
12335
  /**
12289
12336
  * To destroy the editModule
@@ -12323,14 +12370,18 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12323
12370
  return this.batchChildCount;
12324
12371
  };
12325
12372
  BatchEdit.prototype.batchPageAction = function () {
12373
+ var _this = this;
12326
12374
  var data = (this.parent.grid.dataSource instanceof DataManager ?
12327
12375
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
12328
- var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12376
+ var primaryKeyField = this.parent.grid.getPrimaryKeyFieldNames()[0];
12329
12377
  var index;
12330
12378
  if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
12331
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
12332
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12379
+ var _loop_1 = function (i) {
12380
+ index = data.findIndex(function (e) { return e["" + primaryKeyField] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]; });
12333
12381
  data.splice(index, 1);
12382
+ };
12383
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
12384
+ _loop_1(i);
12334
12385
  }
12335
12386
  }
12336
12387
  this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
@@ -12555,11 +12606,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12555
12606
  }
12556
12607
  childs.push(data);
12557
12608
  records = childs;
12558
- for (var i = 0; i < records.length; i++) {
12559
- var indexvalue = this.batchRecords.map(function (e) { return e["" + primarykey]; }).indexOf(records[parseInt(i.toString(), 10)]["" + primarykey]);
12609
+ var _loop_2 = function (i) {
12610
+ var indexvalue = this_1.batchRecords.findIndex(function (e) { return e["" + primarykey] === records[parseInt(i.toString(), 10)]["" + primarykey]; });
12560
12611
  if (indexvalue !== -1) {
12561
- this.batchRecords.splice(indexvalue, 1);
12612
+ this_1.batchRecords.splice(indexvalue, 1);
12562
12613
  }
12614
+ };
12615
+ var this_1 = this;
12616
+ for (var i = 0; i < records.length; i++) {
12617
+ _loop_2(i);
12563
12618
  }
12564
12619
  for (var i = 0; i < row.length; i++) {
12565
12620
  if (!isNullOrUndefined(row[parseInt(i.toString(), 10)])) {
@@ -12575,11 +12630,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12575
12630
  };
12576
12631
  BatchEdit.prototype.updateChildCount = function (records) {
12577
12632
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12578
- var addedRecords = 'addedRecords';
12633
+ var addedRecords = this.parent.getBatchChanges().addedRecords || [];
12579
12634
  var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
12580
- for (var i = 0; i < this.parent.getBatchChanges()["" + addedRecords].length; i++) {
12581
- if (!isNullOrUndefined(this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem])) {
12582
- if (this.parent.getBatchChanges()["" + addedRecords][parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
12635
+ for (var i = 0; i < addedRecords.length; i++) {
12636
+ if (!isNullOrUndefined(addedRecords[parseInt(i.toString(), 10)]["" + parentItem])) {
12637
+ if (addedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)]["" + primaryKey]) {
12583
12638
  this.batchChildCount = this.batchChildCount + 1;
12584
12639
  }
12585
12640
  }
@@ -12616,6 +12671,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12616
12671
  delete this.parent["" + id]["" + value];
12617
12672
  };
12618
12673
  BatchEdit.prototype.batchCancelAction = function () {
12674
+ var _this = this;
12619
12675
  var targetElement = 'targetElement';
12620
12676
  var index;
12621
12677
  var parentItem = 'parentItem';
@@ -12626,24 +12682,28 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12626
12682
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
12627
12683
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12628
12684
  if (!isNullOrUndefined(this.batchAddedRecords)) {
12629
- for (var i = 0; i < this.batchAddedRecords.length; i++) {
12630
- index = data.map(function (e) { return e["" + primaryKey]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12685
+ var _loop_3 = function (i) {
12686
+ index = data.findIndex(function (e) { return e["" + primaryKey] === _this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]; });
12631
12687
  if (index !== -1) {
12632
12688
  data.splice(index, 1);
12633
12689
  }
12634
- if (this.parent.editSettings.newRowPosition === 'Child') {
12690
+ if (this_2.parent.editSettings.newRowPosition === 'Child') {
12635
12691
  index = currentViewRecords.map(function (e) { return e["" + primaryKey]; })
12636
- .indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
12637
- : this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12692
+ .indexOf(this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem] ? this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primaryKey]
12693
+ : this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]);
12638
12694
  if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {
12639
12695
  var children = currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords];
12640
12696
  for (var j = 0; children && j < children.length; j++) {
12641
- if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
12642
- currentViewRecords[parseInt(index.toString(), 10)]["" + childRecords].splice(j, 1);
12697
+ if (children[parseInt(j.toString(), 10)]["" + primaryKey] === this_2.batchAddedRecords[parseInt(i.toString(), 10)]["" + primaryKey]) {
12698
+ children.splice(j, 1);
12643
12699
  }
12644
12700
  }
12645
12701
  }
12646
12702
  }
12703
+ };
12704
+ var this_2 = this;
12705
+ for (var i = 0; i < this.batchAddedRecords.length; i++) {
12706
+ _loop_3(i);
12647
12707
  }
12648
12708
  }
12649
12709
  if (!isNullOrUndefined(this.parent["" + targetElement])) {
@@ -12689,7 +12749,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12689
12749
  var selectedIndex = void 0;
12690
12750
  var addRowIndex = void 0;
12691
12751
  var columnName = void 0;
12692
- var addRowRecord = void 0;
12752
+ var addRowRecord_1;
12693
12753
  var childRecords = 'childRecords';
12694
12754
  if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {
12695
12755
  addRecords.reverse();
@@ -12742,17 +12802,17 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12742
12802
  this.parent.editModule['previousNewRowPosition'] = rowPosition;
12743
12803
  }
12744
12804
  addRecords[parseInt(i.toString(), 10)].taskData = taskData;
12745
- addRowRecord = this.batchAddRowRecord[parseInt(i.toString(), 10)];
12746
- if (isNullOrUndefined(addRowRecord)) {
12747
- addRowRecord = this.batchAddRowRecord[i - 1];
12805
+ addRowRecord_1 = this.batchAddRowRecord[parseInt(i.toString(), 10)];
12806
+ if (isNullOrUndefined(addRowRecord_1)) {
12807
+ addRowRecord_1 = this.batchAddRowRecord[i - 1];
12748
12808
  }
12749
12809
  if (this.isSelfReference) {
12750
12810
  if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {
12751
12811
  updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);
12752
12812
  }
12753
12813
  }
12754
- if (!isNullOrUndefined(addRowRecord)) {
12755
- addRowIndex = addRowRecord.index;
12814
+ if (!isNullOrUndefined(addRowRecord_1)) {
12815
+ addRowIndex = addRowRecord_1.index;
12756
12816
  }
12757
12817
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].index)) {
12758
12818
  addRowIndex = 0;
@@ -12760,26 +12820,30 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12760
12820
  if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {
12761
12821
  if (isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {
12762
12822
  selectedIndex = -1;
12763
- addRowRecord = null;
12823
+ addRowRecord_1 = null;
12764
12824
  }
12765
12825
  }
12766
- editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
12826
+ editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
12767
12827
  selectedIndex = null;
12768
12828
  if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)]["" + parentItem]) &&
12769
12829
  (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {
12770
12830
  var indexValue = currentViewRecords.map(function (e) { return e["" + primarykey_1]; })
12771
12831
  .indexOf(addRecords[parseInt(i.toString(), 10)]["" + parentItem]["" + primarykey_1]);
12772
12832
  var children = currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords];
12773
- for (var j = 0; j < children.length; j++) {
12774
- if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
12775
- currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
12833
+ if (!isNullOrUndefined(addRowIndex) && children.some(function (records) {
12834
+ return records.uniqueID === addRowRecord_1.uniqueID;
12835
+ })) {
12836
+ for (var j = 0; j < children.length; j++) {
12837
+ if (children[parseInt(j.toString(), 10)]["" + primarykey_1] === addRecords[parseInt(i.toString(), 10)]["" + primarykey_1]) {
12838
+ currentViewRecords[parseInt(indexValue.toString(), 10)]["" + childRecords].splice(j, 1);
12839
+ }
12776
12840
  }
12777
12841
  }
12778
12842
  }
12779
12843
  }
12780
12844
  if (batchChanges["" + deletedRecords].length) {
12781
12845
  for (i = 0; i < batchChanges["" + deletedRecords].length; i++) {
12782
- editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);
12846
+ editAction({ value: batchChanges["" + deletedRecords][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord_1);
12783
12847
  }
12784
12848
  }
12785
12849
  this.parent.parentData = [];
@@ -12853,6 +12917,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
12853
12917
  args["" + index] = this.batchIndex;
12854
12918
  }
12855
12919
  };
12920
+ BatchEdit.prototype.onCellFocused = function (e) {
12921
+ if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.isEdit && e.keyArgs) {
12922
+ if (e.keyArgs.action === 'shiftEnter') {
12923
+ e.keyArgs.preventDefault();
12924
+ this.parent.endEdit();
12925
+ return;
12926
+ }
12927
+ }
12928
+ };
12856
12929
  return BatchEdit;
12857
12930
  }());
12858
12931
 
@@ -12872,6 +12945,7 @@ var Edit = /** @__PURE__ @class */ (function () {
12872
12945
  this.prevAriaRowIndex = '-1';
12873
12946
  this.isAddedRowByMethod = false;
12874
12947
  this.isAddedRowByContextMenu = false;
12948
+ this.isIndexUndefined = false;
12875
12949
  Grid.Inject(Edit$1);
12876
12950
  this.parent = parent;
12877
12951
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -13124,7 +13198,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13124
13198
  }
13125
13199
  };
13126
13200
  Edit.prototype.keyPressed = function (args) {
13127
- if (this.isOnBatch) {
13201
+ if (this.isOnBatch || args.action === 'tab' || args.action === 'shiftTab') {
13128
13202
  this.keyPress = args.action;
13129
13203
  }
13130
13204
  if (args.action === 'f2') {
@@ -13666,9 +13740,10 @@ var Edit = /** @__PURE__ @class */ (function () {
13666
13740
  this.addRowRecord = this.parent.flatData[args.index];
13667
13741
  this.addRowIndex = args.index;
13668
13742
  }
13669
- if (this.parent.editSettings.newRowPosition === 'Child' &&
13743
+ if (this.parent.editSettings.newRowPosition === 'Child' && this.isIndexUndefined &&
13670
13744
  !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
13671
13745
  this.addRowRecord = this.parent.getSelectedRecords()[0];
13746
+ this.isIndexUndefined = false;
13672
13747
  }
13673
13748
  if (isNullOrUndefined(this.addRowRecord) && this.parent.getCurrentViewRecords().length > this.addRowIndex &&
13674
13749
  args.requestType === 'save' && this.parent.getSelectedRecords().length !== 0) {
@@ -13724,7 +13799,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13724
13799
  var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
13725
13800
  var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
13726
13801
  this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
13727
- if (currentData.length) {
13802
+ if (currentData.length && !isNullOrUndefined(index)) {
13728
13803
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
13729
13804
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
13730
13805
  if (currentData[this.addRowIndex].parentItem) {
@@ -13732,7 +13807,7 @@ var Edit = /** @__PURE__ @class */ (function () {
13732
13807
  }
13733
13808
  parentItem = currentData[this.addRowIndex].parentItem;
13734
13809
  }
13735
- if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {
13810
+ if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length && !isNullOrUndefined(index)) {
13736
13811
  level = currentData[this.addRowIndex].level;
13737
13812
  if (this.parent.editSettings.newRowPosition === 'Above') {
13738
13813
  position = 'before';
@@ -13808,14 +13883,24 @@ var Edit = /** @__PURE__ @class */ (function () {
13808
13883
  childRecords: value.childRecords };
13809
13884
  }
13810
13885
  if (args.requestType === 'delete') {
13811
- var deletedValues = args.data;
13812
- for (var i = 0; i < deletedValues.length; i++) {
13813
- if (deletedValues[parseInt(i.toString(), 10)].parentItem) {
13814
- var parentItem = getParentData(this.parent, deletedValues[parseInt(i.toString(), 10)].parentItem.uniqueID);
13815
- if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13816
- var childIndex = parentItem.childRecords.indexOf(deletedValues[parseInt(i.toString(), 10)]);
13817
- parentItem.childRecords.splice(childIndex, 1);
13886
+ var deletedValues_1 = args.data;
13887
+ var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames();
13888
+ if (!isNullOrUndefined(primaryKeyField_1) && primaryKeyField_1.length > 0) {
13889
+ var _loop_2 = function (i) {
13890
+ var deletevalue = deletedValues_1[parseInt(i.toString(), 10)].parentItem;
13891
+ if (deletevalue) {
13892
+ var parentItem = getParentData(this_2.parent, deletevalue.uniqueID);
13893
+ if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13894
+ var childIndex = parentItem.childRecords.findIndex(function (child) {
13895
+ return deletedValues_1[parseInt(i.toString(), 10)][primaryKeyField_1[0]] === child[primaryKeyField_1[0]];
13896
+ });
13897
+ parentItem.childRecords.splice(childIndex, 1);
13898
+ }
13818
13899
  }
13900
+ };
13901
+ var this_2 = this;
13902
+ for (var i = 0; i < deletedValues_1.length; i++) {
13903
+ _loop_2(i);
13819
13904
  }
13820
13905
  }
13821
13906
  }
@@ -13830,6 +13915,9 @@ var Edit = /** @__PURE__ @class */ (function () {
13830
13915
  if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {
13831
13916
  this.previousNewRowPosition = this.parent.editSettings.newRowPosition;
13832
13917
  }
13918
+ if (isNullOrUndefined(index)) {
13919
+ this.isIndexUndefined = true;
13920
+ }
13833
13921
  if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {
13834
13922
  var addRecords = [];
13835
13923
  var previousEditMode = this.parent.editSettings.mode;
@@ -14004,12 +14092,12 @@ var DetailRow = /** @__PURE__ @class */ (function () {
14004
14092
  args["" + visible] = false;
14005
14093
  };
14006
14094
  DetailRow.prototype.dataBoundArg = function () {
14007
- var detailele = this.parent.getRows().filter(function (e) {
14095
+ var detailRows = this.parent.getRows().filter(function (e) {
14008
14096
  return !e.classList.contains('e-detailrow');
14009
14097
  });
14010
- for (var i = 0; i < detailele.length; i++) {
14011
- var elements = detailele[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
14012
- var detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
14098
+ for (var i = 0; i < detailRows.length; i++) {
14099
+ var elements = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
14100
+ var detailData = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
14013
14101
  var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
14014
14102
  if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
14015
14103
  getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
@@ -14045,10 +14133,9 @@ var DetailRow = /** @__PURE__ @class */ (function () {
14045
14133
  };
14046
14134
  DetailRow.prototype.actioncomplete = function (args) {
14047
14135
  if (args.requestType === 'beginEdit' || args.requestType === 'add') {
14048
- var spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
14049
- var colum = parseInt(spann, 10) - 1;
14050
- var updtdcolum = colum.toString();
14051
- args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);
14136
+ var colSpan = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
14137
+ var colum = parseInt(colSpan, 10) - 1;
14138
+ args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
14052
14139
  }
14053
14140
  var focusElement = this.parent.grid.contentModule.getRows();
14054
14141
  for (var i = 0; i < focusElement.length; i++) {
@@ -14282,6 +14369,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14282
14369
  this.parent["" + action]('refresh-virtual-editform-cells', this.refreshCell, this);
14283
14370
  this.parent["" + action]('virtaul-cell-focus', this.cellFocus, this);
14284
14371
  this.parent["" + action]('virtual-scroll-edit', this.restoreEditState, this);
14372
+ this.parent["" + action]('set-virtual-page-query', this.SetVirtualPageQury, this);
14285
14373
  }
14286
14374
  else {
14287
14375
  _super.prototype.eventListener.call(this, 'on');
@@ -14534,6 +14622,18 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14534
14622
  var restoreEdit = 'restoreEdit';
14535
14623
  _super.prototype["" + restoreEdit].call(this);
14536
14624
  };
14625
+ VirtualTreeContentRenderer.prototype.SetVirtualPageQury = function (args) {
14626
+ var visiblePage = [];
14627
+ if (this.prevInfo && this.prevInfo.blockIndexes) {
14628
+ visiblePage = getVisiblePage(this.prevInfo.blockIndexes);
14629
+ }
14630
+ if ((this.requestType === 'refresh') && visiblePage.length) {
14631
+ args.query.skip(this.parent.pageSettings.pageSize * (visiblePage[0] - 1));
14632
+ args.query.take(this.parent.pageSettings.pageSize * visiblePage.length);
14633
+ args.skipPage = true;
14634
+ return;
14635
+ }
14636
+ };
14537
14637
  /**
14538
14638
  * Resets the edit state if certain conditions are met.
14539
14639
  *
@@ -14674,6 +14774,19 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14674
14774
  var xAxis = current.axis === 'X';
14675
14775
  var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]
14676
14776
  - 1);
14777
+ if (_this.parent.isFrozenGrid() && _this.parent.enableColumnVirtualization && _this.currentInfo &&
14778
+ _this.currentInfo.columnIndexes) {
14779
+ var cBlock = _this.currentInfo.columnIndexes[0] - 1;
14780
+ var frzLeftWidth_1 = 0;
14781
+ _this.parent.getColumns().filter(function (col) {
14782
+ if (col.visible && col.freeze === 'Left') {
14783
+ frzLeftWidth_1 += parseInt(col.width.toString(), 10);
14784
+ }
14785
+ });
14786
+ if (cBlock > _this.parent.getVisibleFrozenLeftCount()) {
14787
+ x = x - frzLeftWidth_1;
14788
+ }
14789
+ }
14677
14790
  if (xAxis) {
14678
14791
  var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;
14679
14792
  var maxLeft = _this.vgenerator.cOffsets[idx - 1];
@@ -14691,6 +14804,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14691
14804
  }
14692
14805
  if (_this.parent.enableColumnVirtualization) {
14693
14806
  _this.header.virtualEle.adjustTable(x, 0);
14807
+ if (_this.parent.isFrozenGrid()) {
14808
+ _this.parent.contentModule['resetStickyLeftPos'](x);
14809
+ }
14694
14810
  }
14695
14811
  }
14696
14812
  }
@@ -14835,10 +14951,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14835
14951
  if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14836
14952
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
14837
14953
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
14838
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
14954
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
14839
14955
  var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
14840
14956
  this.previousInfo = viewInfo;
14841
- if (this.prevInfo && viewInfo.event !== 'refresh-virtual-block' && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14957
+ if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14842
14958
  || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
14843
14959
  || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
14844
14960
  && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
@@ -14860,7 +14976,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14860
14976
  viewInfo.loadNext = false;
14861
14977
  }
14862
14978
  this.requestType = 'virtualscroll';
14863
- if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
14979
+ if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left' && !isRemoteData(this.parent.root)) {
14864
14980
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
14865
14981
  }
14866
14982
  if (this.parent.enableVirtualMaskRow) {
@@ -14933,9 +15049,33 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14933
15049
  if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
14934
15050
  this.isExpandCollapse = false;
14935
15051
  }
15052
+ var reduceWidth_1 = 0;
15053
+ if (this.parent.enableColumnVirtualization && this.parent.isFrozenGrid()) {
15054
+ var frzLeftWidth_2 = 0;
15055
+ this.parent.getColumns().filter(function (col) {
15056
+ if (col.visible) {
15057
+ reduceWidth_1 += parseInt(col.width.toString(), 10);
15058
+ if (col.freeze === 'Left') {
15059
+ frzLeftWidth_2 += parseInt(col.width.toString(), 10);
15060
+ }
15061
+ }
15062
+ });
15063
+ var cIndex = info.columnIndexes;
15064
+ width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
15065
+ if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
15066
+ cOffset = cOffset - frzLeftWidth_2;
15067
+ }
15068
+ this.resetStickyLeftPos(cOffset, newChild);
15069
+ }
14936
15070
  if (!this.isExpandCollapse || this.translateY === 0) {
14937
15071
  this.translateY = this.translateY < 0 ? 0 : this.translateY;
14938
15072
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
15073
+ if (this.parent.enableColumnVirtualization) {
15074
+ this.header.virtualEle.adjustTable(cOffset, 0);
15075
+ if (this.parent.isFrozenGrid()) {
15076
+ this.resetStickyLeftPos(cOffset);
15077
+ }
15078
+ }
14939
15079
  }
14940
15080
  else {
14941
15081
  this.isExpandCollapse = false;
@@ -15053,7 +15193,12 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
15053
15193
  this["" + options].prevTop = this["" + options].prevLeft = 0;
15054
15194
  var isScrollByFocus = 'isScrollByFocus';
15055
15195
  return function (e) {
15056
- if (instance.isEdit && instance.root.editModule["" + isScrollByFocus]) {
15196
+ var keyPress = 'keyPress';
15197
+ var keyaction;
15198
+ if (instance && instance.root && instance.root.editModule && instance.root.editModule["" + keyPress]) {
15199
+ keyaction = instance.root.editModule["" + keyPress];
15200
+ }
15201
+ if ((instance.isEdit && instance.root.editModule["" + isScrollByFocus]) || (instance.isEdit && (keyaction === 'tab' || keyaction === 'shiftTab'))) {
15057
15202
  instance.root.editModule["" + isScrollByFocus] = false;
15058
15203
  return;
15059
15204
  }