@syncfusion/ej2-treegrid 29.2.4 → 30.1.37

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.
Files changed (97) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +251 -149
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +311 -178
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +15 -51
  13. package/src/treegrid/actions/batch-edit.d.ts +1 -0
  14. package/src/treegrid/actions/batch-edit.js +57 -29
  15. package/src/treegrid/actions/clipboard.js +5 -8
  16. package/src/treegrid/actions/crud-actions.js +3 -1
  17. package/src/treegrid/actions/detail-row.js +7 -8
  18. package/src/treegrid/actions/edit.d.ts +1 -0
  19. package/src/treegrid/actions/edit.js +26 -11
  20. package/src/treegrid/actions/filter.js +2 -5
  21. package/src/treegrid/actions/rowdragdrop.js +7 -13
  22. package/src/treegrid/actions/sort.js +6 -1
  23. package/src/treegrid/actions/summary.js +2 -16
  24. package/src/treegrid/actions/toolbar.js +2 -2
  25. package/src/treegrid/base/data.js +34 -14
  26. package/src/treegrid/base/interface.d.ts +5 -1
  27. package/src/treegrid/base/treegrid-model.d.ts +8 -1
  28. package/src/treegrid/base/treegrid.d.ts +7 -0
  29. package/src/treegrid/base/treegrid.js +87 -53
  30. package/src/treegrid/renderer/virtual-row-model-generator.js +10 -13
  31. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
  32. package/src/treegrid/renderer/virtual-tree-content-render.js +65 -6
  33. package/styles/bds-lite.css +30 -0
  34. package/styles/bds.css +30 -0
  35. package/styles/bootstrap-dark-lite.css +30 -0
  36. package/styles/bootstrap-dark.css +30 -0
  37. package/styles/bootstrap-lite.css +30 -0
  38. package/styles/bootstrap.css +30 -0
  39. package/styles/bootstrap4-lite.css +30 -0
  40. package/styles/bootstrap4.css +30 -0
  41. package/styles/bootstrap5-dark-lite.css +30 -0
  42. package/styles/bootstrap5-dark.css +30 -0
  43. package/styles/bootstrap5-lite.css +30 -0
  44. package/styles/bootstrap5.3-lite.css +30 -0
  45. package/styles/bootstrap5.3.css +30 -0
  46. package/styles/bootstrap5.css +30 -0
  47. package/styles/fabric-dark-lite.css +30 -0
  48. package/styles/fabric-dark.css +30 -0
  49. package/styles/fabric-lite.css +30 -0
  50. package/styles/fabric.css +30 -0
  51. package/styles/fluent-dark-lite.css +30 -0
  52. package/styles/fluent-dark.css +30 -0
  53. package/styles/fluent-lite.css +30 -0
  54. package/styles/fluent.css +30 -0
  55. package/styles/fluent2-lite.css +30 -0
  56. package/styles/fluent2.css +30 -3
  57. package/styles/highcontrast-light-lite.css +30 -0
  58. package/styles/highcontrast-light.css +30 -0
  59. package/styles/highcontrast-lite.css +30 -0
  60. package/styles/highcontrast.css +30 -0
  61. package/styles/material-dark-lite.css +30 -0
  62. package/styles/material-dark.css +30 -0
  63. package/styles/material-lite.css +30 -0
  64. package/styles/material.css +30 -0
  65. package/styles/material3-dark-lite.css +30 -0
  66. package/styles/material3-dark.css +30 -0
  67. package/styles/material3-lite.css +30 -0
  68. package/styles/material3.css +30 -0
  69. package/styles/tailwind-dark-lite.css +30 -0
  70. package/styles/tailwind-dark.css +30 -0
  71. package/styles/tailwind-lite.css +30 -0
  72. package/styles/tailwind.css +30 -0
  73. package/styles/tailwind3-lite.css +30 -0
  74. package/styles/tailwind3.css +30 -0
  75. package/styles/treegrid/_bigger.scss +66 -66
  76. package/styles/treegrid/_layout.scss +39 -0
  77. package/styles/treegrid/bds.css +30 -0
  78. package/styles/treegrid/bootstrap-dark.css +30 -0
  79. package/styles/treegrid/bootstrap.css +30 -0
  80. package/styles/treegrid/bootstrap4.css +30 -0
  81. package/styles/treegrid/bootstrap5-dark.css +30 -0
  82. package/styles/treegrid/bootstrap5.3.css +30 -0
  83. package/styles/treegrid/bootstrap5.css +30 -0
  84. package/styles/treegrid/fabric-dark.css +30 -0
  85. package/styles/treegrid/fabric.css +30 -0
  86. package/styles/treegrid/fluent-dark.css +30 -0
  87. package/styles/treegrid/fluent.css +30 -0
  88. package/styles/treegrid/fluent2.css +30 -3
  89. package/styles/treegrid/highcontrast-light.css +30 -0
  90. package/styles/treegrid/highcontrast.css +30 -0
  91. package/styles/treegrid/material-dark.css +30 -0
  92. package/styles/treegrid/material.css +30 -0
  93. package/styles/treegrid/material3-dark.css +30 -0
  94. package/styles/treegrid/material3.css +30 -0
  95. package/styles/treegrid/tailwind-dark.css +30 -0
  96. package/styles/treegrid/tailwind.css +30 -0
  97. package/styles/treegrid/tailwind3.css +30 -0
