@syncfusion/ej2-treegrid 20.3.52 → 20.3.57

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.
@@ -849,6 +849,7 @@ class Selection {
849
849
  this.selectedItems = [];
850
850
  this.selectedIndexes = [];
851
851
  this.filteredList = [];
852
+ this.searchingRecords = [];
852
853
  this.addEventListener();
853
854
  }
854
855
  /**
@@ -1101,6 +1102,9 @@ class Selection {
1101
1102
  if (this.filteredList.length === 0) {
1102
1103
  this.filteredList = filterResult;
1103
1104
  }
1105
+ if (this.parent.grid.searchSettings.key.length) {
1106
+ this.searchingRecords = filterResult;
1107
+ }
1104
1108
  else {
1105
1109
  if (this.filteredList !== filterResult) {
1106
1110
  this.filteredList = filterResult;
@@ -1112,13 +1116,22 @@ class Selection {
1112
1116
  }
1113
1117
  }
1114
1118
  if (this.filteredList.length > 0) {
1115
- if (!this.parent.filterSettings.columns.length && this.filteredList.length) {
1119
+ if (!this.parent.filterSettings.columns.length && this.filteredList.length && !this.parent.grid.searchSettings.key.length) {
1116
1120
  this.filteredList = [];
1117
1121
  }
1122
+ if (this.searchingRecords.length && !isNullOrUndefined(checkAll)) {
1123
+ this.filteredList = this.searchingRecords;
1124
+ }
1125
+ }
1126
+ let data;
1127
+ if (this.parent.filterModule.filteredResult.length === 0 && this.parent.getCurrentViewRecords().length === 0 &&
1128
+ this.parent.filterSettings.columns.length > 0) {
1129
+ data = this.filteredList;
1130
+ }
1131
+ else {
1132
+ data = (!isNullOrUndefined(this.parent.filterModule) &&
1133
+ (this.filteredList.length > 0)) ? this.filteredList : this.parent.flatData;
1118
1134
  }
1119
- let data = (!isNullOrUndefined(this.parent.filterModule) &&
1120
- (this.filteredList.length > 0)) ? this.filteredList :
1121
- this.parent.flatData;
1122
1135
  data = isRemoteData(this.parent) ? this.parent.getCurrentViewRecords() : data;
1123
1136
  if (!isNullOrUndefined(checkAll)) {
1124
1137
  for (let i = 0; i < data.length; i++) {
@@ -5450,7 +5463,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5450
5463
  const obj = 'dialogObj';
5451
5464
  const showDialog = 'showDialog';
5452
5465
  if ((this.getBatchChanges()[this.changedRecords].length ||
5453
- this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
5466
+ this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length)
5467
+ && this.editSettings.showConfirmDialog) {
5454
5468
  const dialogObj = this.grid.editModule[obj];
5455
5469
  this.grid.editModule[showDialog]('CancelEdit', dialogObj);
5456
5470
  this.targetElement = target;
@@ -5881,6 +5895,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5881
5895
  this.localExpand(action, row, record);
5882
5896
  }
5883
5897
  }
5898
+ if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
5899
+ targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
5900
+ targetEle.closest('.e-treerowcell').removeAttribute('aria-selected');
5901
+ }
5884
5902
  if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell')) {
5885
5903
  let totalRows = this.getRows();
5886
5904
  const rows = this.getContentTable().rows;
@@ -5897,20 +5915,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5897
5915
  }
5898
5916
  this.notify('rowExpandCollapse', { detailrows: detailrows, action: displayAction, record: record, row: row });
5899
5917
  this.updateAltRow(gridRows);
5900
- this.updateGridRowsVisible();
5901
- }
5902
- }
5903
- updateGridRowsVisible() {
5904
- const rowsToRefresh = this.grid.getRowsObject();
5905
- const rows = this.getRows();
5906
- for (let i = 0; i < rows.length; i++) {
5907
- for (let j = 0; j < rowsToRefresh.length; j++) {
5908
- if (rows[i].dataset.uid === rowsToRefresh[j].uid) {
5909
- rowsToRefresh[j].visible = rows[i].style.display === 'none' ? false : true;
5910
- }
5911
- }
5912
5918
  }
5913
- this.grid.notify('refresh-Expand-and-Collapse', { rows: rowsToRefresh });
5914
5919
  }
5915
5920
  updateChildOnDemand(expandingArgs) {
5916
5921
  if (expandingArgs.requestType === 'collapse' && isCountRequired(this)) {
@@ -9219,6 +9224,8 @@ class Page$1 {
9219
9224
  */
9220
9225
  collapseExpandPagedchilds(rowDetails) {
9221
9226
  rowDetails.record.expanded = rowDetails.action === 'collapse' ? false : true;
9227
+ this.parent.flatData.map((e) => e.expanded = e.uniqueID === rowDetails.record.uniqueID &&
9228
+ e.expanded !== rowDetails.record.expanded ? rowDetails.record.expanded : e.expanded);
9222
9229
  if (this.parent.enableImmutableMode) {
9223
9230
  const primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
9224
9231
  const record = this.parent.flatData.filter((e) => {