@syncfusion/ej2-treegrid 21.2.4 → 21.2.6

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.
@@ -2146,6 +2146,10 @@ class DataManipulation {
2146
2146
  qry.expand(expandDetail);
2147
2147
  }
2148
2148
  qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2149
+ if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterModule && this.parent.grid.filterModule['value']) {
2150
+ const filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter((e) => e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined');
2151
+ qry.queries.push(filterqry[0]);
2152
+ }
2149
2153
  showSpinner(this.parent.element);
2150
2154
  dm.executeQuery(qry).then((e) => {
2151
2155
  const remoteExpandedData = 'remoteExpandedData';
@@ -2167,7 +2171,25 @@ class DataManipulation {
2167
2171
  });
2168
2172
  }
2169
2173
  const haveChild = getObject('actual.nextLevel', e);
2170
- const result = e.result;
2174
+ let result = e.result;
2175
+ const resultChildData = [];
2176
+ if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterModule && this.parent.grid.filterModule['value']) {
2177
+ for (let i = 0; i < datas.length; i++) {
2178
+ if (Object.prototype.hasOwnProperty.call(datas[parseInt(i.toString(), 10)], this.parent.parentIdMapping) && datas[parseInt(i.toString(), 10)]['' + this.parent.parentIdMapping] !== null && datas[parseInt(i.toString(), 10)].level === 0) {
2179
+ datas.splice(i, 1);
2180
+ i--;
2181
+ }
2182
+ }
2183
+ for (let i = 0; i < result.length; i++) {
2184
+ if (rowDetails.record['' + this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + this.parent.idMapping] &&
2185
+ rowDetails.record['' + this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + this.parent.parentIdMapping]) {
2186
+ if (Object.prototype.hasOwnProperty.call(result, i)) {
2187
+ resultChildData.push(result[parseInt(i.toString(), 10)]);
2188
+ }
2189
+ }
2190
+ }
2191
+ result = resultChildData;
2192
+ }
2171
2193
  rowDetails.record.childRecords = result;
2172
2194
  for (let r = 0; r < result.length; r++) {
2173
2195
  if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'remoteExpand') {
@@ -3541,7 +3563,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3541
3563
  target = e.target;
3542
3564
  parentTarget = target.parentElement;
3543
3565
  const cellIndex = parentTarget.cellIndex;
3544
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit[`obj`])) {
3566
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3545
3567
  parentTarget = target;
3546
3568
  }
3547
3569
  summaryElement = this.findnextRowElement(parentTarget);
@@ -3563,7 +3585,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3563
3585
  target = e.target;
3564
3586
  parentTarget = target.parentElement;
3565
3587
  const cellIndex = parentTarget.cellIndex;
3566
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit[`obj`])) {
3588
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3567
3589
  parentTarget = target;
3568
3590
  }
3569
3591
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -4307,7 +4329,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4307
4329
  const currentData = this.getCurrentViewRecords();
4308
4330
  const rows = this.getContentTable().rows;
4309
4331
  for (let i = 0; i < rows.length; i++) {
4310
- let args = { data: currentData[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)] };
4332
+ const args = {
4333
+ data: currentData[parseInt(i.toString(), 10)],
4334
+ row: rows[parseInt(i.toString(), 10)]
4335
+ };
4311
4336
  this.renderModule.RowModifier(args);
4312
4337
  }
4313
4338
  }
@@ -6518,7 +6543,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6518
6543
  }
6519
6544
  }
6520
6545
  if (cRow.length && childRecord.expanded) {
6521
- this.collapseRemoteChild({ record: childRecord, rows: cRow }, true);
6546
+ this.collapseRemoteChild({ record: childRecord, rows: cRow }, false);
6522
6547
  }
6523
6548
  }
6524
6549
  }
@@ -12617,7 +12642,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12617
12642
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
12618
12643
  }
12619
12644
  if (currentViewData.length && (currentViewData[0][`${indexValue}`] >= this.parent.pageSettings.pageSize / 2) &&
12620
- ((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
12645
+ ((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
12621
12646
  this.startIndex = currentViewData[0][`${indexValue}`] - (this.parent.pageSettings.pageSize / 2);
12622
12647
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
12623
12648
  }
@@ -12659,7 +12684,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12659
12684
  this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
12660
12685
  this.endIndex = lastIndex;
12661
12686
  if (currentViewData.length && this.startIndex > currentViewData[0][`${indexValue}`] &&
12662
- ((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2))) {
12687
+ ((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
12663
12688
  this.startIndex = currentViewData[0][`${indexValue}`] + (this.parent.pageSettings.pageSize / 2);
12664
12689
  }
12665
12690
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
@@ -12991,6 +13016,9 @@ class VirtualScroll$1 {
12991
13016
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
12992
13017
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
12993
13018
  }
13019
+ if (requestType === 'save' && this.parent.editSettings.newRowPosition === 'Bottom') {
13020
+ endIndex = counts.count;
13021
+ }
12994
13022
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
12995
13023
  //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
12996
13024
  if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||