@syncfusion/ej2-treegrid 32.2.7 → 32.2.9

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.
@@ -6513,11 +6513,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6513
6513
  rowData.hasChildRecords = record.hasChildRecords;
6514
6514
  rowData.parentUniqueID = record.parentUniqueID;
6515
6515
  rowData.expanded = record.expanded;
6516
- if (this.enableVirtualization) {
6517
- this.grid.selectionModule.selectedRowIndexes = this.grid.selectionModule.selectedRowIndexes.indexOf(record.index) === -1
6518
- && (this.selectedRowIndex >= 0 && this.selectedRowIndex !== record.index) ? [record.index] :
6519
- this.grid.selectionModule.selectedRowIndexes;
6520
- }
6521
6516
  this.grid.setRowData(key, rowData);
6522
6517
  const visibleRecords = this.getVisibleRecords();
6523
6518
  if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[`${primaryKey}`]) {
@@ -11446,11 +11441,22 @@ class ExcelExport {
11446
11441
  let query = new Query();
11447
11442
  if (!this.isLocal()) {
11448
11443
  query = this.generateQuery(query);
11449
- query.queries = this.parent.grid.getDataModule().generateQuery().queries;
11450
- query = ExportHelper.getQuery(this.parent.grid, data);
11451
- if (isNullOrUndefined(this.parent.filterModule)) {
11452
- query.queries = query.queries.slice(1, 2);
11453
- query.params = query.params.slice(0, 0);
11444
+ const hasFilter = this.parent.grid.filterSettings &&
11445
+ Array.isArray(this.parent.grid.filterSettings.columns) &&
11446
+ this.parent.grid.filterSettings.columns.length > 0;
11447
+ const hasSearch = this.parent.grid.searchSettings &&
11448
+ typeof this.parent.grid.searchSettings.key === 'string' &&
11449
+ this.parent.grid.searchSettings.key.trim().length > 0;
11450
+ const hasSorting = this.parent.grid.sortSettings &&
11451
+ Array.isArray(this.parent.grid.sortSettings.columns) &&
11452
+ this.parent.grid.sortSettings.columns.length > 0;
11453
+ if (hasFilter || hasSearch || hasSorting) {
11454
+ query.queries = this.parent.grid.getDataModule().generateQuery().queries;
11455
+ query = ExportHelper.getQuery(this.parent.grid, data);
11456
+ if (isNullOrUndefined(this.parent.filterModule)) {
11457
+ query.queries = query.queries.slice(1, 2);
11458
+ query.params = query.params.slice(0, 0);
11459
+ }
11454
11460
  }
11455
11461
  setValue('query', query, property);
11456
11462
  }
@@ -11492,6 +11498,24 @@ class ExcelExport {
11492
11498
  if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
11493
11499
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
11494
11500
  }
11501
+ if (!this.isLocal() && !isNullOrUndefined(property) &&
11502
+ !isNullOrUndefined(property.isCollapsedStatePersist) &&
11503
+ property.isCollapsedStatePersist === false) {
11504
+ if (args.query && args.query.queries && args.query.queries.length) {
11505
+ args.query.queries = args.query.queries.filter((q) => {
11506
+ if (q.fn === 'onWhere' && q.e) {
11507
+ const preds = q.e;
11508
+ if (preds && preds.field === this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
11509
+ return false;
11510
+ }
11511
+ }
11512
+ return true;
11513
+ });
11514
+ }
11515
+ if (args.query && args.query.params && args.query.params.length) {
11516
+ args.query.params = args.query.params.filter((param) => param.key !== 'IdMapping');
11517
+ }
11518
+ }
11495
11519
  setValue('isExport', true, args);
11496
11520
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
11497
11521
  setValue('exportType', property.exportType, args);
@@ -11704,7 +11728,7 @@ class PdfExport {
11704
11728
  return query;
11705
11729
  }
11706
11730
  manipulatePdfProperties(prop, dtSrc, queryResult) {
11707
- let args = {};
11731
+ let args = Object();
11708
11732
  //count not required for this query
11709
11733
  const isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
11710
11734
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
@@ -15381,6 +15405,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
15381
15405
  (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
15382
15406
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
15383
15407
  }
15408
+ if (this.totalRecords < this.parent.pageSettings.pageSize) {
15409
+ this.startIndex = 0;
15410
+ }
15384
15411
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
15385
15412
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
15386
15413
  }