@syncfusion/ej2-treegrid 21.1.41 → 21.2.4

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';
@@ -3800,13 +3804,18 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3800
3804
  break;
3801
3805
  case 'downArrow':
3802
3806
  if (!this.enableVirtualization) {
3803
- parentTarget = e.target.parentElement;
3807
+ target = e.target;
3808
+ parentTarget = target.parentElement;
3809
+ var cellIndex = parentTarget.cellIndex;
3810
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit["obj"])) {
3811
+ parentTarget = target;
3812
+ }
3804
3813
  summaryElement = this.findnextRowElement(parentTarget);
3805
3814
  if (summaryElement !== null) {
3806
3815
  var rowIndex = summaryElement.rowIndex;
3807
3816
  this.selectRow(rowIndex);
3808
- var cellIndex = e.target.cellIndex;
3809
- var row_1 = summaryElement.children[parseInt(cellIndex.toString(), 10)];
3817
+ var cellIndex_1 = e.target.cellIndex;
3818
+ var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
3810
3819
  addClass([row_1], 'e-focused');
3811
3820
  addClass([row_1], 'e-focus');
3812
3821
  }
@@ -3817,7 +3826,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3817
3826
  break;
3818
3827
  case 'upArrow':
3819
3828
  if (!this.enableVirtualization) {
3820
- parentTarget = e.target.parentElement;
3829
+ target = e.target;
3830
+ parentTarget = target.parentElement;
3831
+ var cellIndex = parentTarget.cellIndex;
3832
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit["obj"])) {
3833
+ parentTarget = target;
3834
+ }
3821
3835
  summaryElement = this.findPreviousRowElement(parentTarget);
3822
3836
  if (summaryElement !== null) {
3823
3837
  var rIndex = summaryElement.rowIndex;
@@ -4558,7 +4572,25 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4558
4572
  };
4559
4573
  };
4560
4574
  TreeGrid.prototype.updateRowTemplate = function () {
4561
- this.treeColumnRowTemplate();
4575
+ var _this = this;
4576
+ if (this.rowTemplate) {
4577
+ if (this.isReact && this.getContentTable().rows.length === 0) {
4578
+ setTimeout(function () {
4579
+ _this.treeColumnRowTemplate();
4580
+ if (_this.enableCollapseAll) {
4581
+ var currentData = _this.getCurrentViewRecords();
4582
+ var rows = _this.getContentTable().rows;
4583
+ for (var i = 0; i < rows.length; i++) {
4584
+ var args = { data: currentData[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)] };
4585
+ _this.renderModule.RowModifier(args);
4586
+ }
4587
+ }
4588
+ }, 0);
4589
+ }
4590
+ else {
4591
+ this.treeColumnRowTemplate();
4592
+ }
4593
+ }
4562
4594
  };
4563
4595
  TreeGrid.prototype.bindedDataSource = function () {
4564
4596
  var dataSource = 'dataSource';
@@ -4601,25 +4633,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4601
4633
  if (requestType === 'reorder') {
4602
4634
  _this.notify('getColumnIndex', {});
4603
4635
  }
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
4636
  if (isRemoteData(_this) && _this.enableVirtualization) {
4624
4637
  if (args.requestType === 'virtualscroll') {
4625
4638
  _this.query.expand('VirtualScrollingAction');
@@ -6750,17 +6763,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6750
6763
  }
6751
6764
  };
6752
6765
  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
- }
6766
+ var rows = this.getContentTable().rows;
6767
+ rows = [].slice.call(rows);
6768
+ for (var i = 0; i < rows.length; i++) {
6769
+ var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
6770
+ .cells[this.treeColumnIndex];
6771
+ var row = rows[parseInt(i.toString(), 10)];
6772
+ var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
6773
+ var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
6774
+ this.renderModule.cellRender(arg);
6764
6775
  }
6765
6776
  };
6766
6777
  TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {