@syncfusion/ej2-treegrid 20.2.49 → 20.3.47

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 (88) hide show
  1. package/CHANGELOG.md +1 -54
  2. package/dist/ej2-treegrid.min.js +10 -0
  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 +366 -56
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +395 -61
  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 +10 -10
  13. package/src/treegrid/actions/clipboard.d.ts +3 -2
  14. package/src/treegrid/actions/clipboard.js +3 -2
  15. package/src/treegrid/actions/context-menu.js +1 -1
  16. package/src/treegrid/actions/crud-actions.js +4 -0
  17. package/src/treegrid/actions/edit.js +23 -5
  18. package/src/treegrid/actions/freeze-column.d.ts +1 -0
  19. package/src/treegrid/actions/freeze-column.js +39 -3
  20. package/src/treegrid/actions/rowdragdrop.js +8 -5
  21. package/src/treegrid/actions/selection.js +2 -2
  22. package/src/treegrid/actions/virtual-scroll.js +7 -4
  23. package/src/treegrid/base/constant.d.ts +28 -0
  24. package/src/treegrid/base/constant.js +28 -0
  25. package/src/treegrid/base/data.d.ts +1 -0
  26. package/src/treegrid/base/data.js +3 -2
  27. package/src/treegrid/base/treegrid-model.d.ts +1 -1
  28. package/src/treegrid/base/treegrid.d.ts +2 -0
  29. package/src/treegrid/base/treegrid.js +33 -9
  30. package/src/treegrid/renderer/virtual-row-model-generator.js +4 -0
  31. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +3 -0
  32. package/src/treegrid/renderer/virtual-tree-content-render.js +68 -9
  33. package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
  34. package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
  35. package/styles/bootstrap-dark.css +5 -1
  36. package/styles/bootstrap.css +5 -1
  37. package/styles/bootstrap4.css +5 -1
  38. package/styles/bootstrap5-dark.css +6 -1
  39. package/styles/bootstrap5.css +6 -1
  40. package/styles/fabric-dark.css +5 -1
  41. package/styles/fabric.css +5 -1
  42. package/styles/fluent-dark.css +5 -1
  43. package/styles/fluent.css +5 -1
  44. package/styles/highcontrast-light.css +5 -1
  45. package/styles/highcontrast.css +5 -1
  46. package/styles/material-dark.css +5 -1
  47. package/styles/material.css +5 -1
  48. package/styles/tailwind-dark.css +5 -1
  49. package/styles/tailwind.css +5 -1
  50. package/styles/treegrid/_all.scss +1 -1
  51. package/styles/treegrid/_bootstrap-dark-definition.scss +1 -1
  52. package/styles/treegrid/_bootstrap-definition.scss +1 -2
  53. package/styles/treegrid/_bootstrap4-definition.scss +0 -1
  54. package/styles/treegrid/_bootstrap5-definition.scss +0 -1
  55. package/styles/treegrid/_fabric-dark-definition.scss +1 -2
  56. package/styles/treegrid/_fabric-definition.scss +1 -2
  57. package/styles/treegrid/_fluent-definition.scss +0 -1
  58. package/styles/treegrid/_fusionnew-definition.scss +0 -1
  59. package/styles/treegrid/_highcontrast-definition.scss +0 -1
  60. package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
  61. package/styles/treegrid/_icons.scss +1 -1
  62. package/styles/treegrid/_layout.scss +3 -3
  63. package/styles/treegrid/_material-definition.scss +0 -1
  64. package/styles/treegrid/_material3-definition.scss +0 -1
  65. package/styles/treegrid/_tailwind-definition.scss +0 -1
  66. package/styles/treegrid/_theme.scss +1 -0
  67. package/styles/treegrid/bootstrap-dark.css +5 -1
  68. package/styles/treegrid/bootstrap.css +5 -1
  69. package/styles/treegrid/bootstrap4.css +5 -1
  70. package/styles/treegrid/bootstrap5-dark.css +6 -1
  71. package/styles/treegrid/bootstrap5.css +6 -1
  72. package/styles/treegrid/fabric-dark.css +5 -1
  73. package/styles/treegrid/fabric.css +5 -1
  74. package/styles/treegrid/fluent-dark.css +5 -1
  75. package/styles/treegrid/fluent.css +5 -1
  76. package/styles/treegrid/highcontrast-light.css +5 -1
  77. package/styles/treegrid/highcontrast.css +5 -1
  78. package/styles/treegrid/icons/_bootstrap-dark.scss +1 -1
  79. package/styles/treegrid/icons/_bootstrap.scss +1 -1
  80. package/styles/treegrid/icons/_bootstrap4.scss +1 -1
  81. package/styles/treegrid/icons/_fabric-dark.scss +1 -1
  82. package/styles/treegrid/icons/_fabric.scss +1 -1
  83. package/styles/treegrid/icons/_highcontrast-light.scss +1 -1
  84. package/styles/treegrid/icons/_material-dark.scss +1 -1
  85. package/styles/treegrid/material-dark.css +5 -1
  86. package/styles/treegrid/material.css +5 -1
  87. package/styles/treegrid/tailwind-dark.css +5 -1
  88. package/styles/treegrid/tailwind.css +5 -1
@@ -1,5 +1,5 @@
1
1
  import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
- import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
2
+ import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnFreezeContentRenderer, ColumnFreezeHeaderRenderer, ColumnMenu, ColumnVirtualFreezeRenderer, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, FreezeContentRender, FreezeRender, FreezeRowModelGenerator, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualFreezeHdrRenderer, VirtualFreezeRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, setDebounce, templateCompiler } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
@@ -499,6 +499,34 @@ var rowDropped = 'row-dropped';
499
499
  var autoCol = 'auto-col';
500
500
  /** @hidden */
501
501
  var rowDeselecting = 'rowDeselecting';
502
+ /** @hidden */
503
+ var headerContent = 'e-headercontent';
504
+ /** @hidden */
505
+ var movableContent = 'e-movablecontent';
506
+ /** @hidden */
507
+ var movableHeader = 'e-movableheader';
508
+ /** @hidden */
509
+ var frozenContent = 'e-frozencontent';
510
+ /** @hidden */
511
+ var frozenHeader = 'e-frozenheader';
512
+ /** @hidden */
513
+ var content = 'e-content';
514
+ /** @hidden */
515
+ var table = 'e-table';
516
+ /** @hidden */
517
+ var leftRight = 'Left-Right';
518
+ /** @hidden */
519
+ var frozenRight = 'frozen-right';
520
+ /** @hidden */
521
+ var frozenLeft = 'frozen-left';
522
+ /** @hidden */
523
+ var dataColIndex = 'data-colindex';
524
+ /** @hidden */
525
+ var ariaColIndex = 'aria-colindex';
526
+ /** @hidden */
527
+ var dataRowIndex = 'data-rowindex';
528
+ /** @hidden */
529
+ var ariaRowIndex = 'aria-rowindex';
502
530
 
503
531
  var __extends$4 = (undefined && undefined.__extends) || (function () {
504
532
  var extendStatics = function (d, b) {
@@ -520,11 +548,12 @@ var __extends$4 = (undefined && undefined.__extends) || (function () {
520
548
  */
521
549
  var TreeClipboard = /** @__PURE__ @class */ (function (_super) {
522
550
  __extends$4(TreeClipboard, _super);
523
- function TreeClipboard(parent) {
524
- var _this = _super.call(this, parent.grid) || this;
551
+ function TreeClipboard(parent, serviceLocator) {
552
+ var _this = _super.call(this, parent.grid, serviceLocator) || this;
525
553
  _this.treeCopyContent = '';
526
554
  _this.copiedUniqueIdCollection = [];
527
555
  _this.treeGridParent = parent;
556
+ _this.serviceLocator = serviceLocator;
528
557
  return _this;
529
558
  }
530
559
  TreeClipboard.prototype.setCopyData = function (withHeader) {
@@ -1325,8 +1354,8 @@ var Selection = /** @__PURE__ @class */ (function () {
1325
1354
  childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?
1326
1355
  this.parent.getCurrentViewRecords() : this.parent.flatData;
1327
1356
  childData.forEach(function (record) {
1328
- if (_this.parent.enableVirtualization && record.childRecords.length > 0) {
1329
- if (record.hasChildRecords) {
1357
+ if (_this.parent.enableVirtualization) {
1358
+ if (record.hasChildRecords && record.childRecords.length > 0) {
1330
1359
  _this.updateParentSelection(record);
1331
1360
  }
1332
1361
  else {
@@ -2210,8 +2239,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2210
2239
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
2211
2240
  currentData.index = this.storedIndex;
2212
2241
  }
2213
- if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
2214
- ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result)))) {
2242
+ if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) || ((currentData[this.parent.hasChildMapping]) &&
2243
+ isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result) || this.parent.enableInfiniteScrolling))) {
2215
2244
  currentData.hasChildRecords = true;
2216
2245
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
2217
2246
  && isNullOrUndefined(currentData[this.parent.childMapping])) {
@@ -2247,6 +2276,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2247
2276
  currentData.checkboxState = 'uncheck';
2248
2277
  if (isNullOrUndefined(currentData[this.parent.parentIdMapping]) || currentData.parentItem) {
2249
2278
  this.parent.flatData.push(currentData);
2279
+ this.parent['infiniteScrollData'].push(currentData);
2250
2280
  }
2251
2281
  if (!this.isSelfReference && currentData.level === 0) {
2252
2282
  this.parent.parentData.push(currentData);
@@ -3091,6 +3121,10 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3091
3121
  index_1 = i;
3092
3122
  return;
3093
3123
  } });
3124
+ if (control.enableVirtualization && isNullOrUndefined(index_1)) {
3125
+ var updatedParent = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
3126
+ record = updatedParent;
3127
+ }
3094
3128
  if (!isNullOrUndefined(index_1)) {
3095
3129
  record = currentRecords[index_1];
3096
3130
  }
@@ -3548,6 +3582,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3548
3582
  TreeGrid.prototype.initProperties = function () {
3549
3583
  this.defaultLocale = {};
3550
3584
  this.flatData = [];
3585
+ this.infiniteScrollData = [];
3551
3586
  this.parentData = [];
3552
3587
  this.columnModel = [];
3553
3588
  this.isExpandAll = false;
@@ -3839,7 +3874,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3839
3874
  if (!isNullOrUndefined(this.grid.clipboardModule)) {
3840
3875
  this.grid.clipboardModule.destroy();
3841
3876
  }
3842
- this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);
3877
+ this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
3843
3878
  };
3844
3879
  TreeGrid.prototype.convertTreeData = function (data) {
3845
3880
  var _this = this;
@@ -3932,13 +3967,19 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3932
3967
  this.grid[templateInstance] = this[templateInstance];
3933
3968
  var isJsComponent = 'isJsComponent';
3934
3969
  this.grid[isJsComponent] = true;
3970
+ this.grid.enableVirtualMaskRow = false; // Need to update in virtual mask row feature implementation.
3935
3971
  };
3936
3972
  TreeGrid.prototype.triggerEvents = function (args) {
3937
3973
  this.trigger(getObject('name', args), args);
3938
3974
  };
3939
3975
  TreeGrid.prototype.IsExpandCollapseClicked = function (args) {
3940
- if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3941
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3976
+ if (args['name'] === "rowSelecting" && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3977
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')) && (isNullOrUndefined(args['previousRowIndex']))) {
3978
+ args.cancel = true;
3979
+ return;
3980
+ }
3981
+ else if (args['name'] === "rowDeselecting" && !isNullOrUndefined(args.target) && ((!isNullOrUndefined(args.row) && (!args.row.length)) && (args.target.classList.contains('e-treegridexpand')
3982
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')))) {
3942
3983
  args.cancel = true;
3943
3984
  return;
3944
3985
  }
@@ -3995,7 +4036,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3995
4036
  this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);
3996
4037
  this.grid.dataSourceChanged = this.triggerEvents.bind(this);
3997
4038
  this.grid.recordDoubleClick = this.triggerEvents.bind(this);
3998
- this.grid.rowDeselecting = this.triggerEvents.bind(this);
3999
4039
  this.grid.cellDeselected = this.triggerEvents.bind(this);
4000
4040
  this.grid.cellDeselecting = this.triggerEvents.bind(this);
4001
4041
  this.grid.columnMenuOpen = this.triggerEvents.bind(this);
@@ -4176,6 +4216,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4176
4216
  _this.grid.dataSource = { result: _this.flatData, count: getValue('count', _this.grid.dataSource) };
4177
4217
  }
4178
4218
  else {
4219
+ if (args.action.requestType !== 'infiniteScroll') {
4220
+ _this.infiniteScrollData = [];
4221
+ }
4179
4222
  _this.trigger(dataStateChange, args);
4180
4223
  }
4181
4224
  };
@@ -4354,6 +4397,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4354
4397
  _this.selectedRecords = _this.selectedRows = _this.modifiedRecords = [];
4355
4398
  }
4356
4399
  else {
4400
+ if (_this.grid.isFrozenGrid() && _this.enableVirtualization && args['tableName'] === 'movable') {
4401
+ var movableContent$$1 = _this.grid.element.querySelector('.' + movableContent);
4402
+ var frozenContent$$1 = _this.grid.element.querySelector('.' + frozenContent);
4403
+ movableContent$$1.style.height = frozenContent$$1.style.height = 'auto';
4404
+ }
4357
4405
  _this.trigger(actionComplete, args);
4358
4406
  }
4359
4407
  };
@@ -5201,8 +5249,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5201
5249
  this.grid.setRowData(key, rowData);
5202
5250
  var visibleRecords = this.getVisibleRecords();
5203
5251
  if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
5204
- var table = this.getContentTable();
5205
- var sHeight = table.scrollHeight;
5252
+ var table$$1 = this.getContentTable();
5253
+ var sHeight = table$$1.scrollHeight;
5206
5254
  var clientHeight = this.getContent().clientHeight;
5207
5255
  this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);
5208
5256
  }
@@ -5675,16 +5723,20 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5675
5723
  }
5676
5724
  }
5677
5725
  else {
5678
- var rowInfo = this.grid.getRowInfo(target);
5679
- var record = rowInfo.rowData;
5726
+ var rowInfo_1 = this.grid.getRowInfo(target);
5727
+ var record = rowInfo_1.rowData;
5728
+ if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {
5729
+ var freezeRows = 'freezeRows';
5730
+ record = this.grid.contentModule[freezeRows].filter(function (e) { return e.uid === rowInfo_1.row.getAttribute('data-uid'); })[0].data;
5731
+ }
5680
5732
  if (this.enableImmutableMode) {
5681
- record = this.getCurrentViewRecords()[rowInfo.rowIndex];
5733
+ record = this.getCurrentViewRecords()[rowInfo_1.rowIndex];
5682
5734
  }
5683
5735
  if (target.classList.contains('e-treegridexpand')) {
5684
- this.collapseRow(rowInfo.row, record);
5736
+ this.collapseRow(rowInfo_1.row, record);
5685
5737
  }
5686
5738
  else {
5687
- this.expandRow(rowInfo.row, record);
5739
+ this.expandRow(rowInfo_1.row, record);
5688
5740
  }
5689
5741
  }
5690
5742
  };
@@ -6098,8 +6150,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6098
6150
  totalRows = [].slice.call(rows);
6099
6151
  for (var i = totalRows.length - 1; i >= 0; i--) {
6100
6152
  if (!isHidden(totalRows[i])) {
6101
- var table = this.getContentTable();
6102
- var sHeight = table.scrollHeight;
6153
+ var table$$1 = this.getContentTable();
6154
+ var sHeight = table$$1.scrollHeight;
6103
6155
  var clientHeight = this.getContent().clientHeight;
6104
6156
  this.lastRowBorder(totalRows[i], sHeight <= clientHeight);
6105
6157
  break;
@@ -6119,6 +6171,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6119
6171
  this.trigger(dataStateChange, expandingArgs);
6120
6172
  deff.promise.then(function () {
6121
6173
  if (expandingArgs.childData.length) {
6174
+ _this.flatData = _this.infiniteScrollData;
6122
6175
  var currentData = (_this.flatData);
6123
6176
  var index = 0;
6124
6177
  for (var i = 0; i < currentData.length; i++) {
@@ -6168,8 +6221,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6168
6221
  }
6169
6222
  }
6170
6223
  _this.isExpandRefresh = true;
6224
+ var scrollHeightBeforeRefresh = _this.getContentTable().parentElement.scrollTop;
6171
6225
  _this.grid.refresh();
6172
6226
  _this.setHeightForFrozenContent();
6227
+ if (_this.enableInfiniteScrolling) {
6228
+ _this.getContentTable().parentElement.scrollTop = scrollHeightBeforeRefresh;
6229
+ }
6173
6230
  _this.trigger(expanded, expandingArgs);
6174
6231
  });
6175
6232
  };
@@ -7426,13 +7483,16 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7426
7483
  for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
7427
7484
  if (tObj.getCurrentViewRecords()[i].taskData === record_1.parentItem.taskData) {
7428
7485
  dropIndex = i;
7486
+ if (tObj.enableVirtualization) {
7487
+ dropIndex = parseInt(tObj.getRows()[i].getAttribute('data-rowindex'), 10);
7488
+ }
7429
7489
  }
7430
7490
  }
7431
7491
  }
7432
7492
  else {
7433
7493
  dropIndex = this.selectedRow.rowIndex - 1;
7434
7494
  }
7435
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7495
+ if (this.parent.enableVirtualization && this.selectedRecord && !(record_1.level > this.selectedRecord.level)) {
7436
7496
  dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
7437
7497
  }
7438
7498
  tObj[action] = 'indenting';
@@ -7447,11 +7507,11 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7447
7507
  var dropIndex = void 0;
7448
7508
  var parentItem = this.selectedRecord.parentItem;
7449
7509
  for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
7450
- if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
7510
+ if (tObj.getCurrentViewRecords()[i].uniqueID === parentItem.uniqueID) {
7451
7511
  dropIndex = i;
7452
7512
  }
7453
7513
  }
