@syncfusion/ej2-treegrid 20.4.48 → 20.4.54

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.
@@ -1862,7 +1862,7 @@ var Render = /** @__PURE__ @class */ (function () {
1862
1862
  }
1863
1863
  else {
1864
1864
  var str = 'isStringTemplate';
1865
- var result = args.column["" + templateFn](extend$1({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent["" + str]);
1865
+ var result = args.column["" + templateFn](extend$1({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent["" + str], undefined, undefined, this.parent['root']);
1866
1866
  appendChildren(cellElement, result);
1867
1867
  }
1868
1868
  delete args.column.template;
@@ -2264,13 +2264,13 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2264
2264
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2265
2265
  qry.take(this.parent.pageSettings.pageSize);
2266
2266
  var expandDetail = [];
2267
- expandDetail.push('ExpandingAction', rowDetails.record[this.parent.idMapping]);
2267
+ expandDetail.push('ExpandingAction', parseInt(rowDetails.record[this.parent.idMapping], 10).toString());
2268
2268
  qry.expand(expandDetail);
2269
2269
  }
2270
2270
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
2271
2271
  qry.take(this.parent.grid.pageSettings.pageSize);
2272
2272
  var expandDetail = [];
2273
- expandDetail.push('CollapsingAction', rowDetails.record[this.parent.idMapping]);
2273
+ expandDetail.push('CollapsingAction', parseInt(rowDetails.record[this.parent.idMapping], 10).toString());
2274
2274
  qry.expand(expandDetail);
2275
2275
  }
2276
2276
  qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
@@ -5734,6 +5734,21 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5734
5734
  if (this.grid.columns.length !== this.columnModel.length) {
5735
5735
  this.stackedHeader = true;
5736
5736
  }
5737
+ if (this.stackedHeader && this.allowResizing) {
5738
+ for (var i = 0; i < this.columns.length; i++) {
5739
+ if (!isNullOrUndefined(this.columns[parseInt(i.toString(), 10)].columns)) {
5740
+ for (var j = 0; j < this.columns[parseInt(i.toString(), 10)].columns.length; j++) {
5741
+ var stackedColumn = this.columns[parseInt(i.toString(), 10)].columns[parseInt(j.toString(), 10)];
5742
+ var currentColumn = this.grid.getColumnByField(stackedColumn.field);
5743
+ stackedColumn.width = currentColumn.width;
5744
+ }
5745
+ }
5746
+ else if (!isNullOrUndefined(this.columns[parseInt(i.toString(), 10)].field)) {
5747
+ var currentColumn = this.grid.getColumnByField(this.columns[parseInt(i.toString(), 10)].field);
5748
+ this.columns[parseInt(i.toString(), 10)].width = currentColumn.width;
5749
+ }
5750
+ }
5751
+ }
5737
5752
  if (!this.stackedHeader) {
5738
5753
  merge(this.columns, this.columnModel);
5739
5754
  }
@@ -6337,6 +6352,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6337
6352
  this.isCollapseAll = false;
6338
6353
  };
6339
6354
  TreeGrid.prototype.expandCollapse = function (action, row, record, isChild) {
6355
+ var _this = this;
6340
6356
  var expandingArgs = { row: row, data: record, childData: [], requestType: action };
6341
6357
  var childRecords = this.getCurrentViewRecords().filter(function (e) {
6342
6358
  return e.parentUniqueID === record.uniqueID;
@@ -6427,7 +6443,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6427
6443
  }
6428
6444
  }
6429
6445
  if (isCountRequired(this) && action === 'expand') {
6430
- this.dataResults.result = this.getCurrentViewRecords();
6446
+ var currentData = this.getCurrentViewRecords();
6447
+ var visibleRecords = currentData.filter(function (e) {
6448
+ return getExpandStatus(_this, e, _this.parentData);
6449
+ });
6450
+ this.dataResults.result = visibleRecords;
6431
6451
  }
6432
6452
  if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
6433
6453
  targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
@@ -10782,7 +10802,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
10782
10802
  this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
10783
10803
  };
10784
10804
  BatchEdit.prototype.cellSaved = function (args) {
10785
- var actualCellIndex = args.cell.cellIndex;
10805
+ var actualCellIndex = args.column.index;
10786
10806
  var frozenCols = this.parent.frozenColumns || this.parent.getFrozenColumns();
10787
10807
  if (frozenCols && args.columnObject.index > frozenCols) {
10788
10808
  actualCellIndex = actualCellIndex + frozenCols;
@@ -10793,13 +10813,13 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
10793
10813
  var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
10794
10814
  if (colCount === this.parent.treeColumnIndex) {
10795
10815
  this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
10796
- column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
10816
+ column: this.parent.grid.getColumnByIndex(args.column.index)
10797
10817
  });
10798
10818
  }
10799
10819
  }
10800
10820
  else if (actualCellIndex === this.parent.treeColumnIndex) {
10801
10821
  this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
10802
- column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
10822
+ column: this.parent.grid.getColumnByIndex(args.column.index)
10803
10823
  });
10804
10824
  }
10805
10825
  if (this.isAdd && this.parent.editSettings.mode === 'Batch' && this.parent.editSettings.newRowPosition !== 'Bottom') {
@@ -13616,10 +13636,6 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
13616
13636
  getValue('addRenderer', renderer)
13617
13637
  .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13618
13638
  }
13619
- else {
13620
- getValue('addRenderer', renderer)
13621
- .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13622
- }
13623
13639
  }
13624
13640
  if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
13625
13641
  getValue('addRenderer', renderer)
@@ -13655,14 +13671,15 @@ var Freeze$1 = /** @__PURE__ @class */ (function () {
13655
13671
  rows = args.detailrows;
13656
13672
  }
13657
13673
  for (var i = 0; i < rows.length; i++) {
13658
- var rData = this.parent.grid.getRowObjectFromUID(rows[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;
13659
- rows[parseInt(i.toString(), 10)].style.display = args.action;
13660
- if (freeze && frozenRightRows.length) {
13661
- frozenRightRows[parseInt(i.toString(), 10)].style.display = args.action;
13674
+ var row = rows[parseInt(i.toString(), 10)];
13675
+ var rData = this.parent.grid.getRowObjectFromUID(row.getAttribute('data-Uid')).data;
13676
+ if (!isNullOrUndefined(movableRows) && row.parentElement.firstElementChild.clientHeight > 0) {
13677
+ row.style.height = row.parentElement.firstElementChild.clientHeight + 'px';
13662
13678
  }
13679
+ row.style.display = args.action;
13663
13680
  var queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
13664
13681
  : '.e-treecolumn-container .e-treegridexpand';
13665
- if (frozenrows[rows[parseInt(i.toString(), 10)].rowIndex].querySelector(queryselector)) {
13682
+ if (frozenrows[row.rowIndex].querySelector(queryselector)) {
13666
13683
  var cRow = [];
13667
13684
  for (var i_1 = 0; i_1 < movableRows.length; i_1++) {
13668
13685
  if (movableRows[parseInt(i_1.toString(), 10)].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {