@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.
@@ -1987,17 +1987,21 @@ var Render = /** @__PURE__ @class */ (function () {
1987
1987
  var cells = 'cells';
1988
1988
  var rowIdx = 'index';
1989
1989
  var rowsObj = _this.parent.grid.getRowsObject();
1990
+ var rows = _this.parent.getDataRows();
1990
1991
  var indent = _this.parent.grid.getIndentCount();
1991
1992
  var cellIndex = _this.parent.grid.getNormalizedColumnIndex(columnUid);
1992
- for (var j = 0; j < rowsObj.length; j++) {
1993
- if (rowsObj[parseInt(j.toString(), 10)].isDataRow && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
1994
- var cell = rowsObj[parseInt(j.toString(), 10)]["" + cells][parseInt(cellIndex.toString(), 10)];
1995
- var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
1996
- var td = _this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
1997
- cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)]["" + rowIdx] });
1998
- var treecell = _this.parent.getRows()[parseInt(j.toString(), 10)]
1999
- .cells[parseInt(cellIndex.toString(), 10)];
2000
- _this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
1993
+ if (rows.length !== 0) {
1994
+ for (var j = 0; j < rowsObj.length; j++) {
1995
+ if (rowsObj[parseInt(j.toString(), 10)].isDataRow
1996
+ && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
1997
+ var cell = rowsObj[parseInt(j.toString(), 10)]["" + cells][parseInt(cellIndex.toString(), 10)];
1998
+ var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
1999
+ var td = _this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
2000
+ cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)]["" + rowIdx] });
2001
+ var treecell = _this.parent.getRows()[parseInt(j.toString(), 10)]
2002
+ .cells[parseInt(cellIndex.toString(), 10)];
2003
+ _this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
2004
+ }
2001
2005
  }
2002
2006
  }
2003
2007
  });
@@ -7188,7 +7192,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7188
7192
  }
7189
7193
  };
7190
7194
  TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {
7191
- if (!isChild) {
7195
+ if (!isNullOrUndefined(isChild) && !isChild && !this.loadChildOnDemand) {
7192
7196
  rowDetails.record.expanded = false;
7193
7197
  }
7194
7198
  var rows = rowDetails.rows;
@@ -7855,7 +7859,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7855
7859
  Property(false)
7856
7860
  ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
7857
7861
  __decorate([
7858
- Property(true)
7862
+ Property(false)
7859
7863
  ], TreeGrid.prototype, "enableHtmlSanitizer", void 0);
7860
7864
  __decorate([
7861
7865
  Property(false)
@@ -9686,7 +9690,8 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
9686
9690
  var rows = _super.prototype.generateRows.call(this, data, notifyArgs);
9687
9691
  if (!isNullOrUndefined((this.visualData))) {
9688
9692
  for (var r = 0; r < rows.length; r++) {
9689
- rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9693
+ rows[parseInt(r.toString(), 10)].index =
9694
+ (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9690
9695
  }
9691
9696
  }
9692
9697
  return rows;
@@ -13451,13 +13456,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13451
13456
  firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
13452
13457
  }
13453
13458
  if (firsttdinx === 0) {
13454
- scrollArgs.offset.top = content$$1.scrollTop;
13455
- if (this.parent.allowRowDragAndDrop) {
13456
- this.translateY = scrollArgs.offset.top - rowHeight * 2;
13457
- }
13458
- else {
13459
- this.translateY = scrollArgs.offset.top;
13460
- }
13459
+ this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
13460
+ scrollArgs.offset.top - (outBuffer * this.parent.getRowHeight()) + 10 : 0;
13461
13461
  }
13462
13462
  else {
13463
13463
  this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?