7454
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7514
+ if (this.parent.enableVirtualization && this.selectedRecord) {
7455
7515
  dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('data-rowindex'), 10);
7456
7516
  }
7457
7517
  tObj[action] = 'outdenting';
@@ -7471,7 +7531,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7471
7531
  this.parent.trigger(actionBegin, actionArgs, function (actionArgs) {
7472
7532
  if (!actionArgs.cancel) {
7473
7533
  if (actionArgs.action === 'indenting') {
7474
- if (_this.parent.enableVirtualization && _this.parent.allowRowDragAndDrop) {
7534
+ if (_this.parent.enableVirtualization) {
7475
7535
  _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
7476
7536
  }
7477
7537
  else {
@@ -7479,7 +7539,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7479
7539
  }
7480
7540
  }
7481
7541
  else if (actionArgs.action === 'outdenting') {
7482
- if (_this.parent.enableVirtualization && _this.parent.allowRowDragAndDrop) {
7542
+ if (_this.parent.enableVirtualization) {
7483
7543
  _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
7484
7544
  }
7485
7545
  else {
@@ -7832,16 +7892,16 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7832
7892
  classList(ele, ['e-errorcontainer'], []);
7833
7893
  classList(ele, ['e-icons', 'e-errorelem'], []);
7834
7894
  var errorVal = dragelem.querySelector('.errorValue');
7835
- var content = dragelem.querySelector('.e-rowcell').innerHTML;
7895
+ var content$$1 = dragelem.querySelector('.e-rowcell').innerHTML;
7836
7896
  if (errorVal) {
7837
- content = errorVal.innerHTML;
7897
+ content$$1 = errorVal.innerHTML;
7838
7898
  errorVal.parentNode.removeChild(errorVal);
7839
7899
  }
7840
7900
  dragelem.querySelector('.e-rowcell').innerHTML = '';
7841
7901
  var spanContent = document.createElement('span');
7842
7902
  spanContent.className = 'errorValue';
7843
7903
  spanContent.style.paddingLeft = '16px';
7844
- spanContent.innerHTML = content;
7904
+ spanContent.innerHTML = content$$1;
7845
7905
  dragelem.querySelector('.e-rowcell').appendChild(ele);
7846
7906
  dragelem.querySelector('.e-rowcell').appendChild(spanContent);
7847
7907
  var dropItemSpan = document.querySelector('.e-dropitemscount');
@@ -8729,6 +8789,8 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8729
8789
  var currentPage = this[model].currentPage;
8730
8790
  if (clear) {
8731
8791
  this.cache = {};
8792
+ this.movableCache = {};
8793
+ this.frozenRightCache = {};
8732
8794
  this.data = {};
8733
8795
  this.groups = {};
8734
8796
  }
@@ -8742,6 +8804,8 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8742
8804
  this.cache = {};
8743
8805
  this.data = {};
8744
8806
  this.groups = {};
8807
+ this.movableCache = {};
8808
+ this.frozenRightCache = {};
8745
8809
  }
8746
8810
  }
8747
8811
  return clear;
@@ -10134,7 +10198,7 @@ var ContextMenu$1 = /** @__PURE__ @class */ (function () {
10134
10198
  var indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
10135
10199
  var outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
10136
10200
  if (addRow) {
10137
- if (this.parent.grid.editSettings.allowAdding === false) {
10201
+ if (this.parent.grid.editSettings.allowAdding === false || this.parent.grid.isEdit) {
10138
10202
  addRow.style.display = 'none';
10139
10203
  }
10140
10204
  else {
@@ -10504,13 +10568,13 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
10504
10568
  this.updateRowIndex();
10505
10569
  // update focus module, need to refix this once grid source modified.
10506
10570
  var focusModule = getValue('focusModule', this.parent.grid);
10507
- var table = this.parent.getContentTable();
10571
+ var table$$1 = this.parent.getContentTable();
10508
10572
  if (this.parent.getBatchChanges()[this.deletedRecords].length && this.parent.editSettings.newRowPosition === 'Above') {
10509
10573
  actualIndex = e.row.rowIndex;
10510
10574
  focusModule.getContent().matrix.matrix = this.matrix;
10511
10575
  }
10512
10576
  else {
10513
- actualIndex = table.getElementsByClassName('e-batchrow')[0].rowIndex;
10577
+ actualIndex = table$$1.getElementsByClassName('e-batchrow')[0].rowIndex;
10514
10578
  // if (this.parent.frozenRows || this.parent.frozenColumns) {
10515
10579
  // actualIndex = this.batchIndex;
10516
10580
  // }
@@ -11178,6 +11242,9 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11178
11242
  args.cancel = true;
11179
11243
  }
11180
11244
  }
11245
+ if (this.parent.enableVirtualization) {
11246
+ this.parent.grid.contentModule['editedRowIndex'] = this.parent.grid.editModule.editModule['index'];
11247
+ }
11181
11248
  // if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {
11182
11249
  // this.isAdd = false;
11183
11250
  // }
@@ -11297,6 +11364,9 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11297
11364
  this.parent.grid.isEdit = true;
11298
11365
  }
11299
11366
  }
11367
+ if (this.parent.enableVirtualization) {
11368
+ this.parent.grid.contentModule['virtualData'] = {};
11369
+ }
11300
11370
  };
11301
11371
  Edit$$1.prototype.afterCellSave = function (args, row, rowIndex) {
11302
11372
  var mRow;
@@ -11546,7 +11616,12 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11546
11616
  if (isVirtualization) {
11547
11617
  this.prevAriaRowIndex = '-1';
11548
11618
  }
11549
- focussedElement.focus();
11619
+ if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11620
+ focussedElement.focus();
11621
+ }
11622
+ if (this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11623
+ this.parent.grid.contentModule['createEmptyRowdata']();
11624
+ }
11550
11625
  }
11551
11626
  }
11552
11627
  if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
@@ -11670,6 +11745,9 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11670
11745
  }
11671
11746
  if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
11672
11747
  this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
11748
+ if (this.parent.enableVirtualization && this.isAddedRowByContextMenu) {
11749
+ this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
11750
+ }
11673
11751
  }
11674
11752
  else {
11675
11753
  this.addRowRecord = this.parent.getSelectedRecords()[0];
@@ -11706,15 +11784,18 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11706
11784
  var position = null;
11707
11785
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
11708
11786
  var currentData = void 0;
11709
- if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11787
+ if (this.parent.enableVirtualization && args.index !== 0) {
11788
+ currentData = this.parent.flatData;
11789
+ }
11790
+ else if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11710
11791
  currentData = this.batchEditModule['batchRecords'];
11711
11792
  }
11712
11793
  else {
11713
11794
  currentData = this.parent.grid.getCurrentViewRecords();
11714
11795
  }
11715
11796
  if (this.parent.enableVirtualization && args.index !== 0) {
11716
- this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
11717
- this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('data-rowindex'), 10);
11797
+ this.addRowIndex = this.parent.flatData.indexOf(this.addRowRecord);
11798
+ this.selectedIndex = this.addRowIndex;
11718
11799
  }
11719
11800
  var index = this.addRowIndex;
11720
11801
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11728,7 +11809,8 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11728
11809
  var rows = this.parent.getRows();
11729
11810
  var firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
11730
11811
  var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11731
- var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11812
+ var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
11813
+ this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11732
11814
  if (currentData.length) {
11733
11815
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
11734
11816
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
@@ -12094,6 +12176,29 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12094
12176
  VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {
12095
12177
  return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('data-rowindex'), 10) === index; })[0];
12096
12178
  };
12179
+ VirtualTreeContentRenderer.prototype.getMovableVirtualRowByIndex = function (index) {
12180
+ return this.getRowCollection(index, true);
12181
+ };
12182
+ VirtualTreeContentRenderer.prototype.getFrozenRightVirtualRowByIndex = function (index) {
12183
+ return this.getRowCollection(index, false, false, true);
12184
+ };
12185
+ VirtualTreeContentRenderer.prototype.getRowCollection = function (index, isMovable, isRowObject, isFrozenRight) {
12186
+ var startIdx = parseInt(this.parent.getRows()[0].getAttribute(dataRowIndex), 10);
12187
+ var rowCollection = isMovable ? this.parent.getMovableDataRows() : this.parent.getDataRows();
12188
+ rowCollection = isFrozenRight ? this.parent.getFrozenRightDataRows() : rowCollection;
12189
+ var collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
12190
+ var selectedRow = collection[index - startIdx];
12191
+ if (this.parent.frozenRows && this.parent.pageSettings.currentPage > 1) {
12192
+ if (!isRowObject) {
12193
+ selectedRow = index <= this.parent.frozenRows ? rowCollection[index]
12194
+ : rowCollection[(index - startIdx) + this.parent.frozenRows];
12195
+ }
12196
+ else {
12197
+ selectedRow = index <= this.parent.frozenRows ? this.parent.getRowsObject()[index].data : selectedRow;
12198
+ }
12199
+ }
12200
+ return selectedRow;
12201
+ };
12097
12202
  VirtualTreeContentRenderer.prototype.addEventListener = function () {
12098
12203
  this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
12099
12204
  this.parent.on(indexModifier, this.indexModifier, this);
@@ -12109,10 +12214,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12109
12214
  }
12110
12215
  };
