@syncfusion/ej2-treegrid 33.2.10 → 33.2.12

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.
@@ -15469,6 +15469,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
15469
15469
  this.parent.root.scrollPosition = scrollArgs.offset;
15470
15470
  }
15471
15471
  const info = scrollArgs.sentinel;
15472
+ let treeGridParent = null;
15473
+ if (this.parent.clipboardModule && this.parent.clipboardModule['treeGridParent']) {
15474
+ treeGridParent = this.parent.clipboardModule['treeGridParent'];
15475
+ }
15472
15476
  const rowHeight = parseInt(this.parent.getRowHeight().toString(), 10);
15473
15477
  const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
15474
15478
  let content;
@@ -15546,7 +15550,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
15546
15550
  else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
15547
15551
  let nextSetResIndex = ~~(content.scrollTop / rowHeight);
15548
15552
  const isLastBlock = (this[`${selectedRowIndex}`] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
15549
- if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 &&
15553
+ if (treeGridParent !== null && treeGridParent.isGantt && !isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 &&
15550
15554
  nextSetResIndex !== this[`${selectedRowIndex}`] && !isLastBlock && !this.parent.allowRowDragAndDrop) {
15551
15555
  nextSetResIndex = this[`${selectedRowIndex}`];
15552
15556
  }
@@ -15657,6 +15661,15 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
15657
15661
  * @returns {void}
15658
15662
  */
15659
15663
  appendContent(target, newChild, e) {
15664
+ let treeGridParent = null;
15665
+ if (this.parent.clipboardModule && this.parent.clipboardModule['treeGridParent']) {
15666
+ treeGridParent = this.parent.clipboardModule['treeGridParent'];
15667
+ }
15668
+ const totalBlocks = this.getTotalBlocks();
15669
+ const lastPage = Math.ceil(totalBlocks / 2);
15670
+ const isBottom = (this.parent.pageSettings.currentPage === lastPage) &&
15671
+ (treeGridParent && treeGridParent.flatData &&
15672
+ treeGridParent.flatData.length === e.index + 1);
15660
15673
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
15661
15674
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
15662
15675
  || (this.parent.isFrozenGrid() && (e.requestType === undefined || !isNullOrUndefined(e.virtualInfo) && (e.virtualInfo.direction === 'right' || e.virtualInfo.direction === 'left')))) {
@@ -15741,6 +15754,14 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
15741
15754
  }
15742
15755
  }
15743
15756
  }
15757
+ if ((treeGridParent !== null && !treeGridParent.isGantt) && e.action === 'add' && isBottom) {
15758
+ const rowHeight = this.parent.getRowHeight();
15759
+ const pageSize = this.parent.pageSettings.pageSize;
15760
+ const newTranslateY = (this.totalRecords * rowHeight) - (pageSize * rowHeight);
15761
+ this.translateY = newTranslateY > 0 ? newTranslateY : this.translateY;
15762
+ this.virtualEle.adjustTable(cOffset, this.translateY);
15763
+ this.content.scrollTop = this.translateY;
15764
+ }
15744
15765
  this.restoreEditState();
15745
15766
  super[`${restoreAdd}`]();
15746
15767
  super[`${ensureSelectedRowPosition}`]();