@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.
@@ -3957,6 +3957,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3957
3957
  }
3958
3958
  }
3959
3959
  }
3960
+ var action = 'action';
3961
+ if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {
3962
+ var refreshPersistSelection = 'refreshPersistSelection';
3963
+ _this.grid.selectionModule[refreshPersistSelection]();
3964
+ if (_this.grid.selectionSettings.type === 'Single') {
3965
+ var updateRowSelection = 'updateRowSelection';
3966
+ var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);
3967
+ _this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);
3968
+ }
3969
+ }
3960
3970
  _this.trigger(dataBound, args);
3961
3971
  _this.initialRender = false;
3962
3972
  };
@@ -5191,7 +5201,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5191
5201
  gridColumn[prop] = gridColumns[i][prop];
5192
5202
  }
5193
5203
  this.columnModel.push(new Column(gridColumn));
5194
- if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
5204
+ if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
5195
5205
  this.columnModel[i].template = temp;
5196
5206
  }
5197
5207
  }
@@ -8227,10 +8237,12 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8227
8237
  return _super.prototype.getData.call(this);
8228
8238
  };
8229
8239
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
8230
- if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
8240
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
8241
+ notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
8231
8242
  this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
8232
8243
  }
8233
- else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
8244
+ else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
8245
+ notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
8234
8246
  this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
8235
8247
  }
8236
8248
  var info = this.getDataInfo();
@@ -8687,9 +8699,9 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
8687
8699
  if (excelRow.type === 'excel') {
8688
8700
  var excelrowobj = excelRow.rowObj.data;
8689
8701
  var filtercolumnlength = this.parent.grid.filterSettings.columns.length;
8702
+ var rowlength = excelRow.excelRows.length;
8703
+ var rowlevel = excelrowobj.level;
8690
8704
  if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {
8691
- var rowlength = excelRow.excelRows.length;
8692
- var rowlevel = excelrowobj.level;
8693
8705
  var expandedStatus = false;
8694
8706
  var sublevelState = false;
8695
8707
  var state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);
@@ -8700,6 +8712,9 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
8700
8712
  excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,
8701
8713
  isHidden: expandedStatus };
8702
8714
  }
8715
+ else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {
8716
+ excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };
8717
+ }
8703
8718
  }
8704
8719
  };
8705
8720
  /* eslint-disable-next-line */
@@ -11844,6 +11859,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
11844
11859
  var replace = 'replaceWith';
11845
11860
  this.getTable().querySelector('tbody')[replace](target);
11846
11861
  if (!this.isExpandCollapse || this.translateY === 0) {
11862
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
11847
11863
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
11848
11864
  }
11849
11865
  else {
@@ -12055,7 +12071,10 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
12055
12071
  record: row.record,
12056
12072
  count: this.parent.flatData.length
12057
12073
  };
12058
- this.parent.grid.clearSelection();
12074
+ if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
12075
+ this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
12076
+ this.parent.grid.clearSelection();
12077
+ }
12059
12078
  var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
12060
12079
  getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
12061
12080
  };