@syncfusion/ej2-treegrid 20.2.49 → 20.3.48

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 +3 -53
  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 +376 -57
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +405 -62
  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 +33 -6
  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 +7 -2
  39. package/styles/bootstrap5.css +7 -2
  40. package/styles/fabric-dark.css +5 -1
  41. package/styles/fabric.css +5 -1
  42. package/styles/fluent-dark.css +6 -2
  43. package/styles/fluent.css +6 -2
  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 +4 -4
  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 +7 -2
  71. package/styles/treegrid/bootstrap5.css +7 -2
  72. package/styles/treegrid/fabric-dark.css +5 -1
  73. package/styles/treegrid/fabric.css +5 -1
  74. package/styles/treegrid/fluent-dark.css +6 -2
  75. package/styles/treegrid/fluent.css +6 -2
  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
  // }
@@ -10755,6 +10819,10 @@ class Edit$1 {
10755
10819
  }
10756
10820
  this.updateGridEditMode('Batch');
10757
10821
  }
10822
+ else if (this.parent.editSettings.mode === 'Cell' && (!column.allowEditing || column.isPrimaryKey)) {
10823
+ this.isOnBatch = true;
10824
+ this.updateGridEditMode('Batch');
10825
+ }
10758
10826
  }
10759
10827
  updateGridEditMode(mode) {
10760
10828
  this.parent.grid.setProperties({ editSettings: { mode: mode } }, true);
@@ -10826,6 +10894,9 @@ class Edit$1 {
10826
10894
  args.cancel = true;
10827
10895
  }
10828
10896
  }
10897
+ if (this.parent.enableVirtualization) {
10898
+ this.parent.grid.contentModule['editedRowIndex'] = this.parent.grid.editModule.editModule['index'];
10899
+ }
10829
10900
  // if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {
10830
10901
  // this.isAdd = false;
10831
10902
  // }
@@ -10944,6 +11015,9 @@ class Edit$1 {
10944
11015
  this.parent.grid.isEdit = true;
10945
11016
  }
10946
11017
  }
11018
+ if (this.parent.enableVirtualization) {
11019
+ this.parent.grid.contentModule['virtualData'] = {};
11020
+ }
10947
11021
  }
10948
11022
  afterCellSave(args, row, rowIndex) {
10949
11023
  let mRow;
@@ -11193,7 +11267,12 @@ class Edit$1 {
11193
11267
  if (isVirtualization) {
11194
11268
  this.prevAriaRowIndex = '-1';
11195
11269
  }
11196
- focussedElement.focus();
11270
+ if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11271
+ focussedElement.focus();
11272
+ }
11273
+ if (this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
11274
+ this.parent.grid.contentModule['createEmptyRowdata']();
11275
+ }
11197
11276
  }
11198
11277
  }
11199
11278
  if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
@@ -11313,6 +11392,9 @@ class Edit$1 {
11313
11392
  }
11314
11393
  if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
11315
11394
  this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
11395
+ if (this.parent.enableVirtualization && this.isAddedRowByContextMenu) {
11396
+ this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
11397
+ }
11316
11398
  }
11317
11399
  else {
11318
11400
  this.addRowRecord = this.parent.getSelectedRecords()[0];
@@ -11349,15 +11431,18 @@ class Edit$1 {
11349
11431
  let position = null;
11350
11432
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
11351
11433
  let currentData;
11352
- if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11434
+ if (this.parent.enableVirtualization && args.index !== 0) {
11435
+ currentData = this.parent.flatData;
11436
+ }
11437
+ else if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
11353
11438
  currentData = this.batchEditModule['batchRecords'];
11354
11439
  }
11355
11440
  else {
11356
11441
  currentData = this.parent.grid.getCurrentViewRecords();
11357
11442
  }
11358
11443
  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);
11444
+ this.addRowIndex = this.parent.flatData.indexOf(this.addRowRecord);
11445
+ this.selectedIndex = this.addRowIndex;
11361
11446
  }
11362
11447
  let index = this.addRowIndex;
