@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.
@@ -2290,6 +2290,10 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2290
2290
  qry.expand(expandDetail);
2291
2291
  }
2292
2292
  qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
2293
+ if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterModule && this.parent.grid.filterModule['value']) {
2294
+ var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
2295
+ qry.queries.push(filterqry[0]);
2296
+ }
2293
2297
  showSpinner(this.parent.element);
2294
2298
  dm.executeQuery(qry).then(function (e) {
2295
2299
  var remoteExpandedData = 'remoteExpandedData';
@@ -2312,6 +2316,24 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2312
2316
  }
2313
2317
  var haveChild = getObject('actual.nextLevel', e);
2314
2318
  var result = e.result;
2319
+ var resultChildData = [];
2320
+ if (rowDetails.action === 'remoteExpand' && _this.parent.grid.filterModule && _this.parent.grid.filterModule['value']) {
2321
+ for (var i = 0; i < datas.length; i++) {
2322
+ 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) {
2323
+ datas.splice(i, 1);
2324
+ i--;
2325
+ }
2326
+ }
2327
+ for (var i = 0; i < result.length; i++) {
2328
+ if (rowDetails.record['' + _this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + _this.parent.idMapping] &&
2329
+ rowDetails.record['' + _this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping]) {
2330
+ if (Object.prototype.hasOwnProperty.call(result, i)) {
2331
+ resultChildData.push(result[parseInt(i.toString(), 10)]);
2332
+ }
2333
+ }
2334
+ }
2335
+ result = resultChildData;
2336
+ }
2315
2337
  rowDetails.record.childRecords = result;
2316
2338
  for (var r = 0; r < result.length; r++) {
2317
2339
  if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
@@ -3807,7 +3829,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3807
3829
  target = e.target;
3808
3830
  parentTarget = target.parentElement;
3809
3831
  var cellIndex = parentTarget.cellIndex;
3810
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit["obj"])) {
3832
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3811
3833
  parentTarget = target;
3812
3834
  }
3813
3835
  summaryElement = this.findnextRowElement(parentTarget);
@@ -3829,7 +3851,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3829
3851
  target = e.target;
3830
3852
  parentTarget = target.parentElement;
3831
3853
  var cellIndex = parentTarget.cellIndex;
3832
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit["obj"])) {
3854
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
3833
3855
  parentTarget = target;
3834
3856
  }
3835
3857
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -4581,7 +4603,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4581
4603
  var currentData = _this.getCurrentViewRecords();
4582
4604
  var rows = _this.getContentTable().rows;
4583
4605
  for (var i = 0; i < rows.length; i++) {
4584
- var args = { data: currentData[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)] };
4606
+ var args = {
4607
+ data: currentData[parseInt(i.toString(), 10)],
4608
+ row: rows[parseInt(i.toString(), 10)]
4609
+ };
4585
4610
  _this.renderModule.RowModifier(args);
4586
4611
  }
4587
4612
  }
@@ -6827,7 +6852,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6827
6852
  }
6828
6853
  }
6829
6854
  if (cRow.length && childRecord.expanded) {
6830
- this.collapseRemoteChild({ record: childRecord, rows: cRow }, true);
6855
+ this.collapseRemoteChild({ record: childRecord, rows: cRow }, false);
6831
6856
  }
6832
6857
  }
6833
6858
  }
@@ -13020,7 +13045,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13020
13045
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
13021
13046
  }
13022
13047
  if (currentViewData.length && (currentViewData[0]["" + indexValue] >= this.parent.pageSettings.pageSize / 2) &&
13023
- ((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
13048
+ ((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
13024
13049
  this.startIndex = currentViewData[0]["" + indexValue] - (this.parent.pageSettings.pageSize / 2);
13025
13050
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
13026
13051
  }
@@ -13062,7 +13087,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13062
13087
  this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
13063
13088
  this.endIndex = lastIndex;
13064
13089
  if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
13065
- ((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2))) {
13090
+ ((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
13066
13091
  this.startIndex = currentViewData[0]["" + indexValue] + (this.parent.pageSettings.pageSize / 2);
13067
13092
  }
13068
13093
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
@@ -13413,6 +13438,9 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
13413
13438
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
13414
13439
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13415
13440
  }
13441
+ if (requestType === 'save' && this.parent.editSettings.newRowPosition === 'Bottom') {
13442
+ endIndex = counts.count;
13443
+ }
13416
13444
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
13417
13445
  //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
13418
13446
  if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||