12111
12216
  VirtualTreeContentRenderer.prototype.indexModifier = function (args) {
12112
- var content = this.parent.getContent().querySelector('.e-content');
12217
+ var content$$1 = this.parent.getContent().querySelector('.e-content');
12113
12218
  if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {
12114
12219
  if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {
12115
- var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
12220
+ var nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
12116
12221
  var lastIndex = nextSetResIndex + this.parent.getRows().length;
12117
12222
  if (lastIndex > args.count) {
12118
12223
  lastIndex = nextSetResIndex +
@@ -12121,7 +12226,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12121
12226
  this.startIndex = lastIndex - this.parent.getRows().length;
12122
12227
  this.endIndex = lastIndex;
12123
12228
  }
12124
- else {
12229
+ else if (this.parent.root.editSettings.newRowPosition !== 'Top' && this.parent.root.editModule.selectedIndex !== -1 || this.parent.root.editModule.selectedIndex !== -1) {
12125
12230
  this.startIndex += 1;
12126
12231
  this.endIndex += 1;
12127
12232
  }
@@ -12173,7 +12278,15 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12173
12278
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
12174
12279
  if (!isNullOrUndefined(e.count)) {
12175
12280
  this.totalRecords = e.count;
12176
- if (!this.parent.enableColumnVirtualization) {
12281
+ // To overcome the white space issue in last page when records collapsed
12282
+ if (this.parent.isFrozenGrid() && e.count < Object.keys(this.parent.dataSource).length) {
12283
+ var width = this.parent.enableColumnVirtualization ?
12284
+ this.getColumnOffset(this.parent.columns.length - 1) + 'px' : '100%';
12285
+ var height = (this.parent.getRowHeight() * e.count) -
12286
+ (this.parent.getRowHeight() * this.parent.pageSettings.pageSize);
12287
+ getValue('virtualEle', this).setVirtualHeight(height, width);
12288
+ }
12289
+ if (!this.parent.enableColumnVirtualization && !this.parent.isFrozenGrid()) {
12177
12290
  getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
12178
12291
  }
12179
12292
  }
@@ -12271,6 +12384,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12271
12384
  return new Cell(opt);
12272
12385
  };
12273
12386
  VirtualTreeContentRenderer.prototype.beginEdit = function (e) {
12387
+ this['editedRowIndex'] = e.index;
12274
12388
  var selector = '.e-row[data-rowindex="' + e.index + '"]';
12275
12389
  var index = this.parent.getContent().querySelector(selector).rowIndex;
12276
12390
  var rowData = this.parent.getCurrentViewRecords()[index];
@@ -12310,8 +12424,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12310
12424
  };
12311
12425
  VirtualTreeContentRenderer.prototype.virtualEditSuccess = function () {
12312
12426
  var isAdd = 'isAdd';
12313
- var content = this.parent.getContent().querySelector('.e-content');
12314
- if (this[isAdd] && content.querySelector('.e-addedrow')) {
12427
+ var content$$1 = this.parent.getContent().querySelector('.e-content');
12428
+ if (this[isAdd] && content$$1.querySelector('.e-addedrow')) {
12315
12429
  this.recordAdded = true;
12316
12430
  }
12317
12431
  };
@@ -12325,10 +12439,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12325
12439
  };
12326
12440
  VirtualTreeContentRenderer.prototype.restoreNewRow = function () {
12327
12441
  var isAdd = 'isAdd';
12328
- var content = this.parent.getContent().querySelector('.e-content');
12329
- if (this[isAdd] && !content.querySelector('.e-addedrow')) {
12442
+ var content$$1 = this.parent.getContent().querySelector('.e-content');
12443
+ if (this[isAdd] && !content$$1.querySelector('.e-addedrow')) {
12330
12444
  this.parent.isEdit = false;
12331
- this.parent.addRecord();
12445
+ this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
12332
12446
  }
12333
12447
  };
12334
12448
  VirtualTreeContentRenderer.prototype.getData = function (data) {
@@ -12341,7 +12455,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12341
12455
  this.parent.notify('get-row-position', addArgs);
12342
12456
  this.rowPosition = addArgs.newRowPosition;
12343
12457
  this.addRowIndex = addArgs.addRowIndex;
12344
- this.dataRowIndex = addArgs.dataRowIndex;
12458
+ this.dataRowIndex = this.parent.root.editModule.selectedIndex;
12345
12459
  }
12346
12460
  var actionComplete$$1 = 'actionComplete';
12347
12461
  _super.prototype[actionComplete$$1].call(this, args);
@@ -12363,17 +12477,20 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12363
12477
  var maxLeft = _this.vgenerator.cOffsets[idx - 1];
12364
12478
  x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
12365
12479
  }
12366
- _this.virtualEle.adjustTable(x, _this.translateY);
12367
- if (_this.parent.enableColumnVirtualization) {
12368
- _this.header.virtualEle.adjustTable(x, 0);
12480
+ if (!_this.parent.isFrozenGrid()) {
12481
+ _this.virtualEle.adjustTable(x, _this.translateY);
12482
+ if (_this.parent.enableColumnVirtualization) {
12483
+ _this.header.virtualEle.adjustTable(x, 0);
12484
+ }
12369
12485
  }
12370
12486
  }
12371
12487
  };
12372
12488
  };
12373
12489
  VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {
12490
+ this['scrollAfterEdit']();
12374
12491
  var info = scrollArgs.sentinel;
12375
12492
  var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
12376
- var content = this.parent.getContent().querySelector('.e-content');
12493
+ var content$$1 = this.parent.getContent().querySelector('.e-content');
12377
12494
  var scrollHeight = outBuffer * this.parent.getRowHeight();
12378
12495
  var upScroll = (scrollArgs.offset.top - this.translateY) < 0;
12379
12496
  var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
@@ -12383,7 +12500,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12383
12500
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12384
12501
  var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
12385
12502
  this.parent.element.getBoundingClientRect().height);
12386
- var index = (~~(content.scrollTop / this.parent.getRowHeight())
12503
+ var index = (~~(content$$1.scrollTop / this.parent.getRowHeight())
12387
12504
  + Math.ceil(vHeight / this.parent.getRowHeight()))
12388
12505
  - this.parent.pageSettings.pageSize;
12389
12506
  index = (index > 0) ? index : 0;
@@ -12398,7 +12515,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12398
12515
  this.endIndex = lastInx;
12399
12516
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
12400
12517
  }
12401
- if (currentViewData.length && ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12518
+ if (currentViewData.length && (currentViewData[0][indexValue] >= this.parent.pageSettings.pageSize / 2) &&
12519
+ ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12402
12520
  this.startIndex = currentViewData[0][indexValue] - (this.parent.pageSettings.pageSize / 2);
12403
12521
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
12404
12522
  }
@@ -12427,7 +12545,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12427
12545
  }
12428
12546
  }
12429
12547
  else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12430
- var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
12548
+ var nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
12431
12549
  var isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
12432
12550
  if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
12433
12551
  nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {
@@ -12445,7 +12563,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12445
12563
  this.startIndex = currentViewData[0][indexValue] + (this.parent.pageSettings.pageSize / 2);
12446
12564
  }
12447
12565
  if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {
12448
- this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
12566
+ this.translateY = this.getTranslateY(scrollArgs.offset.top, content$$1.getBoundingClientRect().height);
12449
12567
  }
12450
12568
  else {
12451
12569
  if (this.parent.allowRowDragAndDrop) {
@@ -12463,6 +12581,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12463
12581
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
12464
12582
  var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
12465
12583
  this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
12584
+ this.requestType = 'virtualscroll';
12466
12585
  if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
12467
12586
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
12468
12587
  }
@@ -12470,12 +12589,28 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12470
12589
  }
12471
12590
  };
12472
12591
  VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {
12592
+ var isFrozen = this.parent.isFrozenGrid();
12473
12593
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
12474
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
12594
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || this.parent.isFrozenGrid()) {
12475
12595
  if (getValue('isExpandCollapse', e)) {
12476
12596
  this.isRemoteExpand = true;
12477
12597
  }
12598
+ if (isFrozen && isNullOrUndefined(this.requestType) && getValue('requestTypes', this).indexOf('isFrozen') === -1) {
12599
+ getValue('requestTypes', this).push('isFrozen');
12600
+ this.requestType = 'isFrozen';
12601
+ }
12478
12602
  _super.prototype.appendContent.call(this, target, newChild, e);
12603
+ if (getValue('requestTypes', this).indexOf('isFrozen') !== -1) {
12604
+ getValue('requestTypes', this).splice(getValue('requestTypes', this).indexOf('isFrozen'), 1);
12605
+ this.requestType = this.requestType === 'isFrozen' ? undefined : this.requestType;
12606
+ }
12607
+ if (isFrozen && (!this.isExpandCollapse || this.translateY === 0)) {
12608
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
12609
+ getValue('virtualEle', this).adjustTable(0, this.translateY);
12610
+ }
12611
+ else {
12612
+ this.isExpandCollapse = false;
12613
+ }
12479
12614
  }
12480
12615
  else {
12481
12616
  var info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&
@@ -12564,6 +12699,11 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
12564
12699
  var containerRect = 'containerRect';
12565
12700
  _super.prototype[containerRect] = getValue('options', this).container.getBoundingClientRect();
12566
12701
  EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12702
+ if (getValue('options', this).movableContainer) {
12703
+ var movableContainerRect = 'movableContainerRect';
12704
+ _super.prototype[movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
12705
+ EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12706
+ }
12567
12707
  };
12568
12708
  TreeInterSectionObserver.prototype.clear = function () {
12569
12709
  this.lastPos = null;
@@ -12781,6 +12921,7 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
12781
12921
  }
12782
12922
  }
12783
12923
  this.expandCollapseRec = null;
12924
+ startIndex = startIndex < 0 ? 0 : startIndex;
12784
12925
  pageingDetails.result = visualData.slice(startIndex, endIndex);
12785
12926
  this.prevstartIndex = startIndex;
12786
12927
  this.prevendIndex = endIndex;
@@ -12813,12 +12954,14 @@ var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
12813
12954
  var parentGrid = getValue('parent', this);
12814
12955
  getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
12815
12956
  var renderer = getValue('locator', this).getService('rendererFactory');
12816
- if (parentGrid.enableColumnVirtualization) {
12957
+ if (!parentGrid.isFrozenGrid()) {
12958
+ if (parentGrid.enableColumnVirtualization) {
12959
+ getValue('addRenderer', renderer)
12960
+ .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12961
+ }
12817
12962
  getValue('addRenderer', renderer)
12818
- .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12963
+ .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12819
12964
  }
12820
- getValue('addRenderer', renderer)
12821
- .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12822
12965
  //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
12823
12966
  this.ensurePageSize();
12824
12967
  };
@@ -12838,6 +12981,162 @@ var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
12838
12981
  return TreeVirtual;
12839
12982
  }(VirtualScroll));
12840
12983
 