11363
11448
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11371,7 +11456,8 @@ class Edit$1 {
11371
11456
  const rows = this.parent.getRows();
11372
11457
  const firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
11373
11458
  const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
11374
- const withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11459
+ const withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
11460
+ this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
11375
11461
  if (currentData.length) {
11376
11462
  idMapping = currentData[this.addRowIndex][this.parent.idMapping];
11377
11463
  parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
@@ -11407,7 +11493,12 @@ class Edit$1 {
11407
11493
  }
11408
11494
  index = (childRecordCount1 > 0) ? (currentDataIndex1 + childRecordCount1) : (currentDataIndex1);
11409
11495
  if (this.isSelfReference) {
11410
- value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = idMapping;
11496
+ if (!this.parent.isLocalData && this.parent.editModule.selectedIndex === -1) {
11497
+ value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = null;
11498
+ }
11499
+ else {
11500
+ value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = idMapping;
11501
+ }
11411
11502
  if (!isNullOrUndefined(value.parentItem)) {
11412
11503
  updateParentRow(key, value.parentItem, 'add', this.parent, this.isSelfReference, value);
11413
11504
  }
@@ -11719,6 +11810,29 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11719
11810
  getRowByIndex(index) {
11720
11811
  return this.parent.getDataRows().filter((e) => parseInt(e.getAttribute('data-rowindex'), 10) === index)[0];
11721
11812
  }
11813
+ getMovableVirtualRowByIndex(index) {
11814
+ return this.getRowCollection(index, true);
11815
+ }
11816
+ getFrozenRightVirtualRowByIndex(index) {
11817
+ return this.getRowCollection(index, false, false, true);
11818
+ }
11819
+ getRowCollection(index, isMovable, isRowObject, isFrozenRight) {
11820
+ const startIdx = parseInt(this.parent.getRows()[0].getAttribute(dataRowIndex), 10);
11821
+ let rowCollection = isMovable ? this.parent.getMovableDataRows() : this.parent.getDataRows();
11822
+ rowCollection = isFrozenRight ? this.parent.getFrozenRightDataRows() : rowCollection;
11823
+ const collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
11824
+ let selectedRow = collection[index - startIdx];
11825
+ if (this.parent.frozenRows && this.parent.pageSettings.currentPage > 1) {
11826
+ if (!isRowObject) {
11827
+ selectedRow = index <= this.parent.frozenRows ? rowCollection[index]
11828
+ : rowCollection[(index - startIdx) + this.parent.frozenRows];
11829
+ }
11830
+ else {
11831
+ selectedRow = index <= this.parent.frozenRows ? this.parent.getRowsObject()[index].data : selectedRow;
11832
+ }
11833
+ }
11834
+ return selectedRow;
11835
+ }
11722
11836
  addEventListener() {
11723
11837
  this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
11724
11838
  this.parent.on(indexModifier, this.indexModifier, this);
@@ -11734,10 +11848,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11734
11848
  }
11735
11849
  }
11736
11850
  indexModifier(args) {
11737
- const content = this.parent.getContent().querySelector('.e-content');
11851
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
11738
11852
  if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {
11739
11853
  if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {
11740
- const nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
11854
+ const nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
11741
11855
  let lastIndex = nextSetResIndex + this.parent.getRows().length;
11742
11856
  if (lastIndex > args.count) {
11743
11857
  lastIndex = nextSetResIndex +
@@ -11746,7 +11860,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11746
11860
  this.startIndex = lastIndex - this.parent.getRows().length;
11747
11861
  this.endIndex = lastIndex;
11748
11862
  }
11749
- else {
11863
+ else if (this.parent.root.editSettings.newRowPosition !== 'Top' && this.parent.root.editModule.selectedIndex !== -1 || this.parent.root.editModule.selectedIndex !== -1) {
11750
11864
  this.startIndex += 1;
11751
11865
  this.endIndex += 1;
11752
11866
  }
@@ -11797,7 +11911,15 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11797
11911
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
11798
11912
  if (!isNullOrUndefined(e.count)) {
11799
11913
  this.totalRecords = e.count;
11800
- if (!this.parent.enableColumnVirtualization) {
11914
+ // To overcome the white space issue in last page when records collapsed
11915
+ if (this.parent.isFrozenGrid() && e.count < Object.keys(this.parent.dataSource).length) {
11916
+ const width = this.parent.enableColumnVirtualization ?
11917
+ this.getColumnOffset(this.parent.columns.length - 1) + 'px' : '100%';
11918
+ const height = (this.parent.getRowHeight() * e.count) -
11919
+ (this.parent.getRowHeight() * this.parent.pageSettings.pageSize);
11920
+ getValue('virtualEle', this).setVirtualHeight(height, width);
11921
+ }
11922
+ if (!this.parent.enableColumnVirtualization && !this.parent.isFrozenGrid()) {
11801
11923
  getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
11802
11924
  }
11803
11925
  }
@@ -11895,6 +12017,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11895
12017
  return new Cell(opt);
11896
12018
  }
11897
12019
  beginEdit(e) {
12020
+ this['editedRowIndex'] = e.index;
11898
12021
  const selector = '.e-row[data-rowindex="' + e.index + '"]';
11899
12022
  const index = this.parent.getContent().querySelector(selector).rowIndex;
11900
12023
  const rowData = this.parent.getCurrentViewRecords()[index];
@@ -11934,8 +12057,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11934
12057
  }
11935
12058
  virtualEditSuccess() {
11936
12059
  const isAdd = 'isAdd';
11937
- const content = this.parent.getContent().querySelector('.e-content');
11938
- if (this[isAdd] && content.querySelector('.e-addedrow')) {
12060
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12061
+ if (this[isAdd] && content$$1.querySelector('.e-addedrow')) {
11939
12062
  this.recordAdded = true;
11940
12063
  }
11941
12064
  }
@@ -11949,10 +12072,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11949
12072
  }
11950
12073
  restoreNewRow() {
11951
12074
  const isAdd = 'isAdd';
11952
- const content = this.parent.getContent().querySelector('.e-content');
11953
- if (this[isAdd] && !content.querySelector('.e-addedrow')) {
12075
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12076
+ if (this[isAdd] && !content$$1.querySelector('.e-addedrow')) {
11954
12077
  this.parent.isEdit = false;
11955
- this.parent.addRecord();
12078
+ this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
11956
12079
  }
11957
12080
  }
11958
12081
  getData(data) {
@@ -11965,7 +12088,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11965
12088
  this.parent.notify('get-row-position', addArgs);
11966
12089
  this.rowPosition = addArgs.newRowPosition;
11967
12090
  this.addRowIndex = addArgs.addRowIndex;
11968
- this.dataRowIndex = addArgs.dataRowIndex;
12091
+ this.dataRowIndex = this.parent.root.editModule.selectedIndex;
11969
12092
  }
11970
12093
  const actionComplete$$1 = 'actionComplete';
11971
12094
  super[actionComplete$$1](args);
@@ -11986,17 +12109,20 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11986
12109
  const maxLeft = this.vgenerator.cOffsets[idx - 1];
11987
12110
  x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
11988
12111
  }
11989
- this.virtualEle.adjustTable(x, this.translateY);
11990
- if (this.parent.enableColumnVirtualization) {
11991
- this.header.virtualEle.adjustTable(x, 0);
12112
+ if (!this.parent.isFrozenGrid()) {
12113
+ this.virtualEle.adjustTable(x, this.translateY);
12114
+ if (this.parent.enableColumnVirtualization) {
12115
+ this.header.virtualEle.adjustTable(x, 0);
12116
+ }
11992
12117
  }
11993
12118
  }
11994
12119
  };
11995
12120
  }
11996
12121
  scrollListeners(scrollArgs) {
12122
+ this['scrollAfterEdit']();
11997
12123
  const info = scrollArgs.sentinel;
11998
12124
  const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
11999
- const content = this.parent.getContent().querySelector('.e-content');
12125
+ const content$$1 = this.parent.getContent().querySelector('.e-content');
12000
12126
  const scrollHeight = outBuffer * this.parent.getRowHeight();
12001
12127
  const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
12002
12128
  const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
@@ -12006,7 +12132,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12006
12132
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12007
12133
  const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
12008
12134
  this.parent.element.getBoundingClientRect().height);
12009
- let index = (~~(content.scrollTop / this.parent.getRowHeight())
12135
+ let index = (~~(content$$1.scrollTop / this.parent.getRowHeight())
12010
12136
  + Math.ceil(vHeight / this.parent.getRowHeight()))
12011
12137
  - this.parent.pageSettings.pageSize;
12012
12138
  index = (index > 0) ? index : 0;
@@ -12021,7 +12147,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12021
12147
  this.endIndex = lastInx;
12022
12148
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
12023
12149
  }
12024
- if (currentViewData.length && ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12150
+ if (currentViewData.length && (currentViewData[0][indexValue] >= this.parent.pageSettings.pageSize / 2) &&
12151
+ ((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12025
12152
  this.startIndex = currentViewData[0][indexValue] - (this.parent.pageSettings.pageSize / 2);
12026
12153
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
12027
12154
  }
@@ -12050,7 +12177,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12050
12177
  }
12051
12178
  }
12052
12179
  else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12053
- let nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
12180
+ let nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
12054
12181
  const isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
12055
12182
  if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
12056
12183
  nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {
@@ -12068,7 +12195,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12068
12195
  this.startIndex = currentViewData[0][indexValue] + (this.parent.pageSettings.pageSize / 2);
12069
12196
  }
12070
12197
  if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {
12071
- this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
12198
+ this.translateY = this.getTranslateY(scrollArgs.offset.top, content$$1.getBoundingClientRect().height);
12072
12199
  }
12073
12200
  else {
12074
12201
  if (this.parent.allowRowDragAndDrop) {
@@ -12086,6 +12213,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12086
12213
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
12087
12214
  const page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
12088
12215
  this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
12216
+ this.requestType = 'virtualscroll';
12089
12217
  if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
12090
12218
  viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
12091
12219
  }
@@ -12093,12 +12221,28 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12093
12221
  }
12094
12222
  }
12095
12223
  appendContent(target, newChild, e) {
12224
+ const isFrozen = this.parent.isFrozenGrid();
12096
12225
  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)) {
12226
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || this.parent.isFrozenGrid()) {
12098
12227
  if (getValue('isExpandCollapse', e)) {
12099
12228
  this.isRemoteExpand = true;
12100
12229
  }
12230
+ if (isFrozen && isNullOrUndefined(this.requestType) && getValue('requestTypes', this).indexOf('isFrozen') === -1) {
12231
+ getValue('requestTypes', this).push('isFrozen');
12232
+ this.requestType = 'isFrozen';
12233
+ }
12101
12234
  super.appendContent(target, newChild, e);
12235
+ if (getValue('requestTypes', this).indexOf('isFrozen') !== -1) {
12236
+ getValue('requestTypes', this).splice(getValue('requestTypes', this).indexOf('isFrozen'), 1);
12237
+ this.requestType = this.requestType === 'isFrozen' ? undefined : this.requestType;
12238
+ }
12239
+ if (isFrozen && (!this.isExpandCollapse || this.translateY === 0)) {
12240
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
12241
+ getValue('virtualEle', this).adjustTable(0, this.translateY);
12242
+ }
12243
+ else {
12244
+ this.isExpandCollapse = false;
12245
+ }
12102
12246
  }
12103
12247
  else {
12104
12248
  const info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&
@@ -12184,6 +12328,11 @@ class TreeInterSectionObserver extends InterSectionObserver {
12184
12328
  const containerRect = 'containerRect';
12185
12329
  super[containerRect] = getValue('options', this).container.getBoundingClientRect();
12186
12330
  EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12331
+ if (getValue('options', this).movableContainer) {
12332
+ const movableContainerRect = 'movableContainerRect';
12333
+ super[movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
12334
+ EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
12335
+ }
12187
12336
  }
12188
12337
  clear() {
12189
12338
  this.lastPos = null;
@@ -12385,6 +12534,7 @@ class VirtualScroll$1 {
12385
12534
  }
12386
12535
  }
12387
12536
  this.expandCollapseRec = null;
12537
+ startIndex = startIndex < 0 ? 0 : startIndex;
12388
12538
  pageingDetails.result = visualData.slice(startIndex, endIndex);
12389
12539
  this.prevstartIndex = startIndex;
12390
12540
  this.prevendIndex = endIndex;
@@ -12414,12 +12564,14 @@ class TreeVirtual extends VirtualScroll {
12414
12564
  const parentGrid = getValue('parent', this);
12415
12565
  getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
12416
12566
  const renderer = getValue('locator', this).getService('rendererFactory');
12417
- if (parentGrid.enableColumnVirtualization) {
12567
+ if (!parentGrid.isFrozenGrid()) {
12568
+ if (parentGrid.enableColumnVirtualization) {
12569
+ getValue('addRenderer', renderer)
12570
+ .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12571
+ }
12418
12572
  getValue('addRenderer', renderer)
12419
- .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
12573
+ .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12420
12574
  }
12421
- getValue('addRenderer', renderer)
12422
- .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
12423
12575
  //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
12424
12576
  this.ensurePageSize();
12425
12577
  }
@@ -12438,6 +12590,138 @@ class TreeVirtual extends VirtualScroll {
12438
12590
  }
12439
12591
  }
12440
12592
 
12593
+ /**
12594
+ * VirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
12595
+ *
12596
+ * @hidden
12597
+ */
12598
+ class VirtualTreeFreezeRenderer extends VirtualFreezeRenderer {
12599
+ constructor(parent, locator) {
12600
+ super(parent, locator);
12601
+ this.addEventListener();
12602
+ }
12603
+ /**
12604
+ * @returns {void}
12605
+ * @hidden
12606
+ */
12607
+ renderTable() {
12608
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
12609
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
12610
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
12611
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
12612
+ FreezeContentRender.prototype.renderTable.call(this);
12613
+ this.virtualRenderer.setPanel(this.parent.getContent());
12614
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
12615
+ const movableCont = this.getMovableContent();
12616
+ const minHeight = this.parent.height;
12617
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
12618
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
12619
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
12620
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
12621
+ if (this.parent.enableColumnVirtualization) {
12622
+ this.virtualRenderer.virtualEle.movableContent = this.virtualRenderer.movableContent
12623
+ = this.getPanel().querySelector('.' + movableContent);
12624
+ this.virtualRenderer.virtualEle.renderMovableWrapper(minHeight);
12625
+ this.virtualRenderer.virtualEle.renderMovablePlaceHolder();
12626
+ const tbl = movableCont.querySelector('table');
12627
+ this.virtualRenderer.virtualEle.movableTable = tbl;
12628
+ this.virtualRenderer.virtualEle.movableWrapper.appendChild(tbl);
12629
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movableWrapper);
12630
+ movableCont.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder);
12631
+ }
12632
+ this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent());
12633
+ this.virtualRenderer.virtualEle.wrapper.appendChild(movableCont);
12634
+ this.virtualRenderer.virtualEle.table = this.getTable();
12635
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
12636
+ }
12637
+ /**
12638
+ * @param {HTMLElement} target - specifies the target
12639
+ * @param {DocumentFragment} newChild - specifies the newChild
12640
+ * @param {NotifyArgs} e - specifies the notifyargs
12641
+ * @returns {void}
12642
+ * @hidden
12643
+ */
12644
+ appendContent(target, newChild, e) {
12645
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
12646
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
12647
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
12648
+ super.appendContent(target, newChild, e);
12649
+ }
12650
+ /**
12651
+ * @param {Object[]} data - specifies the data
12652
+ * @param {NotifyArgs} e - specifies the notifyargs
12653
+ * @returns {Row<Column>[]} returns the row
12654
+ * @hidden
12655
+ */
12656
+ generateRows(data, e) {
12657
+ return super.generateRows(data, e);
12658
+ }
12659
+ }
12660
+ /**
12661
+ * ColumnVirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
12662
+ *
12663
+ * @hidden
12664
+ */
12665
+ class ColumnVirtualTreeFreezeRenderer extends ColumnVirtualFreezeRenderer {
12666
+ constructor(parent, locator) {
12667
+ super(parent, locator);
12668
+ this.serviceLoc = locator;
12669
+ this.eventListener('on');
12670
+ }
12671
+ /**
12672
+ * @returns {void}
12673
+ * @hidden
12674
+ */
12675
+ renderTable() {
12676
+ this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
12677
+ this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
12678
+ .getRenderer(RenderType.Header).virtualHdrRenderer;
12679
+ this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
12680
+ ColumnFreezeContentRenderer.prototype.renderTable.call(this);
12681
+ this.virtualRenderer.setPanel(this.parent.getContent());
12682
+ this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
12683
+ const frozenRightCont = this.getFrozenRightContent();
12684
+ let frzCont = this.getFrozenContent();
12685
+ const movableCont = this.getMovableContent();
12686
+ if (this.parent.getFrozenMode() === 'Right') {
12687
+ frzCont = frozenRightCont;
12688
+ }
12689
+ this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
12690
+ this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
12691
+ const minHeight = this.parent.height;
12692
+ this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
12693
+ this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
12694
+ super['renderVirtualFrozenLeft'](frzCont, movableCont);
12695
+ super['renderVirtualFrozenRight'](frzCont, movableCont);
12696
+ super['renderVirtualFrozenLeftRight'](frzCont, movableCont, frozenRightCont);
12697
+ this.virtualRenderer.virtualEle.table = this.getTable();
12698
+ setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
12699
+ }
12700
+ appendContent(target, newChild, e) {
12701
+ getValue('observer', this.virtualRenderer).options.debounceEvent = false;
12702
+ this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
12703
+ this.virtualRenderer['contents'] = this.getPanel().firstChild;
12704
+ super.appendContent(target, newChild, e);
12705
+ }
12706
+ }
12707
+ /**
12708
+ * VirtualTreeFreezeHdrRenderer is used to render the virtual table within the frozen and movable header table
12709
+ *
12710
+ * @hidden
12711
+ */
12712
+ class VirtualTreeFreezeHdrRenderer extends VirtualFreezeHdrRenderer {
12713
+ /**
12714
+ * @returns {void}
12715
+ * @hidden
12716
+ */
12717
+ renderTable() {
12718
+ super.renderTable();
12719
+ }
12720
+ rfshMovable() {
12721
+ super.rfshMovable();
12722
+ }
12723
+ }
12724
+
12441
12725
  /**
12442
12726
  * TreeGrid Freeze module
12443
12727
  *
@@ -12458,6 +12742,7 @@ class Freeze$1 {
12458
12742
  this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
12459
12743
  this.parent.on('dataBoundArg', this.dataBoundArg, this);
12460
12744
  this.parent.grid.on('dblclick', this.dblClickHandler, this);
12745
+ this.parent.grid.on('initial-load', this.instantiateRenderer, this);
12461
12746
  }
12462
12747
  removeEventListener() {
12463
12748
  if (this.parent.isDestroyed) {
@@ -12466,6 +12751,40 @@ class Freeze$1 {
12466
12751
  this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
12467
12752
  this.parent.off('dataBoundArg', this.dataBoundArg);
12468
12753
  this.parent.grid.off('dblclick', this.dblClickHandler);
12754
+ this.parent.grid.off('initial-load', this.instantiateRenderer);
12755
+ }
12756
+ instantiateRenderer() {
12757
+ const renderer = getValue('serviceLocator', this.parent.grid).getService('rendererFactory');
12758
+ if (this.parent.getFrozenColumns()) {
12759
+ if (this.parent.enableColumnVirtualization) {
12760
+ getValue('addRenderer', renderer)
12761
+ .apply(renderer, [RenderType.Header, new VirtualTreeFreezeHdrRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12762
+ }
12763
+ else {
12764
+ getValue('addRenderer', renderer)
12765
+ .apply(renderer, [RenderType.Header, new FreezeRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12766
+ }
12767
+ if (this.parent.enableVirtualization) {
12768
+ getValue('addRenderer', renderer)
12769
+ .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12770
+ }
12771
+ else {
12772
+ getValue('addRenderer', renderer)
12773
+ .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12774
+ }
12775
+ }
12776
+ if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
12777
+ getValue('addRenderer', renderer)
12778
+ .apply(renderer, [RenderType.Header, new ColumnFreezeHeaderRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12779
+ if (this.parent.enableVirtualization) {
12780
+ getValue('addRenderer', renderer)
12781
+ .apply(renderer, [RenderType.Content, new ColumnVirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12782
+ }
12783
+ else {
12784
+ getValue('addRenderer', renderer)
12785
+ .apply(renderer, [RenderType.Content, new ColumnFreezeContentRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
12786
+ }
12787
+ }
12469
12788
  }
12470
12789
  rowExpandCollapse(args) {
12471
12790
  const movableRows = this.parent.getMovableDataRows();
@@ -12506,7 +12825,7 @@ class Freeze$1 {
12506
12825
  }
12507
12826
  dblClickHandler(e) {
12508
12827
  if (parentsUntil(e.target, 'e-rowcell') &&
12509
- this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
12828
+ this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell' && (!e.target['classList'].contains('e-treegridcollapse') && !e.target['classList'].contains('e-treegridexpand'))) {
12510
12829
  this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
12511
12830
  }
12512
12831
  }
@@ -12912,5 +13231,5 @@ class InfiniteScroll$1 {
12912
13231
  * Export TreeGrid component
12913
13232
  */
12914
13233
 
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 };
13234
+ 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
13235
  //# sourceMappingURL=ej2-treegrid.es2015.js.map