@syncfusion/ej2-treegrid 29.2.8 → 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 (95) 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 +246 -139
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +306 -168
  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/summary.js +2 -16
  23. package/src/treegrid/actions/toolbar.js +2 -2
  24. package/src/treegrid/base/data.js +34 -14
  25. package/src/treegrid/base/treegrid-model.d.ts +7 -0
  26. package/src/treegrid/base/treegrid.d.ts +7 -0
  27. package/src/treegrid/base/treegrid.js +85 -51
  28. package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
  29. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
  30. package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
  31. package/styles/bds-lite.css +30 -0
  32. package/styles/bds.css +30 -0
  33. package/styles/bootstrap-dark-lite.css +30 -0
  34. package/styles/bootstrap-dark.css +30 -0
  35. package/styles/bootstrap-lite.css +30 -0
  36. package/styles/bootstrap.css +30 -0
  37. package/styles/bootstrap4-lite.css +30 -0
  38. package/styles/bootstrap4.css +30 -0
  39. package/styles/bootstrap5-dark-lite.css +30 -0
  40. package/styles/bootstrap5-dark.css +30 -0
  41. package/styles/bootstrap5-lite.css +30 -0
  42. package/styles/bootstrap5.3-lite.css +30 -0
  43. package/styles/bootstrap5.3.css +30 -0
  44. package/styles/bootstrap5.css +30 -0
  45. package/styles/fabric-dark-lite.css +30 -0
  46. package/styles/fabric-dark.css +30 -0
  47. package/styles/fabric-lite.css +30 -0
  48. package/styles/fabric.css +30 -0
  49. package/styles/fluent-dark-lite.css +30 -0
  50. package/styles/fluent-dark.css +30 -0
  51. package/styles/fluent-lite.css +30 -0
  52. package/styles/fluent.css +30 -0
  53. package/styles/fluent2-lite.css +30 -0
  54. package/styles/fluent2.css +30 -3
  55. package/styles/highcontrast-light-lite.css +30 -0
  56. package/styles/highcontrast-light.css +30 -0
  57. package/styles/highcontrast-lite.css +30 -0
  58. package/styles/highcontrast.css +30 -0
  59. package/styles/material-dark-lite.css +30 -0
  60. package/styles/material-dark.css +30 -0
  61. package/styles/material-lite.css +30 -0
  62. package/styles/material.css +30 -0
  63. package/styles/material3-dark-lite.css +30 -0
  64. package/styles/material3-dark.css +30 -0
  65. package/styles/material3-lite.css +30 -0
  66. package/styles/material3.css +30 -0
  67. package/styles/tailwind-dark-lite.css +30 -0
  68. package/styles/tailwind-dark.css +30 -0
  69. package/styles/tailwind-lite.css +30 -0
  70. package/styles/tailwind.css +30 -0
  71. package/styles/tailwind3-lite.css +30 -0
  72. package/styles/tailwind3.css +30 -0
  73. package/styles/treegrid/_bigger.scss +66 -66
  74. package/styles/treegrid/_layout.scss +39 -0
  75. package/styles/treegrid/bds.css +30 -0
  76. package/styles/treegrid/bootstrap-dark.css +30 -0
  77. package/styles/treegrid/bootstrap.css +30 -0
  78. package/styles/treegrid/bootstrap4.css +30 -0
  79. package/styles/treegrid/bootstrap5-dark.css +30 -0
  80. package/styles/treegrid/bootstrap5.3.css +30 -0
  81. package/styles/treegrid/bootstrap5.css +30 -0
  82. package/styles/treegrid/fabric-dark.css +30 -0
  83. package/styles/treegrid/fabric.css +30 -0
  84. package/styles/treegrid/fluent-dark.css +30 -0
  85. package/styles/treegrid/fluent.css +30 -0
  86. package/styles/treegrid/fluent2.css +30 -3
  87. package/styles/treegrid/highcontrast-light.css +30 -0
  88. package/styles/treegrid/highcontrast.css +30 -0
  89. package/styles/treegrid/material-dark.css +30 -0
  90. package/styles/treegrid/material.css +30 -0
  91. package/styles/treegrid/material3-dark.css +30 -0
  92. package/styles/treegrid/material3.css +30 -0
  93. package/styles/treegrid/tailwind-dark.css +30 -0
  94. package/styles/treegrid/tailwind.css +30 -0
  95. package/styles/treegrid/tailwind3.css +30 -0
@@ -1,5 +1,5 @@
1
1
  import { merge, Property, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
2
- import { Logger as Logger$1, Grid, 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, RowDD as RowDD$1, Scroll, VirtualRowModelGenerator, Filter as Filter$1, ExcelExport as ExcelExport$1, Data, ExportHelper, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, Aggregate as Aggregate$1, calculateAggregate, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, Edit as Edit$1, resetRowIndex, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, VirtualContentRenderer, Cell, InterSectionObserver, getTransformValues, VirtualScroll as VirtualScroll$1, RenderType, VirtualHeaderRenderer, ColumnChooser as ColumnChooser$1, InfiniteScroll as InfiniteScroll$1, RowRenderer } from '@syncfusion/ej2-grids';
2
+ import { Logger as Logger$1, Grid, 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, RowDD as RowDD$1, Scroll, VirtualRowModelGenerator, Filter as Filter$1, ExcelExport as ExcelExport$1, Data, ExportHelper, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, Aggregate as Aggregate$1, calculateAggregate, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, Edit as Edit$1, resetRowIndex, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, VirtualContentRenderer, Cell, getVisiblePage, InterSectionObserver, getTransformValues, VirtualScroll as VirtualScroll$1, RenderType, VirtualHeaderRenderer, ColumnChooser as ColumnChooser$1, InfiniteScroll as InfiniteScroll$1, RowRenderer } 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';
@@ -519,12 +519,13 @@ class TreeClipboard extends Clipboard {
519
519
  if (i > 0) {
520
520
  this.treeCopyContent += '\n';
521
521
  }
522
- if (!rows[selectedIndexes[parseInt(i.toString(), 10)]].classList.contains('e-summaryrow')) {
523
- const cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell'));
522
+ const selectedRowIndex = selectedIndexes[parseInt(i.toString(), 10)];
523
+ if (!rows[selectedRowIndex].classList.contains('e-summaryrow')) {
524
+ const cells = [].slice.call(rows[selectedRowIndex].querySelectorAll('.e-rowcell'));
524
525
  const uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)][`${uniqueID}`];
525
526
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
526
527
  if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
527
- this.parentContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], rows, withHeader, i);
528
+ this.parentContentData(currentRecords, selectedRowIndex, rows, withHeader, i);
528
529
  }
