@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.
@@ -1728,7 +1728,7 @@ class Render {
1728
1728
  }
1729
1729
  else {
1730
1730
  const str = 'isStringTemplate';
1731
- const result = args.column[`${templateFn}`](extend$1({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent[`${str}`]);
1731
+ const result = args.column[`${templateFn}`](extend$1({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent[`${str}`], undefined, undefined, this.parent['root']);
1732
1732
  appendChildren(cellElement, result);
1733
1733
  }
1734
1734
  delete args.column.template;
@@ -2120,13 +2120,13 @@ class DataManipulation {
2120
2120
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2121
2121
  qry.take(this.parent.pageSettings.pageSize);
2122
2122
  const expandDetail = [];
2123
- expandDetail.push('ExpandingAction', rowDetails.record[this.parent.idMapping]);
2123
+ expandDetail.push('ExpandingAction', parseInt(rowDetails.record[this.parent.idMapping], 10).toString());
2124
2124
  qry.expand(expandDetail);
2125
2125
  }
2126
2126
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
2127
2127
  qry.take(this.parent.grid.pageSettings.pageSize);
2128
2128
  const expandDetail = [];
2129
- expandDetail.push('CollapsingAction', rowDetails.record[this.parent.idMapping]);
2129
+ expandDetail.push('CollapsingAction', parseInt(rowDetails.record[this.parent.idMapping], 10).toString());
2130
2130
  qry.expand(expandDetail);
2131
2131
  }
2132
2132
  qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
@@ -5453,6 +5453,21 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5453
5453
  if (this.grid.columns.length !== this.columnModel.length) {
5454
5454
  this.stackedHeader = true;
5455
5455
  }
5456
+ if (this.stackedHeader && this.allowResizing) {
5457
+ for (let i = 0; i < this.columns.length; i++) {
5458
+ if (!isNullOrUndefined(this.columns[parseInt(i.toString(), 10)].columns)) {
5459
+ for (let j = 0; j < this.columns[parseInt(i.toString(), 10)].columns.length; j++) {
5460
+ const stackedColumn = this.columns[parseInt(i.toString(), 10)].columns[parseInt(j.toString(), 10)];
5461
+ const currentColumn = this.grid.getColumnByField(stackedColumn.field);
5462
+ stackedColumn.width = currentColumn.width;
5463
+ }
5464
+ }
5465
+ else if (!isNullOrUndefined(this.columns[parseInt(i.toString(), 10)].field)) {
5466
+ const currentColumn = this.grid.getColumnByField(this.columns[parseInt(i.toString(), 10)].field);
5467
+ this.columns[parseInt(i.toString(), 10)].width = currentColumn.width;
5468
+ }
5469
+ }
5470
+ }
5456
5471
  if (!this.stackedHeader) {
5457
5472
  merge(this.columns, this.columnModel);
5458
5473
  }
@@ -6135,7 +6150,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6135
6150
  }
6136
6151
  }
6137
6152
  if (isCountRequired(this) && action === 'expand') {
6138
- this.dataResults.result = this.getCurrentViewRecords();
6153
+ const currentData = this.getCurrentViewRecords();
6154
+ const visibleRecords = currentData.filter((e) => {
6155
+ return getExpandStatus(this, e, this.parentData);
6156
+ });
6157
+ this.dataResults.result = visibleRecords;
6139
6158
  }
6140
6159
  if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
6141
6160
  targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
@@ -10409,7 +10428,7 @@ class BatchEdit {
10409
10428
  this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];
10410
10429
  }
10411
10430
  cellSaved(args) {
10412
- let actualCellIndex = args.cell.cellIndex;
10431
+ let actualCellIndex = args.column.index;
10413
10432
  const frozenCols = this.parent.frozenColumns || this.parent.getFrozenColumns();
10414
10433
  if (frozenCols && args.columnObject.index > frozenCols) {
10415
10434
  actualCellIndex = actualCellIndex + frozenCols;
@@ -10420,13 +10439,13 @@ class BatchEdit {
10420
10439
  const colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;
10421
10440
  if (colCount === this.parent.treeColumnIndex) {
10422
10441
  this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
10423
- column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
10442
+ column: this.parent.grid.getColumnByIndex(args.column.index)
10424
10443
  });
10425
10444
  }
10426
10445
  }
10427
10446
  else if (actualCellIndex === this.parent.treeColumnIndex) {
10428
10447
  this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,
10429
- column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)
10448
+ column: this.parent.grid.getColumnByIndex(args.column.index)
10430
10449
  });
10431
10450
  }
10432
10451
  if (this.isAdd && this.parent.editSettings.mode === 'Batch' && this.parent.editSettings.newRowPosition !== 'Bottom') {
@@ -13168,10 +13187,6 @@ class Freeze$1 {
13168
13187
  getValue('addRenderer', renderer)
13169
13188
  .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13170
13189
  }
13171
- else {
13172
- getValue('addRenderer', renderer)
13173
- .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
13174
- }
13175
13190
  }
13176
13191
  if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
13177
13192
  getValue('addRenderer', renderer)
@@ -13203,14 +13218,15 @@ class Freeze$1 {
13203
13218
  rows = args.detailrows;
13204
13219
  }
13205
13220
  for (let i = 0; i < rows.length; i++) {
13206
- const rData = this.parent.grid.getRowObjectFromUID(rows[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;
13207
- rows[parseInt(i.toString(), 10)].style.display = args.action;
13208
- if (freeze && frozenRightRows.length) {
13209
- frozenRightRows[parseInt(i.toString(), 10)].style.display = args.action;
13221
+ let row = rows[parseInt(i.toString(), 10)];
13222
+ const rData = this.parent.grid.getRowObjectFromUID(row.getAttribute('data-Uid')).data;
13223
+ if (!isNullOrUndefined(movableRows) && row.parentElement.firstElementChild.clientHeight > 0) {
13224
+ row.style.height = row.parentElement.firstElementChild.clientHeight + 'px';
13210
13225
  }
13226
+ row.style.display = args.action;
13211
13227
  const queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
13212
13228
  : '.e-treecolumn-container .e-treegridexpand';
13213
- if (frozenrows[rows[parseInt(i.toString(), 10)].rowIndex].querySelector(queryselector)) {
13229
+ if (frozenrows[row.rowIndex].querySelector(queryselector)) {
13214
13230
  const cRow = [];
13215
13231
  for (let i = 0; i < movableRows.length; i++) {
13216
13232
  if (movableRows[parseInt(i.toString(), 10)].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {