@syncfusion/ej2-treegrid 34.1.32 → 34.1.33

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.
@@ -8039,15 +8039,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8039
8039
  localExpand(action, row, record) {
8040
8040
  let rows;
8041
8041
  const detailRow = row.nextElementSibling ? row.nextElementSibling.classList.contains('e-detailrow') ? row.nextElementSibling : null : null;
8042
- let childRecords;
8043
- if (this.enableInfiniteScrolling) {
8044
- childRecords = this.grid.getRowsObject().filter((e) => { return e.data.parentUniqueID === record.uniqueID; });
8045
- }
8046
- else {
8047
- childRecords = this.grid.currentViewData.filter((e) => {
8048
- return e.parentUniqueID === record.uniqueID;
8049
- });
8050
- }
8042
+ const childRecords = this.grid.currentViewData.filter((e) => {
8043
+ return e.parentUniqueID === record.uniqueID;
8044
+ });
8051
8045
  if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {
8052
8046
  this.lastRowBorder(row, false);
8053
8047
  }
@@ -8121,11 +8115,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8121
8115
  this.toggleRowVisibility(freezeRightRows[parseInt(i.toString(), 10)], displayAction);
8122
8116
  }
8123
8117
  this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });
8124
- if ((!isNullOrUndefined(childRecords)) && (!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||
8125
- isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {
8126
- this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8118
+ const childRecord = !isNullOrUndefined(childRecords) ? childRecords[parseInt(i.toString(), 10)] : undefined;
8119
+ if (childRecord && (childRecord.childRecords && childRecord.childRecords.length > 0) && (action !== 'expand' ||
8120
+ isNullOrUndefined(childRecord.expanded) || childRecord.expanded)) {
8121
+ this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecord, true);
8127
8122
  if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {
8128
- this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8123
+ this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecord, true);
8129
8124
  }
8130
8125
  }
8131
8126
  }
@@ -16589,7 +16584,8 @@ class InfiniteScroll {
16589
16584
  const previousPage = this.parent.grid.pageSettings.currentPage;
16590
16585
  const nextPage = Math.ceil(index / this.parent.grid.pageSettings.pageSize) + 1;
16591
16586
  const totalVisibleCount = this.visualData ? this.visualData.length : 0;
16592
- if ((previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
16587
+ if ((totalVisibleCount > 0 && (index + 1) >= totalVisibleCount) ||
16588
+ (previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
16593
16589
  return;
16594
16590
  }
16595
16591
  this.parent.grid.pageSettings.currentPage = nextPage;
@@ -16672,6 +16668,7 @@ class InfiniteScroll {
16672
16668
  const initial = actions.some((value) => { return value === actionArgs.requestType; });
16673
16669
  const initialRender = initial ? true : this.parent.initialRender ? true : false;
16674
16670
  this.visualData = visualData;
16671
+ this.maxPage = Math.ceil(visualData.length / this.parent.pageSettings.pageSize);
16675
16672
  pageingDetails.count = visualData.length;
16676
16673
  if (getValue('isPrinting', pageingDetails.actionArgs)) {
16677
16674
  pageingDetails.result = visualData;