529
530
  this[`${getCopyData}`](cells, false, '\t', withHeader);
530
531
  this.treeCopyContent += this[`${copyContent}`];
@@ -537,11 +538,7 @@ class TreeClipboard extends Clipboard {
537
538
  }
538
539
  }
539
540
  if (withHeader) {
540
- const headerTextArray = [];
541
- for (let i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {
542
- headerTextArray[parseInt(i.toString(), 10)] =
543
- this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].headerText;
544
- }
541
+ const headerTextArray = this.treeGridParent.getVisibleColumns().map((col) => col.headerText);
545
542
  this[`${getCopyData}`](headerTextArray, false, '\t', withHeader);
546
543
  this.treeCopyContent = this[`${copyContent}`] + '\n' + this.treeCopyContent;
547
544
  }
@@ -2113,6 +2110,15 @@ class DataManipulation {
2113
2110
  if (parentRec) {
2114
2111
  records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
2115
2112
  }
2113
+ else {
2114
+ const parentRec = args.actual.flatData.find((record) => record[`${this.parent.idMapping}`] === parentID);
2115
+ if (isNullOrUndefined(parentRec[`${this.parent.parentIdMapping}`])) {
2116
+ records[parseInt(rec.toString(), 10)].level = 1;
2117
+ }
2118
+ else {
2119
+ records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
2120
+ }
2121
+ }
2116
2122
  }
2117
2123
  else {
2118
2124
  records[parseInt(rec.toString(), 10)].level = 0;
@@ -2207,33 +2213,33 @@ class DataManipulation {
2207
2213
  fetchRemoteChildData(rowDetails) {
2208
2214
  const args = { row: rowDetails.parentRow, data: rowDetails.record };
2209
2215
  const dm = this.parent.dataSource;
2210
- const qry = this.parent.grid.getDataModule().generateQuery();
2211
- const clonequries = qry.queries.filter((e) => e.fn !== 'onPage' && e.fn !== 'onWhere');
2212
- qry.queries = clonequries;
2213
- qry.isCountRequired = true;
2216
+ const query = this.parent.grid.getDataModule().generateQuery();
2217
+ const clonequries = query.queries.filter((e) => e.fn !== 'onPage' && e.fn !== 'onWhere');
2218
+ query.queries = clonequries;
2219
+ query.isCountRequired = true;
2214
2220
  let idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
2215
2221
  if (isNaN(idMappingValue)) {
2216
2222
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
2217
2223
  }
2218
2224
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2219
- qry.take(this.parent.pageSettings.pageSize);
2225
+ query.take(this.parent.grid.pageSettings.pageSize);
2220
2226
  const expandDetail = [];
2221
2227
  expandDetail.push('ExpandingAction', idMappingValue.toString());
2222
- qry.expand(expandDetail);
2228
+ query.expand(expandDetail);
2223
2229
  }
2224
2230
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
2225
- qry.take(this.parent.grid.pageSettings.pageSize);
2231
+ query.take(this.parent.grid.pageSettings.pageSize);
2226
2232
  const expandDetail = [];
2227
2233
  expandDetail.push('CollapsingAction', idMappingValue.toString());
2228
- qry.expand(expandDetail);
2234
+ query.expand(expandDetail);
2229
2235
  }
2230
- qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2236
+ query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2231
2237
  if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
2232
2238
  const filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter((e) => e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined');
2233
- qry.queries.push(filterqry[0]);
2239
+ query.queries.push(filterqry[0]);
2234
2240
  }
2235
2241
  showSpinner(this.parent.element);
2236
- dm.executeQuery(qry).then((e) => {
2242
+ dm.executeQuery(query).then((e) => {
2237
2243
  const remoteExpandedData = 'remoteExpandedData';
2238
2244
  const remoteCollapsedData = 'remoteCollapsedData';
2239
2245
  const level = 'level';
@@ -2406,8 +2412,15 @@ class DataManipulation {
2406
2412
  record.expanded = false;
2407
2413
  }
2408
2414
  }
2409
- datas.splice(inx + r + 1, 0, record);
2415
+ const exists = datas.some((data) => data[`${this.parent.idMapping}`] === record[this.parent.idMapping]);
2416
+ if (!exists) {
2417
+ datas.splice(inx + r + 1, 0, record);
2418
+ }
2410
2419
  }
2420
+ const localIdMapping = this.parent.idMapping;
2421
+ datas.sort(function (firstRecord, secondRecord) {
2422
+ return firstRecord[`${localIdMapping}`] - secondRecord[`${localIdMapping}`];
2423
+ });
2411
2424
  setValue('result', datas, e);
2412
2425
  setValue('action', 'beforecontentrender', e);
2413
2426
  this.parent.trigger(actionComplete, e);
@@ -2450,7 +2463,8 @@ class DataManipulation {
2450
2463
  const contentModule = getValue('grid.contentModule', this.parent);
2451
2464
  const currentInfo = getValue('currentInfo', contentModule);
2452
2465
  const prevInfo = getValue('prevInfo', contentModule);
2453
- if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {
2466
+ if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
2467
+ && !this.parent.loadChildOnDemand) {
2454
2468
  this.parent.grid.pageSettings.currentPage = prevInfo.page;
2455
2469
  }
2456
2470
  }
@@ -3352,7 +3366,9 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3352
3366
  }
3353
3367
  else {
3354
3368
  if (!isNullOrUndefined(child) && record[`${key}`] !== child[`${key}`]) {
3355
- record.childRecords.push(child);
3369
+ if (!record.childRecords.some((records) => records.uniqueID === child.uniqueID)) {
3370
+ record.childRecords.push(child);
3371
+ }
3356
3372
  }
3357
3373
  }
3358
3374
  if (record.childRecords.indexOf(childRecords) === -1 && record[`${key}`] !== child[`${key}`]) {
@@ -3817,7 +3833,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3817
3833
  parentTarget = target.parentElement;
3818
3834
  if (!isNullOrUndefined(parentTarget)) {
3819
3835
  const cellIndex = parentTarget.cellIndex;
3820
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3836
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3821
3837
  parentTarget = target;
3822
3838
  }
3823
3839
  summaryElement = this.findnextRowElement(parentTarget);
@@ -3825,8 +3841,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3825
3841
  const cellIndex = target.cellIndex;
3826
3842
  const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
3827
3843
  if (!isNullOrUndefined(row) && !this.grid.isEdit) {
3828
- addClass([row], 'e-focused');
3829
- addClass([row], 'e-focus');
3844
+ const focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
3845
+ focusedCells.forEach((cell) => {
3846
+ removeClass([cell], ['e-focused', 'e-focus']);
3847
+ });
3848
+ addClass([row], ['e-focused', 'e-focus']);
3830
3849
  }
3831
3850
  }
3832
3851
  else {
@@ -3846,7 +3865,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3846
3865
  parentTarget = target.parentElement;
3847
3866
  if (!isNullOrUndefined(parentTarget)) {
3848
3867
  const cellIndex = parentTarget.cellIndex;
3849
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3868
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3850
3869
  parentTarget = target;
3851
3870
  }
3852
3871
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -3855,8 +3874,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3855
3874
  if (!isNullOrUndefined(cellIndex)) {
3856
3875
  const row = summaryElement.children[parseInt(cellIndex.toString(), 10)];
3857
3876
  if (!isNullOrUndefined(row) && !this.grid.isEdit) {
3858
- addClass([row], 'e-focused');
3859
- addClass([row], 'e-focus');
3877
+ const focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
3878
+ focusedCells.forEach((cell) => {
3879
+ removeClass([cell], ['e-focused', 'e-focus']);
3880
+ });
3881
+ addClass([row], ['e-focused', 'e-focus']);
3860
3882
  }
3861
3883
  }
3862
3884
  }
@@ -4221,11 +4243,14 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4221
4243
  const destroyTemplate = 'destroyTemplate';
4222
4244
  const destroyTemplateFn = this.grid[`${destroyTemplate}`];
4223
4245
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4224
- this.grid[`${destroyTemplate}`] = (args, index) => {
4246
+ this.grid[`${destroyTemplate}`] = (args, index, callback) => {
4225
4247
  destroyTemplateFn.apply(this.grid);
4226
4248
  const portals = 'portals';
4227
4249
  if (!(this.isReact && isNullOrUndefined(this[`${portals}`]))) {
4228
- this.clearTemplate(args, index);
4250
+ this.clearTemplate(args, index, callback);
4251
+ }
4252
+ else if (!isNullOrUndefined(callback)) {
4253
+ callback();
4229
4254
  }
4230
4255
  };
4231
4256
  }
@@ -4325,12 +4350,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4325
4350
  }
4326
4351
  if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
4327
4352
  this.flatData = data;
4328
- this.flatData.filter((e) => {
4329
- setValue('uniqueIDCollection.' + e.uniqueID, e, this);
4330
- if (e.level === 0 && !this.parentData.some((record) => record.uniqueID === e.uniqueID)) {
4331
- this.parentData.push(e);
4353
+ for (let i = 0, len = this.flatData.length; i < len; i++) {
4354
+ const rowData = this.flatData[parseInt(i.toString(), 10)];
4355
+ setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this);
4356
+ if (rowData.level === 0 && !this.parentData.some((record) => record.uniqueID === rowData.uniqueID)) {
4357
+ this.parentData.push(rowData);
4332
4358
  }
4333
- });
4359
+ }
4334
4360
  }
