@syncfusion/ej2-treegrid 25.1.37 → 25.1.39

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.
@@ -1829,17 +1829,21 @@ class Render {
1829
1829
  const cells = 'cells';
1830
1830
  const rowIdx = 'index';
1831
1831
  const rowsObj = this.parent.grid.getRowsObject();
1832
+ const rows = this.parent.getDataRows();
1832
1833
  const indent = this.parent.grid.getIndentCount();
1833
1834
  const cellIndex = this.parent.grid.getNormalizedColumnIndex(columnUid);
1834
- for (let j = 0; j < rowsObj.length; j++) {
1835
- if (rowsObj[parseInt(j.toString(), 10)].isDataRow && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
1836
- const cell = rowsObj[parseInt(j.toString(), 10)][`${cells}`][parseInt(cellIndex.toString(), 10)];
1837
- const cellRenderer = new CellRenderer(this.parent.grid, this.parent.grid.serviceLocator);
1838
- const td = this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
1839
- cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)][`${rowIdx}`] });
1840
- const treecell = this.parent.getRows()[parseInt(j.toString(), 10)]
1841
- .cells[parseInt(cellIndex.toString(), 10)];
1842
- this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
1835
+ if (rows.length !== 0) {
1836
+ for (let j = 0; j < rowsObj.length; j++) {
1837
+ if (rowsObj[parseInt(j.toString(), 10)].isDataRow
1838
+ && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
1839
+ const cell = rowsObj[parseInt(j.toString(), 10)][`${cells}`][parseInt(cellIndex.toString(), 10)];
1840
+ const cellRenderer = new CellRenderer(this.parent.grid, this.parent.grid.serviceLocator);
1841
+ const td = this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
1842
+ cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)][`${rowIdx}`] });
1843
+ const treecell = this.parent.getRows()[parseInt(j.toString(), 10)]
1844
+ .cells[parseInt(cellIndex.toString(), 10)];
1845
+ this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
1846
+ }
1843
1847
  }
1844
1848
  }
1845
1849
  });
@@ -6859,7 +6863,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6859
6863
  }
6860
6864
  }
6861
6865
  collapseRemoteChild(rowDetails, isChild) {
6862
- if (!isChild) {
6866
+ if (!isNullOrUndefined(isChild) && !isChild && !this.loadChildOnDemand) {
6863
6867
  rowDetails.record.expanded = false;
6864
6868
  }
6865
6869
  const rows = rowDetails.rows;
@@ -7522,7 +7526,7 @@ __decorate([
7522
7526
  Property(false)
7523
7527
  ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
7524
7528
  __decorate([
7525
- Property(true)
7529
+ Property(false)
7526
7530
  ], TreeGrid.prototype, "enableHtmlSanitizer", void 0);
7527
7531
  __decorate([
7528
7532
  Property(false)
@@ -9309,7 +9313,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9309
9313
  const rows = super.generateRows(data, notifyArgs);
9310
9314
  if (!isNullOrUndefined((this.visualData))) {
9311
9315
  for (let r = 0; r < rows.length; r++) {
9312
- rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9316
+ rows[parseInt(r.toString(), 10)].index =
9317
+ (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9313
9318
  }
9314
9319
  }
9315
9320
  return rows;
@@ -13022,13 +13027,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13022
13027
  firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
13023
13028
  }
13024
13029
  if (firsttdinx === 0) {
13025
- scrollArgs.offset.top = content$$1.scrollTop;
13026
- if (this.parent.allowRowDragAndDrop) {
13027
- this.translateY = scrollArgs.offset.top - rowHeight * 2;
13028
- }
13029
- else {
13030
- this.translateY = scrollArgs.offset.top;
13031
- }
13030
+ this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
13031
+ scrollArgs.offset.top - (outBuffer * this.parent.getRowHeight()) + 10 : 0;
13032
13032
  }
13033
13033
  else {
13034
13034
  this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?