@syncfusion/ej2-treegrid 20.2.46 → 20.2.49

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.
@@ -1065,6 +1065,8 @@ class Selection {
1065
1065
  headerSelection(checkAll) {
1066
1066
  let index = -1;
1067
1067
  let length = 0;
1068
+ //This property used to maintain the check state of the currentview data after clear filtering
1069
+ let multiFilterCheckState = false;
1068
1070
  if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
1069
1071
  const filterResult = this.parent.filterModule.filteredResult;
1070
1072
  if (this.filteredList.length === 0) {
@@ -1073,6 +1075,10 @@ class Selection {
1073
1075
  else {
1074
1076
  if (this.filteredList !== filterResult) {
1075
1077
  this.filteredList = filterResult;
1078
+ multiFilterCheckState = true;
1079
+ }
1080
+ else {
1081
+ multiFilterCheckState = false;
1076
1082
  }
1077
1083
  }
1078
1084
  }
@@ -1091,6 +1097,9 @@ class Selection {
1091
1097
  if (data[i].checkboxState === 'check') {
1092
1098
  continue;
1093
1099
  }
1100
+ if (multiFilterCheckState) {
1101
+ continue;
1102
+ }
1094
1103
  data[i].checkboxState = 'check';
1095
1104
  this.updateSelectedItems(data[i], data[i].checkboxState);
1096
1105
  }
@@ -4058,6 +4067,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4058
4067
  if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary === true).length) {
4059
4068
  this.grid.refresh();
4060
4069
  }
4070
+ if (args.action === 'filter') {
4071
+ if (this.filterModule['currentFilterObject'] !== '' && this.enableVirtualization && !this.initialRender) {
4072
+ this.expandAll();
4073
+ }
4074
+ }
4075
+ if (args.requestType === 'searching') {
4076
+ if (this.searchSettings.key !== '' && this.enableVirtualization && !this.initialRender) {
4077
+ this.expandAll();
4078
+ }
4079
+ }
4080
+ if (args.action === 'clearFilter' && this.enableCollapseAll) {
4081
+ this.collapseAll();
4082
+ }
4061
4083
  if (this.action === 'indenting' || this.action === 'outdenting') {
4062
4084
  this.action = this.action === 'indenting' ? 'indented' : 'outdented';
4063
4085
  const selectedItem = [this.selectedRecords];
@@ -8557,10 +8579,6 @@ class Filter$1 {
8557
8579
  }
8558
8580
  }
8559
8581
  else {
8560
- if ((!this.parent.enableCollapseAll || !this.parent.initialRender && isNullOrUndefined(this.parent['dataResults']['result']))
8561
- && parent['expanded'] === false && this.parent.getVisibleRecords().indexOf(record) === -1) {
8562
- this.parent.expandRow(this.parent.getRows()[parent['index']], parent);
8563
- }
8564
8582
  this.addParentRecord(parent);
8565
8583
  }
8566
8584
  }
@@ -9231,53 +9249,55 @@ class Toolbar$1 {
9231
9249
  this.parent.off(toolbarClick, this.toolbarClickHandler);
9232
9250
  }
9233
9251
  refreshToolbar(args) {
9234
- const tObj = this.parent;
9235
- let indentElement;
9236
- let outdentElement;
9237
- const indentID = tObj.element.id + '_gridcontrol_indent';
9238
- const outdentID = tObj.element.id + '_gridcontrol_outdent';
9239
9252
  const toolbarElement = this.parent.grid.toolbarModule.getToolbar();
9240
- const indentEle = toolbarElement.querySelector('#' + indentID);
9241
- const outdentEle = toolbarElement.querySelector('#' + outdentID);
9242
- let row = args.row;
9243
- const selectedrow = tObj.getSelectedRows()[0];
9244
- if (!isNullOrUndefined(row[0])) {
9245
- row = row[0];
9246
- }
9247
- row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
9248
- if (indentEle !== null && outdentEle !== null) {
9249
- indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
9250
- outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
9251
- if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
9252
- indentElement.classList.add('e-hidden');
9253
- outdentElement.classList.add('e-hidden');
9254
- }
9255
- else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
9256
- const selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];
9257
- if (!isNullOrUndefined(selectedItem)) {
9258
- if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {
9259
- indentElement.classList.add('e-hidden');
9260
- }
9261
- else {
9262
- indentElement.classList.remove('e-hidden');
9253
+ if (!isNullOrUndefined(toolbarElement)) {
9254
+ const tObj = this.parent;
9255
+ let indentElement;
9256
+ let outdentElement;
9257
+ const indentID = tObj.element.id + '_gridcontrol_indent';
9258
+ const outdentID = tObj.element.id + '_gridcontrol_outdent';
9259
+ const indentEle = toolbarElement.querySelector('#' + indentID);
9260
+ const outdentEle = toolbarElement.querySelector('#' + outdentID);
9261
+ let row = args.row;
9262
+ const selectedrow = tObj.getSelectedRows()[0];
9263
+ if (!isNullOrUndefined(row[0])) {
9264
+ row = row[0];
9265
+ }
9266
+ row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
9267
+ if (indentEle !== null && outdentEle !== null) {
9268
+ indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
9269
+ outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
9270
+ if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
9271
+ indentElement.classList.add('e-hidden');
9272
+ outdentElement.classList.add('e-hidden');
9273
+ }
9274
+ else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
9275
+ const selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];
9276
+ if (!isNullOrUndefined(selectedItem)) {
9277
+ if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {
9278
+ indentElement.classList.add('e-hidden');
9279
+ }
9280
+ else {
9281
+ indentElement.classList.remove('e-hidden');
9282
+ }
9283
+ if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {
9284
+ indentElement.classList.remove('e-hidden');
9285
+ }
9286
+ if (selectedItem.level === 0) {
9287
+ outdentElement.classList.add('e-hidden');
9288
+ }
9289
+ if (selectedItem.level !== 0) {
9290
+ outdentElement.classList.remove('e-hidden');
9291
+ }
9263
9292
  }
9264
- if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {
9265
- indentElement.classList.remove('e-hidden');
9293
+ }
9294
+ if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
9295
+ if (this.parent.toolbar['includes']('Indent')) {
9296
+ indentElement.classList.add('e-hidden');
9266
9297
  }
9267
- if (selectedItem.level === 0) {
9298
+ if (this.parent.toolbar['includes']('Outdent')) {
9268
9299
  outdentElement.classList.add('e-hidden');
9269
9300
  }
9270
- if (selectedItem.level !== 0) {
9271
- outdentElement.classList.remove('e-hidden');
9272
- }
9273
- }
9274
- }
9275
- if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
9276
- if (this.parent.toolbar['includes']('Indent')) {
9277
- indentElement.classList.add('e-hidden');
9278
- }
9279
- if (this.parent.toolbar['includes']('Outdent')) {
9280
- outdentElement.classList.add('e-hidden');
9281
9301
  }
9282
9302
  }
9283
9303
  }