@@ -247,6 +247,15 @@ var DataManipulation = /** @class */ (function () {
247
247
  if (parentRec) {
248
248
  records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
249
249
  }
250
+ else {
251
+ var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
252
+ if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
253
+ records[parseInt(rec.toString(), 10)].level = 1;
254
+ }
255
+ else {
256
+ records[parseInt(rec.toString(), 10)].level = parentRec_1.level + 1;
257
+ }
258
+ }
250
259
  }
251
260
  else {
252
261
  records[parseInt(rec.toString(), 10)].level = 0;
@@ -348,33 +357,33 @@ var DataManipulation = /** @class */ (function () {
348
357
  var _this = this;
349
358
  var args = { row: rowDetails.parentRow, data: rowDetails.record };
350
359
  var dm = this.parent.dataSource;
351
- var qry = this.parent.grid.getDataModule().generateQuery();
352
- var clonequries = qry.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
353
- qry.queries = clonequries;
354
- qry.isCountRequired = true;
360
+ var query = this.parent.grid.getDataModule().generateQuery();
361
+ var clonequries = query.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
362
+ query.queries = clonequries;
363
+ query.isCountRequired = true;
355
364
  var idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
356
365
  if (isNaN(idMappingValue)) {
357
366
  idMappingValue = rowDetails.record[this.parent.idMapping].toString();
358
367
  }
359
368
  if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
360
- qry.take(this.parent.pageSettings.pageSize);
369
+ query.take(this.parent.grid.pageSettings.pageSize);
361
370
  var expandDetail = [];
362
371
  expandDetail.push('ExpandingAction', idMappingValue.toString());
363
- qry.expand(expandDetail);
372
+ query.expand(expandDetail);
364
373
  }
365
374
  else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
366
- qry.take(this.parent.grid.pageSettings.pageSize);
375
+ query.take(this.parent.grid.pageSettings.pageSize);
367
376
  var expandDetail = [];
368
377
  expandDetail.push('CollapsingAction', idMappingValue.toString());
369
- qry.expand(expandDetail);
378
+ query.expand(expandDetail);
370
379
  }
371
- qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
380
+ query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
372
381
  if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
373
382
  var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
374
- qry.queries.push(filterqry[0]);
383
+ query.queries.push(filterqry[0]);
375
384
  }
376
385
  showSpinner(this.parent.element);
377
- dm.executeQuery(qry).then(function (e) {
386
+ dm.executeQuery(query).then(function (e) {
378
387
  var remoteExpandedData = 'remoteExpandedData';
379
388
  var remoteCollapsedData = 'remoteCollapsedData';
380
389
  var level = 'level';
@@ -437,7 +446,7 @@ var DataManipulation = /** @class */ (function () {
437
446
  else {
438
447
  rowDetails.record.childRecords = result;
439
448
  }
440
- for (var r = 0; r < result.length; r++) {
449
+ var _loop_2 = function (r) {
441
450
  var record = result[parseInt(r.toString(), 10)];
442
451
  if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
443
452
  _this.parent["" + remoteExpandedData].push(rowDetails.record);
@@ -547,8 +556,18 @@ var DataManipulation = /** @class */ (function () {
547
556
  record.expanded = false;
548
557
  }
549
558
  }
550
- datas.splice(inx + r + 1, 0, record);
559
+ var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
560
+ if (!exists) {
561
+ datas.splice(inx + r + 1, 0, record);
562
+ }
563
+ };
564
+ for (var r = 0; r < result.length; r++) {
565
+ _loop_2(r);
551
566
  }
567
+ var localIdMapping = _this.parent.idMapping;
568
+ datas.sort(function (firstRecord, secondRecord) {
569
+ return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
570
+ });
552
571
  setValue('result', datas, e);
553
572
  setValue('action', 'beforecontentrender', e);
554
573
  _this.parent.trigger(events.actionComplete, e);
@@ -591,7 +610,8 @@ var DataManipulation = /** @class */ (function () {
591
610
  var contentModule = getValue('grid.contentModule', this.parent);
592
611
  var currentInfo = getValue('currentInfo', contentModule);
593
612
  var prevInfo = getValue('prevInfo', contentModule);
594
- if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {
613
+ if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
614
+ && !this.parent.loadChildOnDemand) {
595
615
  this.parent.grid.pageSettings.currentPage = prevInfo.page;
596
616
  }
597
617
  };
@@ -1,5 +1,5 @@
1
1
  import { Column } from '../models/column';
2
- import { SaveEventArgs, DataStateChangeEventArgs as GridDataStateChangeEventArgs, ExcelExportProperties, RowDragEventArgs as GridRowDragEventArgs } from '@syncfusion/ej2-grids';
2
+ import { SaveEventArgs, DataStateChangeEventArgs as GridDataStateChangeEventArgs, ExcelExportProperties, RowDragEventArgs as GridRowDragEventArgs, ActionEventArgs as GridActionEventArgs } from '@syncfusion/ej2-grids';
3
3
  import { PdfExportProperties } from '@syncfusion/ej2-grids';
4
4
  /**
5
5
  * Specifies FlatData interfaces.
@@ -180,3 +180,7 @@ export interface DataStateChangeEventArgs extends GridDataStateChangeEventArgs {
180
180
  export interface RowDragEventArgs extends GridRowDragEventArgs {
181
181
  dropPosition: string;
182
182
  }
183
+ export interface ActionEventArgs extends GridActionEventArgs {
184
+ /** Maintains Treegrid's Collapse state in virtualization */
185
+ isCollapseMaintain?: boolean;
186
+ }
@@ -1,4 +1,4 @@
1
- import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ModuleDeclaration, extend, merge, SanitizeHtmlHelper} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue, NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs, Row, getNumberFormat } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';import { RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';import { LoadingIndicator } from '../models/loading-indicator';import { LoadingIndicatorModel } from '../models/loading-indicator-model';import { ActionEventArgs, TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectingEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred, UrlAdaptor } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';
1
+ import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ModuleDeclaration, extend, merge, SanitizeHtmlHelper} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue, NumberFormatOptions, DateFormatOptions } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs, Row, getNumberFormat } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';import { RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';import { LoadingIndicator } from '../models/loading-indicator';import { LoadingIndicatorModel } from '../models/loading-indicator-model';import { TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectingEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred, UrlAdaptor } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties, ActionEventArgs } from './interface';import { DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
4
  /**
@@ -481,6 +481,13 @@ export interface TreeGridModel extends ComponentModel{
481
481
  */
482
482
  enableImmutableMode?: boolean;
483
483
 
484
+ /**
485
+ * Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
486
+ *
487
+ * @default false
488
+ */
489
+ enableStickyHeader?: boolean;
490
+
484
491
  /**
485
492
  * Defines the scrollable height of the TreeGrid content.
486
493
  *
@@ -615,6 +615,12 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
615
615
  * @default false
616
616
  */
617
617
  enableImmutableMode: boolean;
618
+ /**
619
+ * Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
620
+ *
621
+ * @default false
622
+ */
623
+ enableStickyHeader: boolean;
618
624
  /**
619
625
  * Defines the scrollable height of the TreeGrid content.
620
626
  *
@@ -1317,6 +1323,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1317
1323
  private lastRowBorder;
1318
1324
  private isPixelHeight;
1319
1325
  private extendedGridDataBoundEvent;
1326
+ private lastRowBorderEventListener;
1320
1327
  private objectEqualityChecker;
1321
1328
  private bindCallBackEvents;
1322
1329
  private extendedGridEditEvents;
@@ -432,7 +432,7 @@ var TreeGrid = /** @class */ (function (_super) {
432
432
  parentTarget = target.parentElement;
433
433
  if (!isNullOrUndefined(parentTarget)) {
434
434
  var cellIndex = parentTarget.cellIndex;
435
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
435
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
436
436
  parentTarget = target;
437
437
  }
438
438
  summaryElement = this.findnextRowElement(parentTarget);
@@ -440,8 +440,11 @@ var TreeGrid = /** @class */ (function (_super) {
440
440
  var cellIndex_1 = target.cellIndex;
441
441
  var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
442
442
  if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
443
- addClass([row_1], 'e-focused');
444
- addClass([row_1], 'e-focus');
443
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
444
+ focusedCells.forEach(function (cell) {
445
+ removeClass([cell], ['e-focused', 'e-focus']);
446
+ });
447
+ addClass([row_1], ['e-focused', 'e-focus']);
445
448
  }
446
449
  }
447
450
  else {
@@ -461,7 +464,7 @@ var TreeGrid = /** @class */ (function (_super) {
461
464
  parentTarget = target.parentElement;
462
465
  if (!isNullOrUndefined(parentTarget)) {
463
466
  var cellIndex = parentTarget.cellIndex;
464
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
467
+ if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
465
468
  parentTarget = target;
466
469
  }
467
470
  summaryElement = this.findPreviousRowElement(parentTarget);
@@ -470,8 +473,11 @@ var TreeGrid = /** @class */ (function (_super) {
470
473
  if (!isNullOrUndefined(cellIndex_2)) {
471
474
  var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
472
475
  if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
473
- addClass([row_2], 'e-focused');
474
- addClass([row_2], 'e-focus');
476
+ var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
477
+ focusedCells.forEach(function (cell) {
478
+ removeClass([cell], ['e-focused', 'e-focus']);
479
+ });
480
+ addClass([row_2], ['e-focused', 'e-focus']);
475
481
  }
476
482
  }
477
483
  }
@@ -838,11 +844,14 @@ var TreeGrid = /** @class */ (function (_super) {
838
844
  var destroyTemplate = 'destroyTemplate';
839
845
  var destroyTemplateFn = this.grid["" + destroyTemplate];
840
846
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
841
- this.grid["" + destroyTemplate] = function (args, index) {
847
+ this.grid["" + destroyTemplate] = function (args, index, callback) {
842
848
  destroyTemplateFn.apply(_this.grid);
843
849
  var portals = 'portals';
844
850
  if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
845
- _this.clearTemplate(args, index);
851
+ _this.clearTemplate(args, index, callback);
852
+ }
853
+ else if (!isNullOrUndefined(callback)) {
854
+ callback();
846
855
  }
847
856
  };
848
857
  };
@@ -938,18 +947,24 @@ var TreeGrid = /** @class */ (function (_super) {
938
947
  this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
939
948
  };
940
949
  TreeGrid.prototype.convertTreeData = function (data) {
941
- var _this = this;
942
950
  if (isCountRequired(this)) {
943
951
  data = getValue('result', data);
944
952
  }
945
953
  if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
946
954
  this.flatData = data;
947
- this.flatData.filter(function (e) {
948
- setValue('uniqueIDCollection.' + e.uniqueID, e, _this);
949
- if (e.level === 0 && !_this.parentData.some(function (record) { return record.uniqueID === e.uniqueID; })) {
950
- _this.parentData.push(e);
955
+ var _loop_1 = function (i, len) {
956
+ var rowData = this_1.flatData[parseInt(i.toString(), 10)];
957
+ setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
958
+ if (rowData.level === 0 && !this_1.parentData.some(function (record) {
959
+ return record.uniqueID === rowData.uniqueID;
960
+ })) {
961
+ this_1.parentData.push(rowData);
951
962
  }
952
- });
963
+ };
964
+ var this_1 = this;
965
+ for (var i = 0, len = this.flatData.length; i < len; i++) {
966
+ _loop_1(i, len);
967
+ }
953
968
  }
954
969
  else {
955
970
  if (isCountRequired(this)) {
@@ -1039,6 +1054,9 @@ var TreeGrid = /** @class */ (function (_super) {
1039
1054
  this.grid["" + isJsComponent] = true;
1040
1055
  var enableHtmlSanitizer = 'enableHtmlSanitizer';
1041
1056
  this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
1057
+ this.grid.enableStickyHeader = this.enableStickyHeader;
1058
+ var isTreeGrid = 'isTreeGrid';
1059
+ this.grid["" + isTreeGrid] = true;
1042
1060
  };
1043
1061
  TreeGrid.prototype.triggerEvents = function (args) {
1044
1062
  this.trigger(getObject('name', args), args);
@@ -1176,6 +1194,7 @@ var TreeGrid = /** @class */ (function (_super) {
1176
1194
  TreeGrid.prototype.extendedGridDataBoundEvent = function () {
1177
1195
  var _this = this;
1178
1196
  this.grid.dataBound = function (args) {
1197
+ _this.lastRowBorderEventListener();
1179
1198
  _this.updateRowTemplate();
1180
1199
  _this.updateColumnModel();
1181
1200
  _this.updateAltRow(_this.getRows());
@@ -1268,6 +1287,9 @@ var TreeGrid = /** @class */ (function (_super) {
1268
1287
  }
1269
1288
  };
1270
1289
  };
1290
+ TreeGrid.prototype.lastRowBorderEventListener = function () {
1291
+ this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
1292
+ };
1271
1293
  TreeGrid.prototype.bindCallBackEvents = function () {
1272
1294
  var _this = this;
1273
1295
  this.grid.toolbarClick = function (args) {
@@ -1435,6 +1457,7 @@ var TreeGrid = /** @class */ (function (_super) {
1435
1457
  if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
1436
1458
  args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
1437
1459
  args.cancel = true;
1460
+ return;
1438
1461
  }
1439
1462
  var requestType = getObject('requestType', args);
1440
1463
  if (requestType === 'reorder') {
@@ -1495,12 +1518,12 @@ var TreeGrid = /** @class */ (function (_super) {
1495
1518
  _this.grid.refresh();
1496
1519
  }
1497
1520
  if (args.action === 'filter') {
1498
- if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1521
+ if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1499
1522
  _this.expandAll();
1500
1523
  }
1501
1524
  }
1502
1525
  if (args.requestType === 'searching') {
1503
- if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1526
+ if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1504
1527
  _this.expandAll();
1505
1528
  }
1506
1529
  }
@@ -1625,6 +1648,7 @@ var TreeGrid = /** @class */ (function (_super) {
1625
1648
  * @returns {void}
1626
1649
  */
1627
1650
  TreeGrid.prototype.autoGenerateColumns = function () {
1651
+ var _this = this;
1628
1652
  if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
1629
1653
  this.columns = [];
1630
1654
  // if (this.dataSource instanceof DataManager) {
@@ -1633,11 +1657,7 @@ var TreeGrid = /** @class */ (function (_super) {
1633
1657
  var record = this.dataSource[0];
1634
1658
  // }
1635
1659
  var keys = Object.keys(record);
1636
- for (var i = 0; i < keys.length; i++) {
1637
- if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
1638
- this.columns.push(keys[parseInt(i.toString(), 10)]);
1639
- }
1640
- }
1660
+ this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
1641
1661
  }
1642
1662
  };
1643
1663
  TreeGrid.prototype.getGridEditSettings = function () {
@@ -1791,8 +1811,9 @@ var TreeGrid = /** @class */ (function (_super) {
1791
1811
  gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
1792
1812
  }
1793
1813
  else {
1794
- for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
1795
- var prop = _a[_i];
1814
+ var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
1815
+ for (var j = 0; j < columnProps.length; j++) {
1816
+ var prop = columnProps[parseInt(j.toString(), 10)];
1796
1817
  if (index === this.treeColumnIndex && prop === 'template') {
1797
1818
  treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
1798
1819
  }
@@ -1963,6 +1984,7 @@ var TreeGrid = /** @class */ (function (_super) {
1963
1984
  break;
1964
1985
  case 'rowHeight':
1965
1986
  this.grid.rowHeight = this.rowHeight;
1987
+ this.refresh();
1966
1988
  break;
1967
1989
  case 'height':
1968
1990
  if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
@@ -2038,6 +2060,9 @@ var TreeGrid = /** @class */ (function (_super) {
2038
2060
  case 'columnMenuItems':
2039
2061
  this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
2040
2062
  break;
2063
+ case 'enableStickyHeader':
2064
+ this.grid.enableStickyHeader = this.enableStickyHeader;
2065
+ break;
2041
2066
  case 'editSettings':
2042
2067
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
2043
2068
  (newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
@@ -2925,14 +2950,7 @@ var TreeGrid = /** @class */ (function (_super) {
2925
2950
  * @returns {Column[]} - Returns an array of visible column objects.
2926
2951
  */
2927
2952
  TreeGrid.prototype.getVisibleColumns = function () {
2928
- var cols = [];
2929
- for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {
2930
- var col = _a[_i];
2931
- if (col.visible) {
2932
- cols.push(col);
2933
- }
2934
- }
2935
- return cols;
2953
+ return this.columnModel.filter(function (col) { return col.visible; });
2936
2954
  };
2937
2955
  /**
2938
2956
  * Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
@@ -3060,17 +3078,14 @@ var TreeGrid = /** @class */ (function (_super) {
3060
3078
  TreeGrid.prototype.getTreeColumn = function () {
3061
3079
  var columnModel = 'columnModel';
3062
3080
  var treeColumn = this["" + columnModel][this.treeColumnIndex];
3063
- var treeIndex;
3064
3081
  var updatedCols = this.getColumns();
3065
- for (var f = 0; f < updatedCols.length; f++) {
3066
- var treeColumnfield = getObject('field', treeColumn);
3067
- var parentColumnfield = getObject('field', updatedCols[parseInt(f.toString(), 10)]);
3068
- if (treeColumnfield === parentColumnfield) {
3069
- treeIndex = f;
3070
- break;
3071
- }
3082
+ var treeColumnField = getObject('field', treeColumn);
3083
+ var treeIndex = updatedCols.findIndex(function (col) {
3084
+ return getObject('field', col) === treeColumnField;
3085
+ });
3086
+ if (!isNullOrUndefined(treeIndex)) {
3087
+ this.setProperties({ treeColumnIndex: treeIndex }, true);
3072
3088
  }
3073
- this.setProperties({ treeColumnIndex: treeIndex }, true);
3074
3089
  };
3075
3090
  /**
3076
3091
  * Refreshes the header section of the TreeGrid to reflect any structural or data changes.
@@ -3393,14 +3408,14 @@ var TreeGrid = /** @class */ (function (_super) {
3393
3408
  };
3394
3409
  TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
3395
3410
  if (isPaging === void 0) { isPaging = false; }
3396
- var _loop_1 = function (i) {
3411
+ var _loop_2 = function (i) {
3397
3412
  if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
3398
3413
  var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
3399
- var parentItem = this_1.flatData.filter(function (e) {
3414
+ var parentItem = this_2.flatData.filter(function (e) {
3400
3415
  return e.uniqueID === puniqueID_1;
3401
3416
  });
3402
- if (isRemoteData(this_1)) {
3403
- parentItem = this_1.getCurrentViewRecords().filter(function (e) {
3417
+ if (isRemoteData(this_2)) {
3418
+ parentItem = this_2.getCurrentViewRecords().filter(function (e) {
3404
3419
  return e.uniqueID === puniqueID_1;
3405
3420
  });
3406
3421
  }
@@ -3409,7 +3424,7 @@ var TreeGrid = /** @class */ (function (_super) {
3409
3424
  parentItem[0].expanded = true;
3410
3425
  }
3411
3426
  else {
3412
- if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
3427
+ if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
3413
3428
  if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
3414
3429
  record.push(parentItem[0]);
3415
3430
  }
@@ -3417,12 +3432,12 @@ var TreeGrid = /** @class */ (function (_super) {
3417
3432
  }
3418
3433
  }
3419
3434
  if (!isPaging) {
3420
- this_1.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
3435
+ this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
3421
3436
  }
3422
3437
  };
3423
- var this_1 = this;
3438
+ var this_2 = this;
3424
3439
  for (var i = 0; i < record.length; i++) {
3425
- _loop_1(i);
3440
+ _loop_2(i);
3426
3441
  }
3427
3442
  if (isPaging) {
3428
3443
  this.expandRow(null, record, key, level);
@@ -3526,8 +3541,12 @@ var TreeGrid = /** @class */ (function (_super) {
3526
3541
  if (this.editSettings.mode === 'Batch') {
3527
3542
  var obj = 'dialogObj';
3528
3543
  var showDialog = 'showDialog';
3529
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
3530
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
3544
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
3545
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
3546
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
3547
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
3548
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
3549
+ if (hasChanges && this.editSettings.showConfirmDialog) {
3531
3550
  var dialogObj = this.grid.editModule["" + obj];
3532
3551
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
3533
3552
  return;
@@ -3553,8 +3572,12 @@ var TreeGrid = /** @class */ (function (_super) {
3553
3572
  if (this.editSettings.mode === 'Batch') {
3554
3573
  var obj = 'dialogObj';
3555
3574
  var showDialog = 'showDialog';
3556
- if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
3557
- this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
3575
+ var changes = this.getBatchChanges ? this.getBatchChanges() : {};
3576
+ var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
3577
+ var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
3578
+ var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
3579
+ var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
3580
+ if (hasChanges && this.editSettings.showConfirmDialog) {
3558
3581
  var dialogObj = this.grid.editModule["" + obj];
3559
3582
  this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
3560
3583
  return;
@@ -3844,6 +3867,8 @@ var TreeGrid = /** @class */ (function (_super) {
3844
3867
  TreeGrid.prototype.remoteExpand = function (action, row, record) {
3845
3868
  var gridRows = this.getRows();
3846
3869
  var fetchRemoteChildData = 'fetchRemoteChildData';
3870
+ var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
3871
+ this.grid.contentModule.requestType = requestType;
3847
3872
  if (this.rowTemplate) {
3848
3873
  var rows_1 = this.getContentTable().rows;
3849
3874
  gridRows = [].slice.call(rows_1);
@@ -3918,6 +3943,13 @@ var TreeGrid = /** @class */ (function (_super) {
3918
3943
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
3919
3944
  gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
3920
3945
  }
3946
+ if (this.detailTemplate) {
3947
+ gridRows.forEach(function (row) {
3948
+ if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
3949
+ row.style.display = '';
3950
+ }
3951
+ });
3952
+ }
3921
3953
  var detailrows = gridRows.filter(function (r) {
3922
3954
  return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
3923
3955
  });
@@ -4082,7 +4114,6 @@ var TreeGrid = /** @class */ (function (_super) {
4082
4114
  TreeGrid.prototype.addListener = function () {
4083
4115
  this.on('updateResults', this.updateResultModel, this);
4084
4116
  this.grid.on('initial-end', this.afterGridRender, this);
4085
- this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
4086
4117
  };
4087
4118
  TreeGrid.prototype.updateResultModel = function (returnResult) {
4088
4119
  this.dataResults = returnResult;
@@ -4675,6 +4706,9 @@ var TreeGrid = /** @class */ (function (_super) {
4675
4706
  __decorate([
4676
4707
  Property(false)
4677
4708
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
4709
+ __decorate([
4710
+ Property(false)
4711
+ ], TreeGrid.prototype, "enableStickyHeader", void 0);
4678
4712
  __decorate([
4679
4713
  Property('auto')
4680
4714
  ], TreeGrid.prototype, "height", void 0);
@@ -15,7 +15,7 @@ import { VirtualRowModelGenerator } from '@syncfusion/ej2-grids';
15
15
  import * as events from '../base/constant';
16
16
  import { isNullOrUndefined } from '@syncfusion/ej2-base';
17
17
  import { DataManager } from '@syncfusion/ej2-data';
18
- import { isCountRequired } from '../utils';
18
+ import { isCountRequired, isRemoteData } from '../utils';
19
19
  /**
20
20
  * RowModelGenerator is used to generate grid data rows.
21
21
  *
@@ -38,19 +38,13 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
38
38
  return _super.prototype.getData.call(this);
39
39
  };
40
40
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
41
- if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
42
- notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
43
- this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
44
- }
45
- else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
46
- notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
47
- this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
48
- }
49
41
  var info = this.getDataInfo();
50
- if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
42
+ if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
43
+ notifyArgs.virtualInfo = this['prevInfo'];
44
+ }
45
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
51
46
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
52
- if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
53
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
47
+ if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
54
48
  || notifyArgs.virtualInfo.blockIndexes.length === 1) {
55
49
  notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
56
50
  }
@@ -94,7 +88,10 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
94
88
  else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
95
89
  this.cache[parseInt(currentPage.toString(), 10)].length >
96
90
  (this.parent.contentModule).getBlockSize()) {
97
- delete this.cache[parseInt(currentPage.toString(), 10)];
91
+ if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
92
+ this.cache[parseInt(currentPage.toString(), 10)] =
93
+ this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
94
+ }
98
95
  }
99
96
  }
100
97
  else {
@@ -197,6 +197,7 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
197
197
  * @returns {void} This method does not return any value.
198
198
  */
199
199
  private restoreEditState;
200
+ private SetVirtualPageQury;
200
201
  /**
201
202
  * Resets the edit state if certain conditions are met.
202
203
  *