@syncfusion/ej2-treegrid 21.1.41 → 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,15 +1660,17 @@ 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
  }
1672
1676
  var dragStartData = 'dragStartData';
@@ -4558,7 +4562,25 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4558
4562
  };
4559
4563
  };
4560
4564
  TreeGrid.prototype.updateRowTemplate = function () {
4561
- 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
+ }
4562
4584
  };
4563
4585
  TreeGrid.prototype.bindedDataSource = function () {
4564
4586
  var dataSource = 'dataSource';
@@ -4601,25 +4623,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4601
4623
  if (requestType === 'reorder') {
4602
4624
  _this.notify('getColumnIndex', {});
4603
4625
  }
4604
- if (requestType === 'filterbeforeopen' && args.columnName && _this.filterSettings.hierarchyMode !== 'None') {
4605
- for (var j = 0; j < _this.columns.length; j++) {
4606
- var fields = 'field';
4607
- if (_this.columns[parseInt(j.toString(), 10)]["" + fields] === args.columnName) {
4608
- var taskFields = [];
4609
- for (var i = 0; i < _this.grid.currentViewData.length; i++) {
4610
- var fieldValue = _this.grid.currentViewData[parseInt(i.toString(), 10)][args.columnName];
4611
- if (taskFields.indexOf(fieldValue) === -1) {
4612
- taskFields.push(fieldValue);
4613
- }
4614
- }
4615
- args['filterModel'].options.dataSource = taskFields.map(function (name) {
4616
- var _a;
4617
- return (_a = {}, _a[args.columnName] = name, _a);
4618
- });
4619
- args['filterModel'].options.filteredColumns = args['filterModel'].options.filteredColumns.filter(function (col) { return col.field === args.columnName; });
4620
- }
4621
- }
4622
- }
4623
4626
  if (isRemoteData(_this) && _this.enableVirtualization) {
4624
4627
  if (args.requestType === 'virtualscroll') {
4625
4628
  _this.query.expand('VirtualScrollingAction');
@@ -6750,17 +6753,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6750
6753
  }
6751
6754
  };
6752
6755
  TreeGrid.prototype.treeColumnRowTemplate = function () {
6753
- if (this.rowTemplate) {
6754
- var rows = this.getContentTable().rows;
6755
- rows = [].slice.call(rows);
6756
- for (var i = 0; i < rows.length; i++) {
6757
- var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
6758
- .cells[this.treeColumnIndex];
6759
- var row = rows[parseInt(i.toString(), 10)];
6760
- var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
6761
- var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
6762
- this.renderModule.cellRender(arg);
6763
- }
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);
6764
6765
  }
6765
6766
  };
6766
6767
  TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {