@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';
@@ -440,6 +440,34 @@ const rowDropped = 'row-dropped';
440
440
  const autoCol = 'auto-col';
441
441
  /** @hidden */
442
442
  const rowDeselecting = 'rowDeselecting';
443
+ /** @hidden */
444
+ const headerContent = 'e-headercontent';
445
+ /** @hidden */
446
+ const movableContent = 'e-movablecontent';
447
+ /** @hidden */
448
+ const movableHeader = 'e-movableheader';
449
+ /** @hidden */
450
+ const frozenContent = 'e-frozencontent';
451
+ /** @hidden */
452
+ const frozenHeader = 'e-frozenheader';
453
+ /** @hidden */
454
+ const content = 'e-content';
455
+ /** @hidden */
456
+ const table = 'e-table';
457
+ /** @hidden */
458
+ const leftRight = 'Left-Right';
459
+ /** @hidden */
460
+ const frozenRight = 'frozen-right';
461
+ /** @hidden */
462
+ const frozenLeft = 'frozen-left';
463
+ /** @hidden */
464
+ const dataColIndex = 'data-colindex';
465
+ /** @hidden */
466
+ const ariaColIndex = 'aria-colindex';
467
+ /** @hidden */
468
+ const dataRowIndex = 'data-rowindex';
469
+ /** @hidden */
470
+ const ariaRowIndex = 'aria-rowindex';
443
471
 
444
472
  /**
445
473
  * The `Clipboard` module is used to handle clipboard copy action.
@@ -447,11 +475,12 @@ const rowDeselecting = 'rowDeselecting';
447
475
  * @hidden
448
476
  */
449
477
  class TreeClipboard extends Clipboard {
450
- constructor(parent) {
451
- super(parent.grid);
478
+ constructor(parent, serviceLocator) {
479
+ super(parent.grid, serviceLocator);
452
480
  this.treeCopyContent = '';
453
481
  this.copiedUniqueIdCollection = [];
454
482
  this.treeGridParent = parent;
483
+ this.serviceLocator = serviceLocator;
455
484
  }
456
485
  setCopyData(withHeader) {
457
486
  const copyContent = 'copyContent';
@@ -1247,8 +1276,8 @@ class Selection {
1247
1276
  childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?
1248
1277
  this.parent.getCurrentViewRecords() : this.parent.flatData;
1249
1278
  childData.forEach((record) => {
1250
- if (this.parent.enableVirtualization && record.childRecords.length > 0) {
1251
- if (record.hasChildRecords) {
1279
+ if (this.parent.enableVirtualization) {
1280
+ if (record.hasChildRecords && record.childRecords.length > 0) {
1252
1281
  this.updateParentSelection(record);
1253
1282
  }
1254
1283
  else {
@@ -2088,8 +2117,8 @@ class DataManipulation {
2088
2117
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
2089
2118
  currentData.index = this.storedIndex;
2090
2119
  }
2091
- if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
2092
- ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result)))) {
2120
+ if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) || ((currentData[this.parent.hasChildMapping]) &&
2121
+ isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result) || this.parent.enableInfiniteScrolling))) {
2093
2122
  currentData.hasChildRecords = true;
2094
2123
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
2095
2124
  && isNullOrUndefined(currentData[this.parent.childMapping])) {
@@ -2125,6 +2154,7 @@ class DataManipulation {
2125
2154
  currentData.checkboxState = 'uncheck';
2126
2155
  if (isNullOrUndefined(currentData[this.parent.parentIdMapping]) || currentData.parentItem) {
2127
2156
  this.parent.flatData.push(currentData);
2157
+ this.parent['infiniteScrollData'].push(currentData);
2128
2158
  }
2129
2159
  if (!this.isSelfReference && currentData.level === 0) {
2130
2160
  this.parent.parentData.push(currentData);
@@ -2880,6 +2910,10 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
2880
2910
  index = i;
2881
2911
  return;
2882
2912
  } });
2913
+ if (control.enableVirtualization && isNullOrUndefined(index)) {
2914
+ const updatedParent = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
2915
+ record = updatedParent;
2916
+ }
2883
2917
  if (!isNullOrUndefined(index)) {
2884
2918
  record = currentRecords[index];
2885
2919
  }
@@ -3304,6 +3338,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3304
3338
  initProperties() {
3305
3339
  this.defaultLocale = {};
3306
3340
  this.flatData = [];
3341
+ this.infiniteScrollData = [];
3307
3342
  this.parentData = [];
3308
3343
  this.columnModel = [];
3309
3344
  this.isExpandAll = false;
@@ -3593,7 +3628,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3593
3628
  if (!isNullOrUndefined(this.grid.clipboardModule)) {
3594
3629
  this.grid.clipboardModule.destroy();
3595
3630
  }
3596
- this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);
3631
+ this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
3597
3632
  }
3598
3633
  convertTreeData(data) {
3599
3634
  if (isCountRequired(this)) {
@@ -3685,13 +3720,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3685
3720
  this.grid[templateInstance] = this[templateInstance];
3686
3721
  const isJsComponent = 'isJsComponent';
3687
3722
  this.grid[isJsComponent] = true;
3723
+ this.grid.enableVirtualMaskRow = false; // Need to update in virtual mask row feature implementation.
3688
3724
  }
3689
3725
  triggerEvents(args) {
3690
3726
  this.trigger(getObject('name', args), args);
3691
3727
  }
3692
3728
  IsExpandCollapseClicked(args) {
3693
- if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3694
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3729
+ if (args['name'] === "rowSelecting" && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3730
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')) && (isNullOrUndefined(args['previousRowIndex']))) {
3731
+ args.cancel = true;
3732
+ return;
3733
+ }
3734
+ else if (args['name'] === "rowDeselecting" && !isNullOrUndefined(args.target) && ((!isNullOrUndefined(args.row) && (!args.row.length)) && (args.target.classList.contains('e-treegridexpand')
3735
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')))) {
3695
3736
  args.cancel = true;
3696
3737
  return;
3697
3738
  }
@@ -3747,7 +3788,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3747
3788
  this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);
3748
3789
  this.grid.dataSourceChanged = this.triggerEvents.bind(this);
3749
3790
  this.grid.recordDoubleClick = this.triggerEvents.bind(this);
3750
- this.grid.rowDeselecting = this.triggerEvents.bind(this);
3751
3791
  this.grid.cellDeselected = this.triggerEvents.bind(this);
3752
3792
  this.grid.cellDeselecting = this.triggerEvents.bind(this);
3753
3793
  this.grid.columnMenuOpen = this.triggerEvents.bind(this);
@@ -3925,6 +3965,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3925
3965
  this.grid.dataSource = { result: this.flatData, count: getValue('count', this.grid.dataSource) };
3926
3966
  }
3927
3967
  else {
3968
+ if (args.action.requestType !== 'infiniteScroll') {
3969
+ this.infiniteScrollData = [];
3970
+ }
3928
3971
  this.trigger(dataStateChange, args);
3929
3972
  }
3930
3973
  };
@@ -4102,6 +4145,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4102
4145
  this.selectedRecords = this.selectedRows = this.modifiedRecords = [];
4103
4146
  }
4104
4147
  else {
4148
+ if (this.grid.isFrozenGrid() && this.enableVirtualization && args['tableName'] === 'movable') {
4149
+ const movableContent$$1 = this.grid.element.querySelector('.' + movableContent);
4150
+ const frozenContent$$1 = this.grid.element.querySelector('.' + frozenContent);
4151
+ movableContent$$1.style.height = frozenContent$$1.style.height = 'auto';
4152
+ }
4105
4153
  this.trigger(actionComplete, args);
4106
4154
  }
4107
4155
  };
@@ -4943,8 +4991,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4943
4991
  this.grid.setRowData(key, rowData);
4944
4992
  const visibleRecords = this.getVisibleRecords();
4945
4993
  if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
4946
- const table = this.getContentTable();
4947
- const sHeight = table.scrollHeight;
4994
+ const table$$1 = this.getContentTable();
4995
+ const sHeight = table$$1.scrollHeight;
4948
4996
  const clientHeight = this.getContent().clientHeight;
4949
4997
  this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);