12984
+ var __extends$16 = (undefined && undefined.__extends) || (function () {
12985
+ var extendStatics = function (d, b) {
12986
+ extendStatics = Object.setPrototypeOf ||
12987
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
12988
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
12989
+ return extendStatics(d, b);
12990
+ };
12991
+ return function (d, b) {
12992
+ extendStatics(d, b);
12993
+ function __() { this.constructor = d; }
12994
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12995
+ };
12996
+ })();
12997
+ /**
12998
+ * VirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
12999
+ *
13000
+ * @hidden
13001
+ */
13002
+ var VirtualTreeFreezeRenderer = /** @__PURE__ @class */ (function (_super) {
13003
+ __extends$16(VirtualTreeFreezeRenderer, _super);
13004
+ function VirtualTreeFreezeRenderer(parent, locator) {
13005
+ var _this = _super.call(this, parent, locator) || this;
13006
+ _this.addEventListener();
13007
+ return _this;
13008
+ }
13009
+ /**
13010
+ * @returns {void}
13011
+ * @hidden
13012
+ */
13013
+ VirtualTreeFreezeRenderer.prototype.renderTable = function () {
13014
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
13015
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
13016
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
13017
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
13018
+ FreezeContentRender.prototype.renderTable.call(this);
13019
+ this.virtualRenderer.setPanel(this.parent.getContent());
13020
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
13021
+ var movableCont = this.getMovableContent();
13022
+ var minHeight = this.parent.height;
13023
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
13024
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
13025
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
13026
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
13027
+ if (this.parent.enableColumnVirtualization) {
13028
+ this.virtualRenderer.virtualEle.movableContent = this.virtualRenderer.movableContent
13029
+ = this.getPanel().querySelector('.' + movableContent);
13030
+ this.virtualRenderer.virtualEle.renderMovableWrapper(minHeight);
13031
+ this.virtualRenderer.virtualEle.renderMovablePlaceHolder();
13032
+ var tbl = movableCont.querySelector('table');
13033
+ this.virtualRenderer.virtualEle.movableTable = tbl;
13034
+ this.virtualRenderer.virtualEle.movableWrapper.appendChild(tbl);
13035
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movableWrapper);
13036
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder);
13037
+ }
13038
+ this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent());
13039
+ this.virtualRenderer.virtualEle.wrapper.appendChild(movableCont);
13040
+ this.virtualRenderer.virtualEle.table = this.getTable();
13041
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
13042
+ };
13043
+ /**
13044
+ * @param {HTMLElement} target - specifies the target
13045
+ * @param {DocumentFragment} newChild - specifies the newChild
13046
+ * @param {NotifyArgs} e - specifies the notifyargs
13047
+ * @returns {void}
13048
+ * @hidden
13049
+ */
13050
+ VirtualTreeFreezeRenderer.prototype.appendContent = function (target, newChild, e) {
13051
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
13052
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
13053
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
13054
+ _super.prototype.appendContent.call(this, target, newChild, e);
13055
+ };
13056
+ /**
13057
+ * @param {Object[]} data - specifies the data
13058
+ * @param {NotifyArgs} e - specifies the notifyargs
13059
+ * @returns {Row<Column>[]} returns the row
13060
+ * @hidden
13061
+ */
13062
+ VirtualTreeFreezeRenderer.prototype.generateRows = function (data, e) {
13063
+ return _super.prototype.generateRows.call(this, data, e);
13064
+ };
13065
+ return VirtualTreeFreezeRenderer;
13066
+ }(VirtualFreezeRenderer));
13067
+ /**
13068
+ * ColumnVirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
13069
+ *
13070
+ * @hidden
13071
+ */
13072
+ var ColumnVirtualTreeFreezeRenderer = /** @__PURE__ @class */ (function (_super) {
13073
+ __extends$16(ColumnVirtualTreeFreezeRenderer, _super);
13074
+ function ColumnVirtualTreeFreezeRenderer(parent, locator) {
13075
+ var _this = _super.call(this, parent, locator) || this;
13076
+ _this.serviceLoc = locator;
13077
+ _this.eventListener('on');
13078
+ return _this;
13079
+ }
13080
+ /**
13081
+ * @returns {void}
13082
+ * @hidden
13083
+ */
13084
+ ColumnVirtualTreeFreezeRenderer.prototype.renderTable = function () {
13085
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
13086
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
13087
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
13088
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
13089
+ ColumnFreezeContentRenderer.prototype.renderTable.call(this);
13090
+ this.virtualRenderer.setPanel(this.parent.getContent());
13091
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
13092
+ var frozenRightCont = this.getFrozenRightContent();
13093
+ var frzCont = this.getFrozenContent();
13094
+ var movableCont = this.getMovableContent();
13095
+ if (this.parent.getFrozenMode() === 'Right') {
13096
+ frzCont = frozenRightCont;
13097
+ }
13098
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
13099
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
13100
+ var minHeight = this.parent.height;
13101
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
13102
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
13103
+ _super.prototype['renderVirtualFrozenLeft'].call(this, frzCont, movableCont);
13104
+ _super.prototype['renderVirtualFrozenRight'].call(this, frzCont, movableCont);
13105
+ _super.prototype['renderVirtualFrozenLeftRight'].call(this, frzCont, movableCont, frozenRightCont);
13106
+ this.virtualRenderer.virtualEle.table = this.getTable();
13107
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
13108
+ };
13109
+ ColumnVirtualTreeFreezeRenderer.prototype.appendContent = function (target, newChild, e) {
13110
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
13111
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
13112
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
13113
+ _super.prototype.appendContent.call(this, target, newChild, e);
13114
+ };
13115
+ return ColumnVirtualTreeFreezeRenderer;
13116
+ }(ColumnVirtualFreezeRenderer));
13117
+ /**
13118
+ * VirtualTreeFreezeHdrRenderer is used to render the virtual table within the frozen and movable header table
13119
+ *
13120
+ * @hidden
13121
+ */
13122
+ var VirtualTreeFreezeHdrRenderer = /** @__PURE__ @class */ (function (_super) {
13123
+ __extends$16(VirtualTreeFreezeHdrRenderer, _super);
13124
+ function VirtualTreeFreezeHdrRenderer() {
13125
+ return _super !== null && _super.apply(this, arguments) || this;
13126
+ }
13127
+ /**
13128
+ * @returns {void}
13129
+ * @hidden
13130
+ */
13131
+ VirtualTreeFreezeHdrRenderer.prototype.renderTable = function () {
13132
+ _super.prototype.renderTable.call(this);
13133
+ };
13134
+ VirtualTreeFreezeHdrRenderer.prototype.rfshMovable = function () {
13135
+ _super.prototype.rfshMovable.call(this);
13136
+ };
13137
+ return VirtualTreeFreezeHdrRenderer;
13138
+ }(VirtualFreezeHdrRenderer));
13139
+
12841
13140
  /**
12842
13141
  * TreeGrid Freeze module
12843
13142
  *
@@ -12858,6 +13157,7 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
12858
13157
  this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
12859
13158
  this.parent.on('dataBoundArg', this.dataBoundArg, this);
12860
13159
  this.parent.grid.on('dblclick', this.dblClickHandler, this);
13160
+ this.parent.grid.on('initial-load', this.instantiateRenderer, this);
12861
13161
  };
12862
13162
  Freeze$$1.prototype.removeEventListener = function () {
12863
13163
  if (this.parent.isDestroyed) {
@@ -12866,6 +13166,40 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
12866
13166
  this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
12867
13167
  this.parent.off('dataBoundArg', this.dataBoundArg);
12868
13168
  this.parent.grid.off('dblclick', this.dblClickHandler);
13169
+ this.parent.grid.off('initial-load', this.instantiateRenderer);
13170
+ };
13171
+ Freeze$$1.prototype.instantiateRenderer = function () {
13172
+ var renderer = getValue('serviceLocator', this.parent.grid).getService('rendererFactory');
13173
+ if (this.parent.getFrozenColumns()) {
13174
+ if (this.parent.enableColumnVirtualization) {
13175
+ getValue('addRenderer', renderer)
13176
+ .apply(renderer, [RenderType.Header, new VirtualTreeFreezeHdrRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13177
+ }
13178
+ else {
13179
+ getValue('addRenderer', renderer)
13180
+ .apply(renderer, [RenderType.Header, new FreezeRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13181
+ }
13182
+ if (this.parent.enableVirtualization) {
13183
+ getValue('addRenderer', renderer)
13184
+ .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13185
+ }
13186
+ else {
13187
+ getValue('addRenderer', renderer)
13188
+ .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13189
+ }
13190
+ }
13191
+ if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
13192
+ getValue('addRenderer', renderer)
13193
+ .apply(renderer, [RenderType.Header, new ColumnFreezeHeaderRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13194
+ if (this.parent.enableVirtualization) {
13195
+ getValue('addRenderer', renderer)
13196
+ .apply(renderer, [RenderType.Content, new ColumnVirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13197
+ }
13198
+ else {
13199
+ getValue('addRenderer', renderer)
13200
+ .apply(renderer, [RenderType.Content, new ColumnFreezeContentRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13201
+ }
13202
+ }
12869
13203
  };
12870
13204
  Freeze$$1.prototype.rowExpandCollapse = function (args) {
12871
13205
  var movableRows = this.parent.getMovableDataRows();
@@ -12910,7 +13244,7 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
12910
13244
  };
12911
13245
  Freeze$$1.prototype.dblClickHandler = function (e) {
12912
13246
  if (parentsUntil(e.target, 'e-rowcell') &&
12913
- this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
13247
+ this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell' && (!e.target['classList'].contains('e-treegridcollapse') && !e.target['classList'].contains('e-treegridexpand'))) {
12914
13248
  this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
12915
13249
  }
12916
13250
  };
@@ -13324,5 +13658,5 @@ var InfiniteScroll$1 = /** @__PURE__ @class */ (function () {
13324
13658
  * Export TreeGrid component
13325
13659
  */
13326
13660
 
13327
- export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
13661
+ export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, headerContent, movableContent, movableHeader, frozenContent, frozenHeader, content, table, leftRight, frozenRight, frozenLeft, dataColIndex, ariaColIndex, dataRowIndex, ariaRowIndex, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
13328
13662
  //# sourceMappingURL=ej2-treegrid.es5.js.map