4335
4361
  else {
4336
4362
  if (isCountRequired(this)) {
@@ -4420,6 +4446,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4420
4446
  this.grid[`${isJsComponent}`] = true;
4421
4447
  const enableHtmlSanitizer = 'enableHtmlSanitizer';
4422
4448
  this.grid[`${enableHtmlSanitizer}`] = this.enableHtmlSanitizer;
4449
+ this.grid.enableStickyHeader = this.enableStickyHeader;
4450
+ const isTreeGrid = 'isTreeGrid';
4451
+ this.grid[`${isTreeGrid}`] = true;
4423
4452
  }
4424
4453
  triggerEvents(args) {
4425
4454
  this.trigger(getObject('name', args), args);
@@ -4555,6 +4584,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4555
4584
  }
4556
4585
  extendedGridDataBoundEvent() {
4557
4586
  this.grid.dataBound = (args) => {
4587
+ this.lastRowBorderEventListener();
4558
4588
  this.updateRowTemplate();
4559
4589
  this.updateColumnModel();
4560
4590
  this.updateAltRow(this.getRows());
@@ -4647,6 +4677,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4647
4677
  }
4648
4678
  };
4649
4679
  }
4680
+ lastRowBorderEventListener() {
4681
+ this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
4682
+ }
4650
4683
  bindCallBackEvents() {
4651
4684
  this.grid.toolbarClick = (args) => {
4652
4685
  if ((args.item.id === this.grid.element.id + '_excelexport' && this.allowExcelExport === false) ||
@@ -4810,6 +4843,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4810
4843
  if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
4811
4844
  args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
4812
4845
  args.cancel = true;
4846
+ return;
4813
4847
  }
4814
4848
  const requestType = getObject('requestType', args);
4815
4849
  if (requestType === 'reorder') {
@@ -5006,11 +5040,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5006
5040
  const record = this.dataSource[0];
5007
5041
  // }
5008
5042
  const keys = Object.keys(record);
5009
- for (let i = 0; i < keys.length; i++) {
5010
- if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
5011
- this.columns.push(keys[parseInt(i.toString(), 10)]);
5012
- }
5013
- }
5043
+ this.columns = keys.filter((key) => { return [this.childMapping, this.parentIdMapping].indexOf(key) === -1; });
5014
5044
  }
5015
5045
  }
5016
5046
  getGridEditSettings() {
@@ -5162,7 +5192,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5162
5192
  gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
5163
5193
  }
