@syncfusion/ej2-treegrid 26.1.41 → 26.1.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.
@@ -1888,6 +1888,7 @@ class DataManipulation {
1888
1888
  this.hierarchyData = [];
1889
1889
  this.storedIndex = -1;
1890
1890
  this.sortedData = [];
1891
+ this.preCurrentPage = -1;
1891
1892
  this.isSortAction = false;
1892
1893
  this.addEventListener();
1893
1894
  this.dataResults = {};
@@ -2211,7 +2212,7 @@ class DataManipulation {
2211
2212
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
2212
2213
  }
2213
2214
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2214
- qry.take(this.parent.pageSettings.pageSize);
2215
+ qry.take(this.parent.grid.pageSettings.pageSize);
2215
2216
  const expandDetail = [];
2216
2217
  expandDetail.push('ExpandingAction', idMappingValue.toString());
2217
2218
  qry.expand(expandDetail);
@@ -2399,6 +2400,17 @@ class DataManipulation {
2399
2400
  }
2400
2401
  datas.splice(inx + r + 1, 0, result[parseInt(r.toString(), 10)]);
2401
2402
  }
2403
+ if (datas.length > result.length &&
2404
+ datas.length !== this.parent.grid.pageSettings.pageSize + (this.parent.grid.contentModule).getBlockSize() &&
2405
+ this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2406
+ if ((this.preCurrentPage > 1 || this.parent.grid.pageSettings.currentPage > 1)) {
2407
+ datas = datas.slice(0, this.parent.grid.pageSettings.pageSize + (this.parent.grid.contentModule).getBlockSize());
2408
+ }
2409
+ else {
2410
+ datas = datas.slice(0, this.parent.grid.pageSettings.pageSize);
2411
+ }
2412
+ this.preCurrentPage = this.parent.grid.pageSettings.currentPage;
2413
+ }
2402
2414
  setValue('result', datas, e);
2403
2415
  setValue('action', 'beforecontentrender', e);
2404
2416
  this.parent.trigger(actionComplete, e);
@@ -4234,7 +4246,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4234
4246
  || (/[0-9]$/.test(this.height.toString()) && /[px]$/.test(this.height.toString()))) {
4235
4247
  failureCases.push('column width and height should be in pixels');
4236
4248
  }
4237
- if (!isNullOrUndefined(this.childMapping) && !isNullOrUndefined(this.idMapping)) {
4249
+ if ((this.childMapping !== 'Children') && !isNullOrUndefined(this.idMapping)) {
4238
4250
  failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
4239
4251
  }
4240
4252
  if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
@@ -9536,7 +9548,13 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9536
9548
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
9537
9549
  this.cache[parseInt(currentPage.toString(), 10)].length >
9538
9550
  (this.parent.contentModule).getBlockSize()) {
9539
- delete this.cache[parseInt(currentPage.toString(), 10)];
9551
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
9552
+ this.cache[parseInt(currentPage.toString(), 10)] =
9553
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
9554
+ }
9555
+ else {
9556
+ delete this.cache[parseInt(currentPage.toString(), 10)];
9557
+ }
9540
9558
  }
9541
9559
  }
9542
9560
  else {