4950
4998
  }
@@ -5417,6 +5465,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5417
5465
  else {
5418
5466
  const rowInfo = this.grid.getRowInfo(target);
5419
5467
  let record = rowInfo.rowData;
5468
+ if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {
5469
+ const freezeRows = 'freezeRows';
5470
+ record = this.grid.contentModule[freezeRows].filter((e) => e.uid === rowInfo.row.getAttribute('data-uid'))[0].data;
5471
+ }
5420
5472
  if (this.enableImmutableMode) {
5421
5473
  record = this.getCurrentViewRecords()[rowInfo.rowIndex];
5422
5474
  }
@@ -5828,8 +5880,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5828
5880
  totalRows = [].slice.call(rows);
5829
5881
  for (let i = totalRows.length - 1; i >= 0; i--) {
5830
5882
  if (!isHidden(totalRows[i])) {
5831
- const table = this.getContentTable();
5832
- const sHeight = table.scrollHeight;
5883
+ const table$$1 = this.getContentTable();
5884
+ const sHeight = table$$1.scrollHeight;
5833
5885
  const clientHeight = this.getContent().clientHeight;
5834
5886
  this.lastRowBorder(totalRows[i], sHeight <= clientHeight);
5835
5887
  break;
@@ -5848,6 +5900,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5848
5900
  this.trigger(dataStateChange, expandingArgs);
5849
5901
  deff.promise.then(() => {
5850
5902
  if (expandingArgs.childData.length) {
5903
+ this.flatData = this.infiniteScrollData;
5851
5904
  const currentData = (this.flatData);
5852
5905
  let index = 0;
5853
5906
  for (let i = 0; i < currentData.length; i++) {
@@ -5897,8 +5950,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5897
5950
  }
5898
5951
  }
5899
5952
  this.isExpandRefresh = true;
5953
+ const scrollHeightBeforeRefresh = this.getContentTable().parentElement.scrollTop;
5900
5954
  this.grid.refresh();
5901
5955
  this.setHeightForFrozenContent();
5956
+ if (this.enableInfiniteScrolling) {
5957
+ this.getContentTable().parentElement.scrollTop = scrollHeightBeforeRefresh;
5958
+ }
5902
5959
  this.trigger(expanded, expandingArgs);
5903
5960
  });
5904
5961
  }
@@ -7139,13 +7196,16 @@ class RowDD$1 {
7139
7196
  for (let i = 0; i < tObj.getCurrentViewRecords().length; i++) {
7140
7197
  if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {
7141
7198
  dropIndex = i;
7199
+ if (tObj.enableVirtualization) {
7200
+ dropIndex = parseInt(tObj.getRows()[i].getAttribute('data-rowindex'), 10);
7201
+ }
7142
7202
  }
7143
7203
  }
7144
7204
  }
7145
7205
  else {
7146
7206
  dropIndex = this.selectedRow.rowIndex - 1;
7147
7207
  }
7148
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7208
+ if (this.parent.enableVirtualization && this.selectedRecord && !(record.level > this.selectedRecord.level)) {
7149
7209
  dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
7150
7210
  }
7151
7211
  tObj[action] = 'indenting';
@@ -7160,11 +7220,11 @@ class RowDD$1 {
7160
7220
  let dropIndex;
7161
7221
  const parentItem = this.selectedRecord.parentItem;
7162
7222
  for (let i = 0; i < tObj.getCurrentViewRecords().length; i++) {
7163
- if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {
7223
+ if (tObj.getCurrentViewRecords()[i].uniqueID === parentItem.uniqueID) {
7164
7224
  dropIndex = i;
7165
7225
  }
7166
7226
  }
7167
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
7227
+ if (this.parent.enableVirtualization && this.selectedRecord) {
7168
7228
  dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('data-rowindex'), 10);
7169
7229
  }
7170
7230
  tObj[action] = 'outdenting';
@@ -7183,7 +7243,7 @@ class RowDD$1 {
7183
7243
  this.parent.trigger(actionBegin, actionArgs, (actionArgs) => {
7184
7244
  if (!actionArgs.cancel) {
7185
7245
  if (actionArgs.action === 'indenting') {
7186
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
7246
+ if (this.parent.enableVirtualization) {
7187
7247
  this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
7188
7248
  }
7189
7249
  else {
@@ -7191,7 +7251,7 @@ class RowDD$1 {
7191
7251
  }
7192
7252
  }
7193
7253
  else if (actionArgs.action === 'outdenting') {
7194
- if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
7254
+ if (this.parent.enableVirtualization) {
7195
7255
  this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
7196
7256
  }
7197
7257
  else {
@@ -7544,16 +7604,16 @@ class RowDD$1 {
7544
7604
  classList(ele, ['e-errorcontainer'], []);
7545
7605
  classList(ele, ['e-icons', 'e-errorelem'], []);
7546
7606
  const errorVal = dragelem.querySelector('.errorValue');
7547
- let content = dragelem.querySelector('.e-rowcell').innerHTML;
7607
+ let content$$1 = dragelem.querySelector('.e-rowcell').innerHTML;
7548
7608
  if (errorVal) {
7549
- content = errorVal.innerHTML;
7609
+ content$$1 = errorVal.innerHTML;
7550
7610
  errorVal.parentNode.removeChild(errorVal);
7551
7611
  }
7552
7612
  dragelem.querySelector('.e-rowcell').innerHTML = '';
7553
7613
  const spanContent = document.createElement('span');
7554
7614
  spanContent.className = 'errorValue';
7555
7615
  spanContent.style.paddingLeft = '16px';
7556
- spanContent.innerHTML = content;
7616
+ spanContent.innerHTML = content$$1;
7557
7617
  dragelem.querySelector('.e-rowcell').appendChild(ele);
7558
7618
  dragelem.querySelector('.e-rowcell').appendChild(spanContent);
7559
7619
  const dropItemSpan = document.querySelector('.e-dropitemscount');
@@ -8402,6 +8462,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
8402
8462
  const currentPage = this[model].currentPage;
8403
8463
  if (clear) {
8404
8464
  this.cache = {};
8465
+ this.movableCache = {};
8466
+ this.frozenRightCache = {};
8405
8467
  this.data = {};
8406
8468
  this.groups = {};
8407
8469
  }
@@ -8415,6 +8477,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
8415
8477
  this.cache = {};
8416
8478
  this.data = {};
8417
8479
  this.groups = {};
8480
+ this.movableCache = {};
8481
+ this.frozenRightCache = {};
8418
8482
  }
8419
8483
  }
8420
8484
  return clear;
@@ -9786,7 +9850,7 @@ class ContextMenu$1 {
9786
9850
  const indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
9787
9851
  const outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
9788
9852
  if (addRow) {
9789
- if (this.parent.grid.editSettings.allowAdding === false) {
9853
+ if (this.parent.grid.editSettings.allowAdding === false || this.parent.grid.isEdit) {
9790
9854
  addRow.style.display = 'none';
9791
9855
  }
9792
9856
  else {
@@ -10155,13 +10219,13 @@ class BatchEdit {
10155
10219
  this.updateRowIndex();
10156
10220
  // update focus module, need to refix this once grid source modified.
10157
10221
  const focusModule = getValue('focusModule', this.parent.grid);
10158
- const table = this.parent.getContentTable();
10222
+ const table$$1 = this.parent.getContentTable();
10159
10223
  if (this.parent.getBatchChanges()[this.deletedRecords].length && this.parent.editSettings.newRowPosition === 'Above') {
10160
10224
  actualIndex = e.row.rowIndex;
10161
10225
  focusModule.getContent().matrix.matrix = this.matrix;
10162
10226
  }
10163
10227
  else {
10164
- actualIndex = table.getElementsByClassName('e-batchrow')[0].rowIndex;
10228
+ actualIndex = table$$1.getElementsByClassName('e-batchrow')[0].rowIndex;
10165
10229
  // if (this.parent.frozenRows || this.parent.frozenColumns) {
10166
10230
  // actualIndex = this.batchIndex;
10167
10231
  // }
@@ -10826,6 +10890,9 @@ class Edit$1 {
10826
10890
  args.cancel = true;
10827
10891
  }
10828
10892
  }
10893
+ if (this.parent.enableVirtualization) {
10894
+ this.parent.grid.contentModule['editedRowIndex'] = this.parent.grid.editModule.editModule['index'];
10895
+ }
10829
10896
  // if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {
10830
10897
  // this.isAdd = false;
10831
10898
  // }
@@ -10944,6 +11011,9 @@ class Edit$1 {
10944
11011
  this.parent.grid.isEdit = true;
10945
11012
  }
10946
11013
  }
11014
+ if (this.parent.enableVirtualization) {
11015
+ this.parent.grid.contentModule['virtualData'] = {};
11016
+ }
10947
11017
  }
10948
11018
  afterCellSave(args, row, rowIndex) {
10949
11019
  let mRow;
@@ -11193,7 +11263,12 @@ class Edit$1 {
11193
11263
  if (isVirtualization) {
11194
11264
  this.prevAriaRowIndex = '-1';
11195
11265
  }
11196
- focussedElement.focus();
11266
+ if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11267
+ focussedElement.focus();
11268
+ }
11269
+ if (this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11270
+ this.parent.grid.contentModule['createEmptyRowdata']();
11271
+ }
11197
11272
  }
11198
11273
  }
11199
11274
  if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
@@ -11313,6 +11388,9 @@ class Edit$1 {
11313
11388
  }
11314
11389
  if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
11315
11390
  this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
11391
+ if (this.parent.enableVirtualization && this.isAddedRowByContextMenu) {
11392
+ this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
11393
+ }
11316
11394
  }
11317
11395
  else {
11318
11396
  this.addRowRecord = this.parent.getSelectedRecords()[0];
@@ -11349,15 +11427,18 @@ class Edit$1 {
11349
11427
  let position = null;
11350
11428
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
11351
11429
  let currentData;
11352
- if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11430
+ if (this.parent.enableVirtualization && args.index !== 0) {
11431
+ currentData = this.parent.flatData;
11432
+ }
11433
+ else if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11353
11434
  currentData = this.batchEditModule['batchRecords'];
11354
11435
  }
11355
11436
  else {
11356
11437
  currentData = this.parent.grid.getCurrentViewRecords();
11357
11438
  }
11358
11439
  if (this.parent.enableVirtualization && args.index !== 0) {
11359
- this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
11360
- this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('data-rowindex'), 10);
11440
+ this.addRowIndex = this.parent.flatData.indexOf(this.addRowRecord);
11441
+ this.selectedIndex = this.addRowIndex;
11361
11442
  }
11362
11443
  let index = this.addRowIndex;
11363
11444
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11371,7 +11452,8 @@ class Edit$1 {
11371
11452
  const rows = this.parent.getRows();
11372
11453
  const firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
11373
11454
  const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11374
- const withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11455
+ const withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
11456
+ this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11375
11457
  if (currentData.length) {
11376
11458
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
11377
11459
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
@@ -11719,6 +11801,29 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11719
11801
  getRowByIndex(index) {
11720
11802
  return this.parent.getDataRows().filter((e) => parseInt(e.getAttribute('data-rowindex'), 10) === index)[0];
11721
11803
  }
11804
+ getMovableVirtualRowByIndex(index) {
11805
+ return this.getRowCollection(index, true);
11806
+ }
11807
+ getFrozenRightVirtualRowByIndex(index) {
11808
+ return this.getRowCollection(index, false, false, true);
11809
+ }
11810
+ getRowCollection(index, isMovable, isRowObject, isFrozenRight) {
11811
+ const startIdx = parseInt(this.parent.getRows()[0].getAttribute(dataRowIndex), 10);
11812
+ let rowCollection = isMovable ? this.parent.getMovableDataRows() : this.parent.getDataRows();
11813
+ rowCollection = isFrozenRight ? this.parent.getFrozenRightDataRows() : rowCollection;
11814
+ const collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
11815
+ let selectedRow = collection[index - startIdx];
11816
+ if (this.parent.frozenRows && this.parent.pageSettings.currentPage > 1) {
11817
+ if (!isRowObject) {
11818
+ selectedRow = index <= this.parent.frozenRows ? rowCollection[index]
11819
+ : rowCollection[(index - startIdx) + this.parent.frozenRows];
11820
+ }
11821
+ else {
11822
+ selectedRow = index <= this.parent.frozenRows ? this.parent.getRowsObject()[index].data : selectedRow;
11823
+ }
11824
+ }
11825
+ return selectedRow;
11826
+ }
11722
11827
  addEventListener() {
11723
11828
  this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
11724
11829
  this.parent.on(indexModifier, this.indexModifier, this);
@@ -11734,10 +11839,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11734
11839
  }
11735
11840
  }
11736
11841
  indexModifier(args) {
11737
- const content = this.parent.getContent().querySelector('.e-content');
11842
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
11738
11843
  if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {
11739
11844
  if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {
11740
- const nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
11845
+ const nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
11741
11846
  let lastIndex = nextSetResIndex + this.parent.getRows().length;
11742
11847
  if (lastIndex > args.count) {
11743
11848
  lastIndex = nextSetResIndex +
@@ -11746,7 +11851,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11746
11851
  this.startIndex = lastIndex - this.parent.getRows().length;
11747
11852
  this.endIndex = lastIndex;
11748
11853
  }
11749
- else {
11854
+ else if (this.parent.root.editSettings.newRowPosition !== 'Top' && this.parent.root.editModule.selectedIndex !== -1 || this.parent.root.editModule.selectedIndex !== -1) {
11750
11855
  this.startIndex += 1;
11751
11856
  this.endIndex += 1;
11752
11857
  }
@@ -11797,7 +11902,15 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11797
11902
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
11798
11903
  if (!isNullOrUndefined(e.count)) {
11799
11904
  this.totalRecords = e.count;
11800
- if (!this.parent.enableColumnVirtualization) {
11905
+ // To overcome the white space issue in last page when records collapsed
11906
+ if (this.parent.isFrozenGrid() && e.count < Object.keys(this.parent.dataSource).length) {
11907
+ const width = this.parent.enableColumnVirtualization ?
11908
+ this.getColumnOffset(this.parent.columns.length - 1) + 'px' : '100%';
11909
+ const height = (this.parent.getRowHeight() * e.count) -
11910
+ (this.parent.getRowHeight() * this.parent.pageSettings.pageSize);
11911
+ getValue('virtualEle', this).setVirtualHeight(height, width);
11912
+ }
11913
+ if (!this.parent.enableColumnVirtualization && !this.parent.isFrozenGrid()) {
11801
11914
  getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
11802
11915
  }
11803
11916
  }
@@ -11895,6 +12008,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11895
12008
  return new Cell(opt);
11896
12009
  }
11897
12010
  beginEdit(e) {
12011
+ this['editedRowIndex'] = e.index;
11898
12012
  const selector = '.e-row[data-rowindex="' + e.index + '"]';
11899
12013
  const index = this.parent.getContent().querySelector(selector).rowIndex;
11900
12014
  const rowData = this.parent.getCurrentViewRecords()[index];
@@ -11934,8 +12048,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11934
12048
  }
11935
12049
  virtualEditSuccess() {
11936
12050
  const isAdd = 'isAdd';
11937
- const content = this.parent.getContent().querySelector('.e-content');
11938
- if (this[isAdd] && content.querySelector('.e-addedrow')) {
12051
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12052
+ if (this[isAdd] && content$$1.querySelector('.e-addedrow')) {
11939
12053
  this.recordAdded = true;
11940
12054
  }
11941
12055
  }
@@ -11949,10 +12063,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11949
12063
  }
11950
12064
  restoreNewRow() {
11951
12065
  const isAdd = 'isAdd';
11952
- const content = this.parent.getContent().querySelector('.e-content');
11953
- if (this[isAdd] && !content.querySelector('.e-addedrow')) {
12066
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12067
+ if (this[isAdd] && !content$$1.querySelector('.e-addedrow')) {
11954
12068
  this.parent.isEdit = false;
11955
- this.parent.addRecord();
12069
+ this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
11956
12070
  }
11957
12071
  }
11958
12072
  getData(data) {
@@ -11965,7 +12079,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11965
12079
  this.parent.notify('get-row-position', addArgs);
11966
12080
  this.rowPosition = addArgs.newRowPosition;
11967
12081
  this.addRowIndex = addArgs.addRowIndex;
11968
- this.dataRowIndex = addArgs.dataRowIndex;
12082
+ this.dataRowIndex = this.parent.root.editModule.selectedIndex;
11969
12083
  }
11970
12084
  const actionComplete$$1 = 'actionComplete';
11971
12085
  super[actionComplete$$1](args);
@@ -11986,17 +12100,20 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11986
12100
  const maxLeft = this.vgenerator.cOffsets[idx - 1];
11987
12101
  x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
11988
12102
  }
11989
- this.virtualEle.adjustTable(x, this.translateY);
11990
- if (this.parent.enableColumnVirtualization) {
11991
- this.header.virtualEle.adjustTable(x, 0);
12103
+ if (!this.parent.isFrozenGrid()) {
12104
+ this.virtualEle.adjustTable(x, this.translateY);
12105
+ if (this.parent.enableColumnVirtualization) {
12106
+ this.header.virtualEle.adjustTable(x, 0);
12107
+ }
11992
12108
  }
11993
12109
  }
11994
12110
  };
11995
12111
  }
11996
12112
  scrollListeners(scrollArgs) {
12113
+ this['scrollAfterEdit']();
11997
12114
  const info = scrollArgs.sentinel;
11998
12115
  const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
11999
- const content = this.parent.getContent().querySelector('.e-content');
12116
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12000
12117
  const scrollHeight = outBuffer * this.parent.getRowHeight();
12001
12118
  const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
12002
12119
  const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
@@ -12006,7 +12123,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12006
12123
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12007
12124
  const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
12008
12125
  this.parent.element.getBoundingClientRect().height);
12009
- let index = (~~(content.scrollTop / this.parent.getRowHeight())
12126
+ let index = (~~(content$$1.scrollTop / this.parent.getRowHeight())
12010
12127
  + Math.ceil(vHeight / this.parent.getRowHeight()))
12011
12128
  - this.parent.pageSettings.pageSize;
12012
12129
  index = (index > 0) ? index : 0;
@@ -12021,7 +12138,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12021
12138
  this.endIndex = lastInx;
12022
12139
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
12023
12140
  }
12024
- if (currentViewData.length && ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12141
+ if (currentViewData.length && (currentViewData[0][indexValue] >= this.parent.pageSettings.pageSize / 2) &&
12142
+ ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12025
12143
  this.startIndex = currentViewData[0][indexValue] - (this.parent.pageSettings.pageSize / 2);
12026
12144
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
12027
12145
  }
@@ -12050,7 +12168,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12050
12168
  }
12051
12169
  }
12052
12170
  else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12053
- let nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
12171
+ let nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
12054
12172
  const isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
12055
12173
  if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
12056
12174
  nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {
@@ -12068,7 +12186,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12068
12186
  this.startIndex = currentViewData[0][indexValue] + (this.parent.pageSettings.pageSize / 2);
12069
12187
  }
12070
12188
  if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {
12071
- this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
12189
+ this.translateY = this.getTranslateY(scrollArgs.offset.top, content$$1.getBoundingClientRect().height);
12072
12190
  }
12073
12191
  else {
12074
12192
  if (this.parent.allowRowDragAndDrop) {
@@ -12086,6 +12204,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12086
12204
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
12087
12205
  const page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
12088
12206
  this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
12207
+ this.requestType = 'virtualscroll';
12089
12208
  if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
12090
12209
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
12091
12210
  }
@@ -12093,12 +12212,28 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12093
12212
  }
12094
12213
  }
12095
12214
  appendContent(target, newChild, e) {
12215
+ const isFrozen = this.parent.isFrozenGrid();
12096
12216
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
12097
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
12217
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || this.parent.isFrozenGrid()) {
12098
12218
  if (getValue('isExpandCollapse', e)) {
12099
12219
  this.isRemoteExpand = true;
12100
12220
  }
12221
+ if (isFrozen && isNullOrUndefined(this.requestType) && getValue('requestTypes', this).indexOf('isFrozen') === -1) {
12222
+ getValue('requestTypes', this).push('isFrozen');
12223
+ this.requestType = 'isFrozen';
12224
+ }
12101
12225
  super.appendContent(target, newChild, e);
12226
+ if (getValue('requestTypes', this).indexOf('isFrozen') !== -1) {
12227
+ getValue('requestTypes', this).splice(getValue('requestTypes', this).indexOf('isFrozen'), 1);
12228
+ this.requestType = this.requestType === 'isFrozen' ? undefined : this.requestType;
12229
+ }
12230
+ if (isFrozen && (!this.isExpandCollapse || this.translateY === 0)) {
12231
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
12232
+ getValue('virtualEle', this).adjustTable(0, this.translateY);
12233
+ }
12234
+ else {
12235
+ this.isExpandCollapse = false;
12236
+ }
12102
12237
  }
12103
12238
  else {
12104
12239
  const info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&
@@ -12184,6 +12319,11 @@ class TreeInterSectionObserver extends InterSectionObserver {
12184
12319
  const containerRect = 'containerRect';
12185
12320
  super[containerRect] = getValue('options', this).container.getBoundingClientRect();
12186
12321
  EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12322
+ if (getValue('options', this).movableContainer) {
12323
+ const movableContainerRect = 'movableContainerRect';
12324
+ super[movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
12325
+ EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12326
+ }
12187
12327
  }
12188
12328
  clear() {
12189
12329
  this.lastPos = null;
@@ -12385,6 +12525,7 @@ class VirtualScroll$1 {
12385
12525
  }
12386
12526
  }
12387
12527
  this.expandCollapseRec = null;
12528
+ startIndex = startIndex < 0 ? 0 : startIndex;
12388
12529
  pageingDetails.result = visualData.slice(startIndex, endIndex);
12389
12530
  this.prevstartIndex = startIndex;
12390
12531
  this.prevendIndex = endIndex;
@@ -12414,12 +12555,14 @@ class TreeVirtual extends VirtualScroll {
12414
12555
  const parentGrid = getValue('parent', this);
12415
12556
  getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
12416
12557
  const renderer = getValue('locator', this).getService('rendererFactory');
12417
- if (parentGrid.enableColumnVirtualization) {
12558
+ if (!parentGrid.isFrozenGrid()) {
12559
+ if (parentGrid.enableColumnVirtualization) {
12560
+ getValue('addRenderer', renderer)
12561
+ .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12562
+ }
12418
12563
  getValue('addRenderer', renderer)
12419
- .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12564
+ .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12420
12565
  }
12421
- getValue('addRenderer', renderer)
12422
- .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12423
12566
  //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
12424
12567
  this.ensurePageSize();
12425
12568
  }
@@ -12438,6 +12581,138 @@ class TreeVirtual extends VirtualScroll {
12438
12581
  }
12439
12582
  }
12440
12583
 
12584
+ /**
12585
+ * VirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
12586
+ *
12587
+ * @hidden
12588
+ */
12589
+ class VirtualTreeFreezeRenderer extends VirtualFreezeRenderer {
12590
+ constructor(parent, locator) {
12591
+ super(parent, locator);
12592
+ this.addEventListener();
12593
+ }
12594
+ /**
12595
+ * @returns {void}
12596
+ * @hidden
12597
+ */
12598
+ renderTable() {
12599
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
12600
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
12601
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
12602
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
12603
+ FreezeContentRender.prototype.renderTable.call(this);
12604
+ this.virtualRenderer.setPanel(this.parent.getContent());
12605
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
12606
+ const movableCont = this.getMovableContent();
12607
+ const minHeight = this.parent.height;
12608
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
12609
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
12610
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
12611
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
12612
+ if (this.parent.enableColumnVirtualization) {
12613
+ this.virtualRenderer.virtualEle.movableContent = this.virtualRenderer.movableContent
12614
+ = this.getPanel().querySelector('.' + movableContent);
12615
+ this.virtualRenderer.virtualEle.renderMovableWrapper(minHeight);
12616
+ this.virtualRenderer.virtualEle.renderMovablePlaceHolder();
12617
+ const tbl = movableCont.querySelector('table');
12618
+ this.virtualRenderer.virtualEle.movableTable = tbl;
12619
+ this.virtualRenderer.virtualEle.movableWrapper.appendChild(tbl);
12620
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movableWrapper);
12621
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder);
12622
+ }
12623
+ this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent());
12624
+ this.virtualRenderer.virtualEle.wrapper.appendChild(movableCont);
12625
+ this.virtualRenderer.virtualEle.table = this.getTable();
12626
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
12627
+ }
12628
+ /**
12629
+ * @param {HTMLElement} target - specifies the target
12630
+ * @param {DocumentFragment} newChild - specifies the newChild
12631
+ * @param {NotifyArgs} e - specifies the notifyargs
12632
+ * @returns {void}
12633
+ * @hidden
12634
+ */
12635
+ appendContent(target, newChild, e) {
12636
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
12637
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
12638
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
12639
+ super.appendContent(target, newChild, e);
12640
+ }
12641
+ /**
12642
+ * @param {Object[]} data - specifies the data
12643
+ * @param {NotifyArgs} e - specifies the notifyargs
12644
+ * @returns {Row<Column>[]} returns the row
12645
+ * @hidden
12646
+ */
12647
+ generateRows(data, e) {
12648
+ return super.generateRows(data, e);
12649
+ }
12650
+ }
12651
+ /**
12652
+ * ColumnVirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
12653
+ *
12654
+ * @hidden
12655
+ */
12656
+ class ColumnVirtualTreeFreezeRenderer extends ColumnVirtualFreezeRenderer {
12657
+ constructor(parent, locator) {
12658
+ super(parent, locator);
12659
+ this.serviceLoc = locator;
12660
+ this.eventListener('on');
12661
+ }
12662
+ /**
12663
+ * @returns {void}
12664
+ * @hidden
12665
+ */
12666
+ renderTable() {
12667
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
12668
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
12669
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
12670
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
12671
+ ColumnFreezeContentRenderer.prototype.renderTable.call(this);
12672
+ this.virtualRenderer.setPanel(this.parent.getContent());
12673
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
12674
+ const frozenRightCont = this.getFrozenRightContent();
12675
+ let frzCont = this.getFrozenContent();
12676
+ const movableCont = this.getMovableContent();
12677
+ if (this.parent.getFrozenMode() === 'Right') {
12678
+ frzCont = frozenRightCont;
12679
+ }
12680
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
12681
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
12682
+ const minHeight = this.parent.height;
12683
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
12684
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
12685
+ super['renderVirtualFrozenLeft'](frzCont, movableCont);
12686
+ super['renderVirtualFrozenRight'](frzCont, movableCont);
12687
+ super['renderVirtualFrozenLeftRight'](frzCont, movableCont, frozenRightCont);
12688
+ this.virtualRenderer.virtualEle.table = this.getTable();
12689
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
12690
+ }
12691
+ appendContent(target, newChild, e) {
12692
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
12693
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
12694
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
12695
+ super.appendContent(target, newChild, e);
12696
+ }
12697
+ }
12698
+ /**
12699
+ * VirtualTreeFreezeHdrRenderer is used to render the virtual table within the frozen and movable header table
12700
+ *
12701
+ * @hidden
12702
+ */
12703
+ class VirtualTreeFreezeHdrRenderer extends VirtualFreezeHdrRenderer {
12704
+ /**
12705
+ * @returns {void}
12706
+ * @hidden
12707
+ */
12708
+ renderTable() {
12709
+ super.renderTable();
12710
+ }
12711
+ rfshMovable() {
12712
+ super.rfshMovable();
12713
+ }
12714
+ }
12715
+
12441
12716
  /**
12442
12717
  * TreeGrid Freeze module
12443
12718
  *
@@ -12458,6 +12733,7 @@ class Freeze$1 {
12458
12733
  this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
12459
12734
  this.parent.on('dataBoundArg', this.dataBoundArg, this);
12460
12735
  this.parent.grid.on('dblclick', this.dblClickHandler, this);
12736
+ this.parent.grid.on('initial-load', this.instantiateRenderer, this);
12461
12737
  }
12462
12738
  removeEventListener() {
12463
12739
  if (this.parent.isDestroyed) {
@@ -12466,6 +12742,40 @@ class Freeze$1 {
12466
12742
  this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
12467
12743
  this.parent.off('dataBoundArg', this.dataBoundArg);
12468
12744
  this.parent.grid.off('dblclick', this.dblClickHandler);
12745
+ this.parent.grid.off('initial-load', this.instantiateRenderer);
12746
+ }
12747
+ instantiateRenderer() {
12748
+ const renderer = getValue('serviceLocator', this.parent.grid).getService('rendererFactory');
12749
+ if (this.parent.getFrozenColumns()) {
12750
+ if (this.parent.enableColumnVirtualization) {
12751
+ getValue('addRenderer', renderer)
12752
+ .apply(renderer, [RenderType.Header, new VirtualTreeFreezeHdrRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12753
+ }
12754
+ else {
12755
+ getValue('addRenderer', renderer)
12756
+ .apply(renderer, [RenderType.Header, new FreezeRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12757
+ }
12758
+ if (this.parent.enableVirtualization) {
12759
+ getValue('addRenderer', renderer)
12760
+ .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12761
+ }
12762
+ else {
12763
+ getValue('addRenderer', renderer)
12764
+ .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12765
+ }
12766
+ }
12767
+ if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
12768
+ getValue('addRenderer', renderer)
12769
+ .apply(renderer, [RenderType.Header, new ColumnFreezeHeaderRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12770
+ if (this.parent.enableVirtualization) {
12771
+ getValue('addRenderer', renderer)
12772
+ .apply(renderer, [RenderType.Content, new ColumnVirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12773
+ }
12774
+ else {
12775
+ getValue('addRenderer', renderer)
12776
+ .apply(renderer, [RenderType.Content, new ColumnFreezeContentRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12777
+ }
12778
+ }
12469
12779
  }
12470
12780
  rowExpandCollapse(args) {
12471
12781
  const movableRows = this.parent.getMovableDataRows();
@@ -12506,7 +12816,7 @@ class Freeze$1 {
12506
12816
  }
12507
12817
  dblClickHandler(e) {
12508
12818
  if (parentsUntil(e.target, 'e-rowcell') &&
12509
- this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
12819
+ this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell' && (!e.target['classList'].contains('e-treegridcollapse') && !e.target['classList'].contains('e-treegridexpand'))) {
12510
12820
  this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
12511
12821
  }
12512
12822
  }
@@ -12912,5 +13222,5 @@ class InfiniteScroll$1 {
12912
13222
  * Export TreeGrid component
12913
13223
  */
12914
13224
 
12915
- 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 };
13225
+ 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 };
12916
13226
  //# sourceMappingURL=ej2-treegrid.es2015.js.map