@syncfusion/ej2-treegrid 26.1.40 → 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.
@@ -2047,6 +2047,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2047
2047
  this.hierarchyData = [];
2048
2048
  this.storedIndex = -1;
2049
2049
  this.sortedData = [];
2050
+ this.preCurrentPage = -1;
2050
2051
  this.isSortAction = false;
2051
2052
  this.addEventListener();
2052
2053
  this.dataResults = {};
@@ -2378,7 +2379,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2378
2379
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
2379
2380
  }
2380
2381
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2381
- qry.take(this.parent.pageSettings.pageSize);
2382
+ qry.take(this.parent.grid.pageSettings.pageSize);
2382
2383
  var expandDetail = [];
2383
2384
  expandDetail.push('ExpandingAction', idMappingValue.toString());
2384
2385
  qry.expand(expandDetail);
@@ -2566,6 +2567,17 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2566
2567
  }
2567
2568
  datas.splice(inx + r + 1, 0, result[parseInt(r.toString(), 10)]);
2568
2569
  }
2570
+ if (datas.length > result.length &&
2571
+ datas.length !== _this.parent.grid.pageSettings.pageSize + (_this.parent.grid.contentModule).getBlockSize() &&
2572
+ _this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2573
+ if ((_this.preCurrentPage > 1 || _this.parent.grid.pageSettings.currentPage > 1)) {
2574
+ datas = datas.slice(0, _this.parent.grid.pageSettings.pageSize + (_this.parent.grid.contentModule).getBlockSize());
2575
+ }
2576
+ else {
2577
+ datas = datas.slice(0, _this.parent.grid.pageSettings.pageSize);
2578
+ }
2579
+ _this.preCurrentPage = _this.parent.grid.pageSettings.currentPage;
2580
+ }
2569
2581
  setValue('result', datas, e);
2570
2582
  setValue('action', 'beforecontentrender', e);
2571
2583
  _this.parent.trigger(actionComplete, e);
@@ -3467,7 +3479,7 @@ function removeChildRecords(childRecords, modifiedData, action, key, control, is
3467
3479
  editedData.taskData[keys[parseInt(i.toString(), 10)]] =
3468
3480
  childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
3469
3481
  modifiedData[keys[parseInt(i.toString(), 10)]];
3470
- if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell') {
3482
+ if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
3471
3483
  var editModule = 'editModule';
3472
3484
  control.grid.editModule["" + editModule].editRowIndex = modifiedData.index;
3473
3485
  control.grid.editModule["" + editModule].updateCurrentViewData(modifiedData);
@@ -4526,7 +4538,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4526
4538
  || (/[0-9]$/.test(this.height.toString()) && /[px]$/.test(this.height.toString()))) {
4527
4539
  failureCases.push('column width and height should be in pixels');
4528
4540
  }
4529
- if (!isNullOrUndefined(this.childMapping) && !isNullOrUndefined(this.idMapping)) {
4541
+ if ((this.childMapping !== 'Children') && !isNullOrUndefined(this.idMapping)) {
4530
4542
  failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
4531
4543
  }
4532
4544
  if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
@@ -9349,7 +9361,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
9349
9361
  var _loop_1 = function (i) {
9350
9362
  draggedRecord_2 = dragRecords[parseInt(i.toString(), 10)];
9351
9363
  this_1.draggedRecord = draggedRecord_2;
9352
- if (this_1.dropPosition !== 'Invalid') {
9364
+ if (this_1.dropPosition !== 'Invalid' && !isNullOrUndefined(this_1.droppedRecord)) {
9353
9365
  if (!tObj.rowDropSettings.targetID || isByMethod) {
9354
9366
  this_1.deleteDragRow();
9355
9367
  }
@@ -9914,7 +9926,13 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
9914
9926
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
9915
9927
  this.cache[parseInt(currentPage.toString(), 10)].length >
9916
9928
  (this.parent.contentModule).getBlockSize()) {
9917
- delete this.cache[parseInt(currentPage.toString(), 10)];
9929
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
9930
+ this.cache[parseInt(currentPage.toString(), 10)] =
9931
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
9932
+ }
9933
+ else {
9934
+ delete this.cache[parseInt(currentPage.toString(), 10)];
9935
+ }
9918
9936
  }
9919
9937
  }
9920
9938
  else {