5164
5194
  else {
5165
- for (const prop of Object.keys(column[parseInt(i.toString(), 10)])) {
5195
+ const columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
5196
+ for (let j = 0; j < columnProps.length; j++) {
5197
+ const prop = columnProps[parseInt(j.toString(), 10)];
5166
5198
  if (index === this.treeColumnIndex && prop === 'template') {
5167
5199
  treeGridColumn[`${prop}`] = column[parseInt(i.toString(), 10)][`${prop}`];
5168
5200
  }
@@ -5332,6 +5364,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5332
5364
  break;
5333
5365
  case 'rowHeight':
5334
5366
  this.grid.rowHeight = this.rowHeight;
5367
+ this.refresh();
5335
5368
  break;
5336
5369
  case 'height':
5337
5370
  if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
@@ -5407,6 +5440,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5407
5440
  case 'columnMenuItems':
5408
5441
  this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
5409
5442
  break;
5443
+ case 'enableStickyHeader':
5444
+ this.grid.enableStickyHeader = this.enableStickyHeader;
5445
+ break;
5410
5446
  case 'editSettings':
5411
5447
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[`${prop}`].mode &&
5412
5448
  (newProp[`${prop}`].mode === 'Cell' || newProp[`${prop}`].mode === 'Row')) {
@@ -6291,13 +6327,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6291
6327
  * @returns {Column[]} - Returns an array of visible column objects.
6292
6328
  */
6293
6329
  getVisibleColumns() {
6294
- const cols = [];
6295
- for (const col of this.columnModel) {
6296
- if (col.visible) {
6297
- cols.push(col);
6298
- }
6299
- }
6300
- return cols;
6330
+ return this.columnModel.filter((col) => col.visible);
6301
6331
  }
6302
6332
  /**
6303
6333
  * Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
@@ -6425,17 +6455,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6425
6455
  getTreeColumn() {
6426
6456
  const columnModel = 'columnModel';
6427
6457
  const treeColumn = this[`${columnModel}`][this.treeColumnIndex];
6428
- let treeIndex;
6429
6458
  const updatedCols = this.getColumns();
6430
- for (let f = 0; f < updatedCols.length; f++) {
6431
- const treeColumnfield = getObject('field', treeColumn);
6432
- const parentColumnfield = getObject('field', updatedCols[parseInt(f.toString(), 10)]);
6433
- if (treeColumnfield === parentColumnfield) {
6434
- treeIndex = f;
6435
- break;
6436
- }
6459
+ const treeColumnField = getObject('field', treeColumn);
6460
+ const treeIndex = updatedCols.findIndex((col) => getObject('field', col) === treeColumnField);
6461
+ if (!isNullOrUndefined(treeIndex)) {
6462
+ this.setProperties({ treeColumnIndex: treeIndex }, true);
6437
6463
  }
6438
- this.setProperties({ treeColumnIndex: treeIndex }, true);
6439
6464
  }
6440
6465
  /**
6441
6466
  * Refreshes the header section of the TreeGrid to reflect any structural or data changes.
@@ -6883,8 +6908,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6883
6908
  if (this.editSettings.mode === 'Batch') {
6884
6909
  const obj = 'dialogObj';
6885
6910
  const showDialog = 'showDialog';
6886
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
6887
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
6911
+ const changes = this.getBatchChanges ? this.getBatchChanges() : {};
6912
+ const changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
6913
+ const deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
6914
+ const added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
6915
+ const hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
6916
+ if (hasChanges && this.editSettings.showConfirmDialog) {
6888
6917
  const dialogObj = this.grid.editModule[`${obj}`];
6889
6918
  this.grid.editModule[`${showDialog}`]('CancelEdit', dialogObj);
6890
6919
  return;
@@ -6910,8 +6939,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6910
6939
  if (this.editSettings.mode === 'Batch') {
6911
6940
  const obj = 'dialogObj';
6912
6941
  const showDialog = 'showDialog';
6913
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
6914
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
6942
+ const changes = this.getBatchChanges ? this.getBatchChanges() : {};
6943
+ const changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
6944
+ const deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
6945
+ const added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
6946
+ const hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
6947
+ if (hasChanges && this.editSettings.showConfirmDialog) {
6915
6948
  const dialogObj = this.grid.editModule[`${obj}`];
6916
6949
  this.grid.editModule[`${showDialog}`]('CancelEdit', dialogObj);
6917
6950
  return;
@@ -7197,6 +7230,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7197
7230
  remoteExpand(action, row, record) {
7198
7231
  let gridRows = this.getRows();
7199
7232
  const fetchRemoteChildData = 'fetchRemoteChildData';
7233
+ const requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
7234
+ this.grid.contentModule.requestType = requestType;
7200
7235
  if (this.rowTemplate) {
7201
7236
  const rows = this.getContentTable().rows;
7202
7237
  gridRows = [].slice.call(rows);
@@ -7263,6 +7298,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7263
7298
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
7264
7299
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
7265
7300
  }
7301
+ if (this.detailTemplate) {
7302
+ gridRows.forEach((row) => {
7303
+ if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
7304
+ row.style.display = '';
7305
+ }
7306
+ });
7307
+ }
7266
7308
  const detailrows = gridRows.filter((r) => r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1)));
7267
7309
  for (let i = 0; i < rows.length; i++) {
7268
7310
  if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)])) {
@@ -7421,7 +7463,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7421
7463
  addListener() {
7422
7464
  this.on('updateResults', this.updateResultModel, this);
7423
7465
  this.grid.on('initial-end', this.afterGridRender, this);
7424
- this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
7425
7466
  }
7426
7467
  updateResultModel(returnResult) {
7427
7468
  this.dataResults = returnResult;
@@ -8014,6 +8055,9 @@ __decorate$b([
8014
8055
  __decorate$b([
8015
8056
  Property(false)
8016
8057
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
8058
+ __decorate$b([
8059
+ Property(false)
8060
+ ], TreeGrid.prototype, "enableStickyHeader", void 0);
8017
8061
  __decorate$b([
8018
8062
  Property('auto')
8019
8063
  ], TreeGrid.prototype, "height", void 0);
@@ -10012,20 +10056,13 @@ class RowDD {
10012
10056
  if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {
10013
10057
  this.removeChildItem(deletedRow);
10014
10058
  }
10015
- let idx;
10016
- let idz;
10017
10059
  const treeGridData = dataSource;
10018
- for (let i = 0; i < treeGridData.length; i++) {
10019
- if (treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {
10020
- idx = i;
10021
- }
10022
- }
10023
- for (let i = 0; i < this.treeGridData.length; i++) {
10024
- if (this.treeGridData[parseInt(i.toString(), 10)][this.parent.idMapping]
10025
- === deletedRow.taskData[this.parent.idMapping]) {
10026
- idz = i;
10027
- }
10028
- }
10060
+ const idx = treeGridData.findIndex((data) => {
10061
+ return data[this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping];
10062
+ });
10063
+ const idz = this.treeGridData.findIndex((data) => {
10064
+ return data[this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping];
10065
+ });
10029
10066
  if (idx !== -1 && !isNullOrUndefined(idx)) {
10030
10067
  dataSource.splice(idx, 1);
10031
10068
  }
@@ -10260,10 +10297,15 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
10260
10297
  }
10261
10298
  generateRows(data, notifyArgs) {
10262
10299
  const info = this.getDataInfo();
10263
- if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
10264
- if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
10265
- || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10266
- notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10300
+ if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
10301
+ notifyArgs.virtualInfo = this['prevInfo'];
10302
+ }
10303
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
10304
+ if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
10305
+ if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
10306
+ || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10307
+ notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10308
+ }
10267
10309
  }
10268
10310
  else {
10269
10311
  notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
@@ -10304,7 +10346,10 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
10304
10346
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
10305
10347
  this.cache[parseInt(currentPage.toString(), 10)].length >
10306
10348
  (this.parent.contentModule).getBlockSize()) {
10307
- delete this.cache[parseInt(currentPage.toString(), 10)];
10349
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
10350
+ this.cache[parseInt(currentPage.toString(), 10)] =
10351
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
10352
+ }
10308
10353
  }
10309
10354
  }
10310
10355
  else {
@@ -10391,11 +10436,11 @@ class Filter {
10391
10436
  this.filteredParentRecs = [];
10392
10437
  this.filteredResult = [];
10393
10438
  this.isHierarchyFilter = false;
10439
+ const hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10440
+ : this.parent.searchSettings.hierarchyMode;
10394
10441
  for (let f = 0; f < this.flatFilteredData.length; f++) {
10395
10442
  const rec = this.flatFilteredData[parseInt(f.toString(), 10)];
10396
10443
  this.addParentRecord(rec);
10397
- const hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10398
- : this.parent.searchSettings.hierarchyMode;
10399
10444
  if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&
10400
10445
  (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {
10401
10446
  this.isHierarchyFilter = true;
@@ -10407,8 +10452,6 @@ class Filter {
10407
10452
  const parent = getObject('parentItem', rec);
10408
10453
  if (!isNullOrUndefined(parent)) {
10409
10454
  const parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);
10410
- //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {
10411
- // return e.uniqueID === rec.parentItem.uniqueID; })[0];
10412
10455
  setValue('hasFilteredChildRecords', true, parRecord);
10413
10456
  if (parRecord && parRecord.parentItem) {
10414
10457
  this.updateParentFilteredRecord(parRecord);
@@ -10432,7 +10475,6 @@ class Filter {
10432
10475
  }
10433
10476
  addParentRecord(record) {
10434
10477
  const parent = getParentData(this.parent, record.parentUniqueID);
10435
- //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];
10436
10478
  const hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode
10437
10479
  : this.parent.searchSettings.hierarchyMode;
10438
10480
  if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0
@@ -11188,8 +11230,8 @@ class Toolbar {
11188
11230
  }
11189
11231
  row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
11190
11232
  if (indentEle !== null && outdentEle !== null) {
11191
- indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
11192
- outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
11233
+ indentElement = indentEle.parentElement;
11234
+ outdentElement = outdentEle.parentElement;
11193
11235
  if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
11194
11236
  indentElement.classList.add('e-hidden');
11195
11237
  outdentElement.classList.add('e-hidden');
@@ -11322,14 +11364,7 @@ class Aggregate {
11322
11364
  calculateSummaryValue(summaryQuery, filteredData, isSort) {
11323
11365
  this.summaryQuery = summaryQuery;
11324
11366
  let parentRecord;
11325
- const parentDataLength = Object.keys(filteredData).length;
11326
- const parentData = [];
11327
- for (let p = 0, len = parentDataLength; p < len; p++) {
11328
- const summaryRow = getObject('isSummaryRow', filteredData[parseInt(p.toString(), 10)]);
11329
- if (!summaryRow) {
11330
- parentData.push(filteredData[parseInt(p.toString(), 10)]);
11331
- }
11332
- }
11367
+ const parentData = filteredData.filter((data) => !getObject('isSummaryRow', data));
11333
11368
  const parentRecords = findParentRecords(parentData);
11334
11369
  const flatRecords = parentData.slice();
11335
11370
  const summaryLength = Object.keys(this.parent.aggregates).length;
@@ -11482,14 +11517,7 @@ class Aggregate {
11482
11517
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
11483
11518
  }
11484
11519
  const value = single[`${summaryColumn.columnName}`][`${summaryKey}`];
11485
- let summaryValue;
11486
- if (cellElement.innerHTML.indexOf(value) === -1) {
11487
- summaryValue = cellElement.innerHTML + value;
11488
- return summaryValue;
11489
- }
11490
- else {
11491
- return cellElement.innerHTML;
11492
- }
11520
+ return cellElement.innerHTML.indexOf(value) === -1 ? cellElement.innerHTML + value : cellElement.innerHTML;
11493
11521
  }
11494
11522
  getFormatFromType(summaryformat, type) {
11495
11523
  if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {
@@ -11855,6 +11883,7 @@ class BatchEdit {
11855
11883
  this.parent.on('batchCancelAction', this.batchCancelAction, this);
11856
11884
  this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);
11857
11885
  this.parent.grid.on('next-cell-index', this.nextCellIndex, this);
11886
+ this.parent.grid.on('cellfocused', this.onCellFocused, this);
11858
11887
  }
11859
11888
  /**
11860
11889
  * @hidden
@@ -11874,6 +11903,7 @@ class BatchEdit {
11874
11903
  this.parent.off('batchCancelAction', this.batchCancelAction);
11875
11904
  this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);
11876
11905
  this.parent.grid.off('next-cell-index', this.nextCellIndex);
11906
+ this.parent.grid.off('cellfocused', this.onCellFocused);
11877
11907
  }
11878
11908
  /**
11879
11909
  * To destroy the editModule
@@ -11915,11 +11945,11 @@ class BatchEdit {
11915
11945
  batchPageAction() {
11916
11946
  const data = (this.parent.grid.dataSource instanceof DataManager ?
11917
11947
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
11918
- const primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
11948
+ const primaryKeyField = this.parent.grid.getPrimaryKeyFieldNames()[0];
11919
11949
  let index;
11920
11950
  if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {
11921
11951
  for (let i = 0; i < this.batchAddedRecords.length; i++) {
11922
- index = data.map((e) => { return e[`${primaryKey}`]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)][`${primaryKey}`]);
11952
+ index = data.findIndex((e) => { return e[`${primaryKeyField}`] === this.batchAddedRecords[parseInt(i.toString(), 10)][`${primaryKeyField}`]; });
11923
11953
  data.splice(index, 1);
11924
11954
  }
11925
11955
  }
@@ -12146,7 +12176,7 @@ class BatchEdit {
12146
12176
  childs.push(data);
12147
12177
  records = childs;
12148
12178
  for (let i = 0; i < records.length; i++) {
12149
- const indexvalue = this.batchRecords.map((e) => { return e[`${primarykey}`]; }).indexOf(records[parseInt(i.toString(), 10)][`${primarykey}`]);
12179
+ const indexvalue = this.batchRecords.findIndex((e) => { return e[`${primarykey}`] === records[parseInt(i.toString(), 10)][`${primarykey}`]; });
12150
12180
  if (indexvalue !== -1) {
12151
12181
  this.batchRecords.splice(indexvalue, 1);
12152
12182
  }
@@ -12165,11 +12195,11 @@ class BatchEdit {
12165
12195
  }
12166
12196
  updateChildCount(records) {
12167
12197
  const primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12168
- const addedRecords = 'addedRecords';
12198
+ const addedRecords = this.parent.getBatchChanges().addedRecords || [];
12169
12199
  const parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';
12170
- for (let i = 0; i < this.parent.getBatchChanges()[`${addedRecords}`].length; i++) {
12171
- if (!isNullOrUndefined(this.parent.getBatchChanges()[`${addedRecords}`][parseInt(i.toString(), 10)][`${parentItem}`])) {
12172
- if (this.parent.getBatchChanges()[`${addedRecords}`][parseInt(i.toString(), 10)][`${parentItem}`][`${primaryKey}`] === records[parseInt(this.addRowIndex.toString(), 10)][`${primaryKey}`]) {
12200
+ for (let i = 0; i < addedRecords.length; i++) {
12201
+ if (!isNullOrUndefined(addedRecords[parseInt(i.toString(), 10)][`${parentItem}`])) {
12202
+ if (addedRecords[parseInt(i.toString(), 10)][`${parentItem}`][`${primaryKey}`] === records[parseInt(this.addRowIndex.toString(), 10)][`${primaryKey}`]) {
12173
12203
  this.batchChildCount = this.batchChildCount + 1;
12174
12204
  }
12175
12205
  }
@@ -12217,7 +12247,7 @@ class BatchEdit {
12217
12247
  const primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
12218
12248
  if (!isNullOrUndefined(this.batchAddedRecords)) {
12219
12249
  for (let i = 0; i < this.batchAddedRecords.length; i++) {
12220
- index = data.map((e) => { return e[`${primaryKey}`]; }).indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)][`${primaryKey}`]);
12250
+ index = data.findIndex((e) => { return e[`${primaryKey}`] === this.batchAddedRecords[parseInt(i.toString(), 10)][`${primaryKey}`]; });
12221
12251
  if (index !== -1) {
12222
12252
  data.splice(index, 1);
12223
12253
  }
@@ -12229,7 +12259,7 @@ class BatchEdit {
12229
12259
  const children = currentViewRecords[parseInt(index.toString(), 10)][`${childRecords}`];
12230
12260
  for (let j = 0; children && j < children.length; j++) {
12231
12261
  if (children[parseInt(j.toString(), 10)][`${primaryKey}`] === this.batchAddedRecords[parseInt(i.toString(), 10)][`${primaryKey}`]) {
12232
- currentViewRecords[parseInt(index.toString(), 10)][`${childRecords}`].splice(j, 1);
12262
+ children.splice(j, 1);
12233
12263
  }
12234
12264
  }
12235
12265
  }
@@ -12360,9 +12390,11 @@ class BatchEdit {
12360
12390
  const indexValue = currentViewRecords.map((e) => { return e[`${primarykey}`]; })
12361
12391
  .indexOf(addRecords[parseInt(i.toString(), 10)][`${parentItem}`][`${primarykey}`]);
12362
12392
  const children = currentViewRecords[parseInt(indexValue.toString(), 10)][`${childRecords}`];
12363
- for (let j = 0; j < children.length; j++) {
12364
- if (children[parseInt(j.toString(), 10)][`${primarykey}`] === addRecords[parseInt(i.toString(), 10)][`${primarykey}`]) {
12365
- currentViewRecords[parseInt(indexValue.toString(), 10)][`${childRecords}`].splice(j, 1);
12393
+ if (!isNullOrUndefined(addRowIndex) && children.some((records) => records.uniqueID === addRowRecord.uniqueID)) {
12394
+ for (let j = 0; j < children.length; j++) {
12395
+ if (children[parseInt(j.toString(), 10)][`${primarykey}`] === addRecords[parseInt(i.toString(), 10)][`${primarykey}`]) {
12396
+ currentViewRecords[parseInt(indexValue.toString(), 10)][`${childRecords}`].splice(j, 1);
12397
+ }
12366
12398
  }
12367
12399
  }
12368
12400
  }
@@ -12443,6 +12475,15 @@ class BatchEdit {
12443
12475
  args[`${index}`] = this.batchIndex;
12444
12476
  }
12445
12477
  }
12478
+ onCellFocused(e) {
12479
+ if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.isEdit && e.keyArgs) {
12480
+ if (e.keyArgs.action === 'shiftEnter') {
12481
+ e.keyArgs.preventDefault();
12482
+ this.parent.endEdit();
12483
+ return;
12484
+ }
12485
+ }
12486
+ }
12446
12487
  }
12447
12488
 
12448
12489
  /**
@@ -12461,6 +12502,7 @@ class Edit {
12461
12502
  this.prevAriaRowIndex = '-1';
12462
12503
  this.isAddedRowByMethod = false;
12463
12504
  this.isAddedRowByContextMenu = false;
12505
+ this.isIndexUndefined = false;
12464
12506
  Grid.Inject(Edit$1);
12465
12507
  this.parent = parent;
12466
12508
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -12712,7 +12754,7 @@ class Edit {
12712
12754
  }
12713
12755
  }
12714
12756
  keyPressed(args) {
12715
- if (this.isOnBatch) {
12757
+ if (this.isOnBatch || args.action === 'tab' || args.action === 'shiftTab') {
12716
12758
  this.keyPress = args.action;
12717
12759
  }
12718
12760
  if (args.action === 'f2') {
@@ -13248,9 +13290,10 @@ class Edit {
13248
13290
  this.addRowRecord = this.parent.flatData[args.index];
13249
13291
  this.addRowIndex = args.index;
13250
13292
  }
13251
- if (this.parent.editSettings.newRowPosition === 'Child' &&
13293
+ if (this.parent.editSettings.newRowPosition === 'Child' && this.isIndexUndefined &&
13252
13294
  !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
13253
13295
  this.addRowRecord = this.parent.getSelectedRecords()[0];
13296
+ this.isIndexUndefined = false;
13254
13297
  }
13255
13298
  if (isNullOrUndefined(this.addRowRecord) && this.parent.getCurrentViewRecords().length > this.addRowIndex &&
13256
13299
  args.requestType === 'save' && this.parent.getSelectedRecords().length !== 0) {
@@ -13306,7 +13349,7 @@ class Edit {
13306
13349
  const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
13307
13350
  const withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
13308
13351
  this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
13309
- if (currentData.length) {
13352
+ if (currentData.length && !isNullOrUndefined(index)) {
13310
13353
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
13311
13354
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
13312
13355
  if (currentData[this.addRowIndex].parentItem) {
@@ -13314,7 +13357,7 @@ class Edit {
13314
13357
  }
13315
13358
  parentItem = currentData[this.addRowIndex].parentItem;
13316
13359
  }
13317
- if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {
13360
+ if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length && !isNullOrUndefined(index)) {
13318
13361
  level = currentData[this.addRowIndex].level;
13319
13362
  if (this.parent.editSettings.newRowPosition === 'Above') {
13320
13363
  position = 'before';
@@ -13391,12 +13434,16 @@ class Edit {
13391
13434
  }
13392
13435
  if (args.requestType === 'delete') {
13393
13436
  const deletedValues = args.data;
13394
- for (let i = 0; i < deletedValues.length; i++) {
13395
- if (deletedValues[parseInt(i.toString(), 10)].parentItem) {
13396
- const parentItem = getParentData(this.parent, deletedValues[parseInt(i.toString(), 10)].parentItem.uniqueID);
13397
- if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13398
- const childIndex = parentItem.childRecords.indexOf(deletedValues[parseInt(i.toString(), 10)]);
13399
- parentItem.childRecords.splice(childIndex, 1);
13437
+ const primaryKeyField = this.parent.getPrimaryKeyFieldNames();
13438
+ if (!isNullOrUndefined(primaryKeyField) && primaryKeyField.length > 0) {
13439
+ for (let i = 0; i < deletedValues.length; i++) {
13440
+ const deletevalue = deletedValues[parseInt(i.toString(), 10)].parentItem;
13441
+ if (deletevalue) {
13442
+ const parentItem = getParentData(this.parent, deletevalue.uniqueID);
13443
+ if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {
13444
+ const childIndex = parentItem.childRecords.findIndex((child) => deletedValues[parseInt(i.toString(), 10)][primaryKeyField[0]] === child[primaryKeyField[0]]);
13445
+ parentItem.childRecords.splice(childIndex, 1);
13446
+ }
13400
13447
  }
13401
13448
  }
13402
13449
  }
@@ -13412,6 +13459,9 @@ class Edit {
13412
13459
  if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {
13413
13460
  this.previousNewRowPosition = this.parent.editSettings.newRowPosition;
13414
13461
  }
13462
+ if (isNullOrUndefined(index)) {
13463
+ this.isIndexUndefined = true;
13464
+ }
13415
13465
  if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {
13416
13466
  const addRecords = [];
13417
13467
  const previousEditMode = this.parent.editSettings.mode;
@@ -13584,12 +13634,12 @@ class DetailRow {
13584
13634
  args[`${visible}`] = false;
13585
13635
  }
13586
13636
  dataBoundArg() {
13587
- const detailele = this.parent.getRows().filter((e) => {
13637
+ const detailRows = this.parent.getRows().filter((e) => {
13588
13638
  return !e.classList.contains('e-detailrow');
13589
13639
  });
13590
- for (let i = 0; i < detailele.length; i++) {
13591
- const elements = detailele[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
13592
- const detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
13640
+ for (let i = 0; i < detailRows.length; i++) {
13641
+ const elements = detailRows[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');
13642
+ const detailData = this.parent.grid.getRowObjectFromUID(detailRows[parseInt(i.toString(), 10)].getAttribute('data-Uid'));
13593
13643
  const parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);
13594
13644
  if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&
13595
13645
  getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {
@@ -13625,10 +13675,9 @@ class DetailRow {
13625
13675
  }
13626
13676
  actioncomplete(args) {
13627
13677
  if (args.requestType === 'beginEdit' || args.requestType === 'add') {
13628
- const spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
13629
- const colum = parseInt(spann, 10) - 1;
13630
- const updtdcolum = colum.toString();
13631
- args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);
13678
+ const colSpan = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));
13679
+ const colum = parseInt(colSpan, 10) - 1;
13680
+ args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', colum.toString());
13632
13681
  }
13633
13682
  const focusElement = this.parent.grid.contentModule.getRows();
13634
13683
  for (let i = 0; i < focusElement.length; i++) {
@@ -13845,6 +13894,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13845
13894
  this.parent[`${action}`]('refresh-virtual-editform-cells', this.refreshCell, this);
13846
13895
  this.parent[`${action}`]('virtaul-cell-focus', this.cellFocus, this);
13847
13896
  this.parent[`${action}`]('virtual-scroll-edit', this.restoreEditState, this);
13897
+ this.parent[`${action}`]('set-virtual-page-query', this.SetVirtualPageQury, this);
13848
13898
  }
13849
13899
  else {
13850
13900
  super.eventListener('on');
@@ -14097,6 +14147,18 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14097
14147
  const restoreEdit = 'restoreEdit';
14098
14148
  super[`${restoreEdit}`]();
14099
14149
  }
14150
+ SetVirtualPageQury(args) {
14151
+ let visiblePage = [];
14152
+ if (this.prevInfo && this.prevInfo.blockIndexes) {
14153
+ visiblePage = getVisiblePage(this.prevInfo.blockIndexes);
14154
+ }
14155
+ if ((this.requestType === 'refresh') && visiblePage.length) {
14156
+ args.query.skip(this.parent.pageSettings.pageSize * (visiblePage[0] - 1));
14157
+ args.query.take(this.parent.pageSettings.pageSize * visiblePage.length);
14158
+ args.skipPage = true;
14159
+ return;
14160
+ }
14161
+ }
14100
14162
  /**
14101
14163
  * Resets the edit state if certain conditions are met.
14102
14164
  *
@@ -14236,6 +14298,19 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14236
14298
  const xAxis = current.axis === 'X';
14237
14299
  let x = this.getColumnOffset(xAxis ? this.vgenerator.getColumnIndexes()[0] - 1 : this.prevInfo.columnIndexes[0]
14238
14300
  - 1);
14301
+ if (this.parent.isFrozenGrid() && this.parent.enableColumnVirtualization && this.currentInfo &&
14302
+ this.currentInfo.columnIndexes) {
14303
+ const cBlock = this.currentInfo.columnIndexes[0] - 1;
14304
+ let frzLeftWidth = 0;
14305
+ this.parent.getColumns().filter((col) => {
14306
+ if (col.visible && col.freeze === 'Left') {
14307
+ frzLeftWidth += parseInt(col.width.toString(), 10);
14308
+ }
14309
+ });
14310
+ if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
14311
+ x = x - frzLeftWidth;
14312
+ }
14313
+ }
14239
14314
  if (xAxis) {
14240
14315
  const idx = Object.keys(this.vgenerator.cOffsets).length - this.prevInfo.columnIndexes.length;
14241
14316
  const maxLeft = this.vgenerator.cOffsets[idx - 1];
@@ -14253,6 +14328,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14253
14328
  }
14254
14329
  if (this.parent.enableColumnVirtualization) {
14255
14330
  this.header.virtualEle.adjustTable(x, 0);
14331
+ if (this.parent.isFrozenGrid()) {
14332
+ this.parent.contentModule['resetStickyLeftPos'](x);
14333
+ }
14256
14334
  }
14257
14335
  }
14258
14336
  }
@@ -14397,10 +14475,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14397
14475
  if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14398
14476
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
14399
14477
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
14400
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
14478
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
14401
14479
  const viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
14402
14480
  this.previousInfo = viewInfo;
14403
- if (this.prevInfo && viewInfo.event !== 'refresh-virtual-block' && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14481
+ if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14404
14482
  || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
14405
14483
  || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
14406
14484
  && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
@@ -14422,7 +14500,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14422
14500
  viewInfo.loadNext = false;
14423
14501
  }
14424
14502
  this.requestType = 'virtualscroll';
14425
- if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
14503
+ if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left' && !isRemoteData(this.parent.root)) {
14426
14504
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
14427
14505
  }
14428
14506
  if (this.parent.enableVirtualMaskRow) {
@@ -14479,7 +14557,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14479
14557
  getValue('currentInfo', this).page && getValue('currentInfo', this).page !== e.virtualInfo.page ?
14480
14558
  getValue('currentInfo', this) : e.virtualInfo;
14481
14559
  const cBlock = (info.columnIndexes[0]) - 1;
14482
- const cOffset = this.getColumnOffset(cBlock);
14560
+ let cOffset = this.getColumnOffset(cBlock);
14483
14561
  let width;
14484
14562
  if (this.parent.enableColumnVirtualization) {
14485
14563
  this.header.virtualEle.adjustTable(cOffset, 0);
@@ -14495,9 +14573,33 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14495
14573
  if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
14496
14574
  this.isExpandCollapse = false;
14497
14575
  }
14576
+ let reduceWidth = 0;
14577
+ if (this.parent.enableColumnVirtualization && this.parent.isFrozenGrid()) {
14578
+ let frzLeftWidth = 0;
14579
+ this.parent.getColumns().filter((col) => {
14580
+ if (col.visible) {
14581
+ reduceWidth += parseInt(col.width.toString(), 10);
14582
+ if (col.freeze === 'Left') {
14583
+ frzLeftWidth += parseInt(col.width.toString(), 10);
14584
+ }
14585
+ }
14586
+ });
14587
+ const cIndex = info.columnIndexes;
14588
+ width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';
14589
+ if (cBlock > this.parent.getVisibleFrozenLeftCount()) {
14590
+ cOffset = cOffset - frzLeftWidth;
14591
+ }
14592
+ this.resetStickyLeftPos(cOffset, newChild);
14593
+ }
14498
14594
  if (!this.isExpandCollapse || this.translateY === 0) {
14499
14595
  this.translateY = this.translateY < 0 ? 0 : this.translateY;
14500
14596
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
14597
+ if (this.parent.enableColumnVirtualization) {
14598
+ this.header.virtualEle.adjustTable(cOffset, 0);
14599
+ if (this.parent.isFrozenGrid()) {
14600
+ this.resetStickyLeftPos(cOffset);
14601
+ }
14602
+ }
14501
14603
  }
14502
14604
  else {
14503
14605
  this.isExpandCollapse = false;
@@ -14611,7 +14713,12 @@ class TreeInterSectionObserver extends InterSectionObserver {
14611
14713
  this[`${options}`].prevTop = this[`${options}`].prevLeft = 0;
14612
14714
  const isScrollByFocus = 'isScrollByFocus';
14613
14715
  return (e) => {
14614
- if (instance.isEdit && instance.root.editModule[`${isScrollByFocus}`]) {
14716
+ const keyPress = 'keyPress';
14717
+ let keyaction;
14718
+ if (instance && instance.root && instance.root.editModule && instance.root.editModule[`${keyPress}`]) {
14719
+ keyaction = instance.root.editModule[`${keyPress}`];
14720
+ }
14721
+ if ((instance.isEdit && instance.root.editModule[`${isScrollByFocus}`]) || (instance.isEdit && (keyaction === 'tab' || keyaction === 'shiftTab'))) {
14615
14722
  instance.root.editModule[`${isScrollByFocus}`] = false;
14616
14723
  return;
14617
14724
  }