@syncfusion/ej2-treegrid 21.1.38 → 21.2.3

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.
@@ -1637,10 +1637,12 @@ var Render = /** @__PURE__ @class */ (function () {
1637
1637
  var collapsed$$1 = (this.parent.initialRender && (!(isNullOrUndefined(parentData[this.parent.expandStateMapping]) ||
1638
1638
  parentData[this.parent.expandStateMapping]) || this.parent.enableCollapseAll)) ||
1639
1639
  !getExpandStatus(this.parent, args.data, this.parent.grid.getCurrentViewRecords());
1640
- if (collapsed$$1) {
1640
+ if (collapsed$$1 && !isNullOrUndefined(args.row)) {
1641
1641
  args.row.style.display = 'none';
1642
1642
  var rowsObj = this.parent.grid.getRowsObject();
1643
- rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0].visible = false;
1643
+ if (!isNullOrUndefined(args.row.getAttribute('data-uid'))) {
1644
+ rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0].visible = false;
1645
+ }
1644
1646
  }
1645
1647
  }
1646
1648
  if (isRemoteData(this.parent) && !isOffline(this.parent)) {
@@ -1648,7 +1650,7 @@ var Render = /** @__PURE__ @class */ (function () {
1648
1650
  var parentrec = this.parent.getCurrentViewRecords().filter(function (rec) {
1649
1651
  return getValue(proxy_1.idMapping, rec) === getValue(proxy_1.parentIdMapping, data);
1650
1652
  });
1651
- if (parentrec.length > 0 && !parentrec[0].isSummaryRow) {
1653
+ if (parentrec.length > 0 && !parentrec[0].isSummaryRow && !isNullOrUndefined(args.row)) {
1652
1654
  var display = parentrec[0].expanded ? 'table-row' : 'none';
1653
1655
  args.row.setAttribute('style', 'display: ' + display + ';');
1654
1656
  }
@@ -1658,20 +1660,23 @@ var Render = /** @__PURE__ @class */ (function () {
1658
1660
  if (summaryRow) {
1659
1661
  addClass([args.row], 'e-summaryrow');
1660
1662
  }
1661
- if (args.row.querySelector('.e-treegridexpand')) {
1662
- args.row.setAttribute('aria-expanded', 'true');
1663
- }
1664
- else if (args.row.querySelector('.e-treegridcollapse')) {
1665
- args.row.setAttribute('aria-expanded', 'false');
1666
- }
1667
- if (this.parent.enableCollapseAll && this.parent.initialRender) {
1668
- if (!isNullOrUndefined(data.parentItem)) {
1669
- args.row.style.display = 'none';
1663
+ if (!isNullOrUndefined(args.row)) {
1664
+ if (args.row.querySelector('.e-treegridexpand')) {
1665
+ args.row.setAttribute('aria-expanded', 'true');
1666
+ }
1667
+ else if (args.row.querySelector('.e-treegridcollapse')) {
1668
+ args.row.setAttribute('aria-expanded', 'false');
1669
+ }
1670
+ if (this.parent.enableCollapseAll && this.parent.initialRender) {
1671
+ if (!isNullOrUndefined(data.parentItem)) {
1672
+ args.row.style.display = 'none';
1673
+ }
1670
1674
  }
1671
1675
  }
1676
+ var dragStartData = 'dragStartData';
1672
1677
  var draggedRecord = 'draggedRecord';
1673
- if (!isNullOrUndefined(this.parent.rowDragAndDropModule) && !isNullOrUndefined(this.parent.rowDragAndDropModule["" + draggedRecord])
1674
- && this.parent.getContentTable().scrollHeight <= this.parent.getContent().clientHeight) {
1678
+ if (this.parent.rowDragAndDropModule && this.parent.grid.rowDragAndDropModule && (this.parent.grid.rowDragAndDropModule["" + dragStartData] ||
1679
+ this.parent.rowDragAndDropModule["" + draggedRecord]) && this.parent.getContentTable().scrollHeight <= this.parent.getContent().clientHeight) {
1675
1680
  var lastRowBorder = 'lastRowBorder';
1676
1681
  var lastVisualData = this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length - 1];
1677
1682
  if (lastVisualData.uniqueID === args.data.uniqueID && !isNullOrUndefined(args.row) && !args.row.cells[0].classList.contains('e-lastrowcell')) {
@@ -4557,7 +4562,25 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4557
4562
  };
4558
4563
  };
4559
4564
  TreeGrid.prototype.updateRowTemplate = function () {
4560
- this.treeColumnRowTemplate();
4565
+ var _this = this;
4566
+ if (this.rowTemplate) {
4567
+ if (this.isReact && this.getContentTable().rows.length === 0) {
4568
+ setTimeout(function () {
4569
+ _this.treeColumnRowTemplate();
4570
+ if (_this.enableCollapseAll) {
4571
+ var currentData = _this.getCurrentViewRecords();
4572
+ var rows = _this.getContentTable().rows;
4573
+ for (var i = 0; i < rows.length; i++) {
4574
+ var args = { data: currentData[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)] };
4575
+ _this.renderModule.RowModifier(args);
4576
+ }
4577
+ }
4578
+ }, 0);
4579
+ }
4580
+ else {
4581
+ this.treeColumnRowTemplate();
4582
+ }
4583
+ }
4561
4584
  };
4562
4585
  TreeGrid.prototype.bindedDataSource = function () {
4563
4586
  var dataSource = 'dataSource';
@@ -6730,17 +6753,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6730
6753
  }
6731
6754
  };
6732
6755
  TreeGrid.prototype.treeColumnRowTemplate = function () {
6733
- if (this.rowTemplate) {
6734
- var rows = this.getContentTable().rows;
6735
- rows = [].slice.call(rows);
6736
- for (var i = 0; i < rows.length; i++) {
6737
- var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
6738
- .cells[this.treeColumnIndex];
6739
- var row = rows[parseInt(i.toString(), 10)];
6740
- var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
6741
- var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
6742
- this.renderModule.cellRender(arg);
6743
- }
6756
+ var rows = this.getContentTable().rows;
6757
+ rows = [].slice.call(rows);
6758
+ for (var i = 0; i < rows.length; i++) {
6759
+ var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
6760
+ .cells[this.treeColumnIndex];
6761
+ var row = rows[parseInt(i.toString(), 10)];
6762
+ var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
6763
+ var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
6764
+ this.renderModule.cellRender(arg);
6744
6765
  }
6745
6766
  };
6746
6767
  TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {