@syncfusion/ej2-treegrid 19.4.41 → 19.4.42

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.
@@ -3709,6 +3709,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3709
3709
  }
3710
3710
  }
3711
3711
  }
3712
+ const action = 'action';
3713
+ if (this.enableVirtualization && this.selectionSettings.persistSelection && (this.dataResults[action] === 'expand' || this.dataResults[action] === 'collapse')) {
3714
+ const refreshPersistSelection = 'refreshPersistSelection';
3715
+ this.grid.selectionModule[refreshPersistSelection]();
3716
+ if (this.grid.selectionSettings.type === 'Single') {
3717
+ const updateRowSelection = 'updateRowSelection';
3718
+ const index = this.getCurrentViewRecords().indexOf(this.grid.selectionModule['data']);
3719
+ this.grid.selectionModule[updateRowSelection](this.getRows()[index], index);
3720
+ }
3721
+ }
3712
3722
  this.trigger(dataBound, args);
3713
3723
  this.initialRender = false;
3714
3724
  };
@@ -4933,7 +4943,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4933
4943
  gridColumn[prop] = gridColumns[i][prop];
4934
4944
  }
4935
4945
  this.columnModel.push(new Column(gridColumn));
4936
- if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
4946
+ if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
4937
4947
  this.columnModel[i].template = temp;
4938
4948
  }
4939
4949
  }
@@ -7898,10 +7908,12 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
7898
7908
  return super.getData();
7899
7909
  }
7900
7910
  generateRows(data, notifyArgs) {
7901
- if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
7911
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
7912
+ notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
7902
7913
  this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
7903
7914
  }
7904
- else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
7915
+ else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
7916
+ notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
7905
7917
  this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
7906
7918
  }
7907
7919
  const info = this.getDataInfo();
@@ -8355,9 +8367,9 @@ class ExcelExport$1 {
8355
8367
  if (excelRow.type === 'excel') {
8356
8368
  const excelrowobj = excelRow.rowObj.data;
8357
8369
  const filtercolumnlength = this.parent.grid.filterSettings.columns.length;
8370
+ const rowlength = excelRow.excelRows.length;
8371
+ const rowlevel = excelrowobj.level;
8358
8372
  if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {
8359
- const rowlength = excelRow.excelRows.length;
8360
- const rowlevel = excelrowobj.level;
8361
8373
  let expandedStatus = false;
8362
8374
  let sublevelState = false;
8363
8375
  const state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);
@@ -8368,6 +8380,9 @@ class ExcelExport$1 {
8368
8380
  excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,
8369
8381
  isHidden: expandedStatus };
8370
8382
  }
8383
+ else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {
8384
+ excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };
8385
+ }
8371
8386
  }
8372
8387
  }
8373
8388
  /* eslint-disable-next-line */
@@ -11465,6 +11480,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11465
11480
  const replace = 'replaceWith';
11466
11481
  this.getTable().querySelector('tbody')[replace](target);
11467
11482
  if (!this.isExpandCollapse || this.translateY === 0) {
11483
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
11468
11484
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
11469
11485
  }
11470
11486
  else {
@@ -11658,7 +11674,10 @@ class VirtualScroll$1 {
11658
11674
  record: row.record,
11659
11675
  count: this.parent.flatData.length
11660
11676
  };
11661
- this.parent.grid.clearSelection();
11677
+ if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
11678
+ this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
11679
+ this.parent.grid.clearSelection();
11680
+ }
11662
11681
  const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
11663
11682
  getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
11664
11683
  }