@syncfusion/ej2-treegrid 20.2.36 → 20.2.38

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.
@@ -1043,7 +1043,12 @@ class Selection {
1043
1043
  if (indeter > 0 || (checkChildRecords > 0 && checkChildRecords !== length)) {
1044
1044
  record.checkboxState = 'indeterminate';
1045
1045
  }
1046
- else if (checkChildRecords === 0 && indeter === 0) {
1046
+ else if (checkChildRecords === 0 && (!record.hasFilteredChildRecords || isNullOrUndefined(record.hasFilteredChildRecords)) && !isNullOrUndefined(this.parent['dataResults']['actionArgs']) &&
1047
+ (this.parent['dataResults']['actionArgs'].requestType === 'searching' || this.parent['dataResults']['actionArgs'].requestType === 'filtering') && record.checkboxState === 'check') {
1048
+ record.checkboxState = 'check';
1049
+ }
1050
+ else if ((checkChildRecords === 0 && indeter === 0) || (checkChildRecords === 0 && record.hasFilteredChildRecords && !isNullOrUndefined(this.parent['dataResults']['actionArgs']) &&
1051
+ (this.parent['dataResults']['actionArgs'].requestType === 'searching' || this.parent['dataResults']['actionArgs'].requestType === 'filtering') && record.checkboxState === 'check')) {
1047
1052
  record.checkboxState = 'uncheck';
1048
1053
  }
1049
1054
  else {
@@ -1432,7 +1437,7 @@ class Render {
1432
1437
  const parentrec = this.parent.getCurrentViewRecords().filter((rec) => {
1433
1438
  return getValue(proxy.idMapping, rec) === getValue(proxy.parentIdMapping, data);
1434
1439
  });
1435
- if (parentrec.length > 0) {
1440
+ if (parentrec.length > 0 && !parentrec[0].isSummaryRow) {
1436
1441
  const display = parentrec[0].expanded ? 'table-row' : 'none';
1437
1442
  args.row.setAttribute('style', 'display: ' + display + ';');
1438
1443
  }
@@ -2072,8 +2077,8 @@ class DataManipulation {
2072
2077
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
2073
2078
  currentData.index = this.storedIndex;
2074
2079
  }
2075
- if (!isNullOrUndefined(currentData[this.parent.childMapping]) ||
2076
- (currentData[this.parent.hasChildMapping] && isCountRequired(this.parent))) {
2080
+ if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
2081
+ ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent) && this.parent.initialRender)) {
2077
2082
  currentData.hasChildRecords = true;
2078
2083
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
2079
2084
  && isNullOrUndefined(currentData[this.parent.childMapping])) {
@@ -2227,9 +2232,9 @@ class DataManipulation {
2227
2232
  const modifiedData = new DataManager(parentData).executeLocal(srtQry);
2228
2233
  if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
2229
2234
  this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
2230
- var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
2235
+ const dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
2231
2236
  modifiedData.splice(dragdIndex, 1);
2232
- var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
2237
+ const dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
2233
2238
  if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
2234
2239
  modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
2235
2240
  }
@@ -5874,7 +5879,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5874
5879
  }
5875
5880
  const args = { data: record, row: row };
5876
5881
  let rows = [];
5877
- rows = gridRows.filter((r) => r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1)));
5882
+ rows = gridRows.filter((r) => ((r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1))) || (r.querySelector('.e-gridrowindex' + record.index + 'level0' + '.e-summarycell'))));
5878
5883
  if (action === 'expand') {
5879
5884
  this.notify(remoteExpand, { record: record, rows: rows, parentRow: row });
5880
5885
  const args = { row: row, data: record };
@@ -7372,7 +7377,7 @@ class RowDD$1 {
7372
7377
  }
7373
7378
  }
7374
7379
  updateIcon(row, index, args) {
7375
- let rowEle = args.target ? closest(args.target, 'tr') : null;
7380
+ const rowEle = args.target ? closest(args.target, 'tr') : null;
7376
7381
  this.dropPosition = undefined;
7377
7382
  let rowPositionHeight = 0;
7378
7383
  this.removeFirstrowBorder(rowEle);
@@ -9624,11 +9629,11 @@ class Sort$1 {
9624
9629
  this.flatSortedData[this.storedIndex] = data[d];
9625
9630
  }
9626
9631
  if (data[d].hasChildRecords) {
9627
- let childSort = (new DataManager(data[d].childRecords).executeLocal(srtQry));
9632
+ const childSort = (new DataManager(data[d].childRecords).executeLocal(srtQry));
9628
9633
  if (this.parent.allowRowDragAndDrop && data[d].childRecords.indexOf(this.parent.rowDragAndDropModule['draggedRecord']) !== -1 && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
9629
- var dragdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
9634
+ const dragdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
9630
9635
  childSort.splice(dragdIndex, 1);
9631
- var dropdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
9636
+ const dropdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
9632
9637
  if (this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
9633
9638
  childSort.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
9634
9639
  }
@@ -10984,9 +10989,11 @@ class Edit$1 {
10984
10989
  this.parent.parentData.push(data[i]);
10985
10990
  }
10986
10991
  }
10987
- if (details.action === 'add' && this.previousNewRowPosition != null) {
10988
- this.parent.setProperties({ editSettings: { newRowPosition: this.previousNewRowPosition } }, true);
10989
- this.previousNewRowPosition = null;
10992
+ if (!this.parent.enableInfiniteScrolling) {
10993
+ if (details.action === 'add' && this.previousNewRowPosition != null) {
10994
+ this.parent.setProperties({ editSettings: { newRowPosition: this.previousNewRowPosition } }, true);
10995
+ this.previousNewRowPosition = null;
10996
+ }
10990
10997
  }
10991
10998
  }
10992
10999
  updateIndex(data, rows, records) {
@@ -11230,14 +11237,19 @@ class Edit$1 {
11230
11237
  }
11231
11238
  else {
11232
11239
  if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
11233
- this.addRowIndex = args.index;
11240
+ if (args.index !== 0) {
11241
+ this.addRowIndex = args.index;
11242
+ }
11243
+ else {
11244
+ this.addRowIndex = this.parent.grid.selectedRowIndex;
11245
+ }
11234
11246
  }
11235
11247
  else {
11236
11248
  this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;
11237
11249
  }
11238
11250
  }
11239
11251
  if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
11240
- this.addRowRecord = this.parent.flatData[args.index];
11252
+ this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
11241
11253
  }
11242
11254
  else {
11243
11255
  this.addRowRecord = this.parent.getSelectedRecords()[0];
@@ -11720,7 +11732,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
11720
11732
  getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
11721
11733
  }
11722
11734
  }
11723
- if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && this.startIndex === -1)) {
11735
+ if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && (this.startIndex === -1 || this.startIndex === 0 && this['preStartIndex'] === 0))) {
11724
11736
  this.contents.scrollTop = 0;
11725
11737
  this.isDataSourceChanged = false;
11726
11738
  }