@syncfusion/ej2-treegrid 25.1.37 → 25.1.38

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,20 @@ 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 && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {
1838
+ const cell = rowsObj[parseInt(j.toString(), 10)][`${cells}`][parseInt(cellIndex.toString(), 10)];
1839
+ const cellRenderer = new CellRenderer(this.parent.grid, this.parent.grid.serviceLocator);
1840
+ const td = this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);
1841
+ cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)][`${rowIdx}`] });
1842
+ const treecell = this.parent.getRows()[parseInt(j.toString(), 10)]
1843
+ .cells[parseInt(cellIndex.toString(), 10)];
1844
+ this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });
1845
+ }
1843
1846
  }
1844
1847
  }
1845
1848
  });