@syncfusion/ej2-treegrid 32.2.9 → 33.1.45

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 (33) hide show
  1. package/dist/ej2-treegrid.min.js +2 -2
  2. package/dist/ej2-treegrid.umd.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +237 -70
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +244 -71
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +2 -2
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +5 -5
  12. package/src/treegrid/actions/batch-edit.js +1 -1
  13. package/src/treegrid/actions/edit.js +3 -0
  14. package/src/treegrid/actions/filter.js +20 -0
  15. package/src/treegrid/actions/rowdragdrop.js +17 -4
  16. package/src/treegrid/actions/virtual-scroll.js +2 -1
  17. package/src/treegrid/base/data.js +2 -33
  18. package/src/treegrid/base/treegrid-model.d.ts +1 -1
  19. package/src/treegrid/base/treegrid.d.ts +34 -0
  20. package/src/treegrid/base/treegrid.js +124 -4
  21. package/src/treegrid/renderer/render.js +15 -0
  22. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +4 -5
  23. package/src/treegrid/renderer/virtual-tree-content-render.js +62 -29
  24. package/styles/fluent2.css +1 -0
  25. package/styles/material3-dark-lite.css +2 -2
  26. package/styles/material3-dark.css +2 -2
  27. package/styles/material3-lite.css +2 -2
  28. package/styles/material3.css +2 -2
  29. package/styles/treegrid/_bigger.scss +3 -0
  30. package/styles/treegrid/fluent2.css +1 -0
  31. package/styles/treegrid/icons/_material3.scss +2 -2
  32. package/styles/treegrid/material3-dark.css +2 -2
  33. package/styles/treegrid/material3.css +2 -2
@@ -1,5 +1,5 @@
1
1
  import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
2
- import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, getRowIndexFromElement, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
2
+ import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, setEnableSeamlessScrolling, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, getRowIndexFromElement, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { DataManager, ODataAdaptor, WebApiAdaptor, WebMethodAdaptor, CacheAdaptor, UrlAdaptor, Query, DataUtil, RemoteSaveAdaptor, Deferred, JsonAdaptor, Predicate as Predicate$1 } from '@syncfusion/ej2-data';
5
5
  import { showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
@@ -2180,6 +2180,16 @@ var Render = /** @__PURE__ @class */ (function () {
2180
2180
  }
2181
2181
  var data = args.data;
2182
2182
  var parentData = data.parentItem;
2183
+ if (!isNullOrUndefined(parentData) && data.isCollapsedChild && !isNullOrUndefined(args.row)) {
2184
+ this.parent['toggleRowVisibility'](args.row, 'e-childrow-hidden');
2185
+ var rowsObj = this.parent.grid.getRowsObject();
2186
+ if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
2187
+ var row = rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0];
2188
+ if (row) {
2189
+ row.visible = false;
2190
+ }
2191
+ }
2192
+ }
2183
2193
  if (!isNullOrUndefined(data.parentItem) && !isFilterChildHierarchy(this.parent) &&
2184
2194
  (!(this.parent.allowPaging && !(this.parent.pageSettings.pageSizeMode === 'Root')) ||
2185
2195
  (isRemoteData(this.parent) && !isOffline(this.parent)))) {
@@ -2208,6 +2218,11 @@ var Render = /** @__PURE__ @class */ (function () {
2208
2218
  var summaryRow = getObject('isSummaryRow', args.data);
2209
2219
  if (summaryRow) {
2210
2220
  addClass([args.row], 'e-summaryrow');
2221
+ var isDragandDropCell = args.row.querySelector('.e-rowdragdrop') || args.row.querySelector('.e-rowdragdrop.e-dragging');
2222
+ if (isDragandDropCell) {
2223
+ args.row.cells[0].className = 'e-rowcell e-summarycell';
2224
+ args.row.cells[0].innerHTML = '';
2225
+ }
2211
2226
  }
2212
2227
  if (!isNullOrUndefined(args.row)) {
2213
2228
  if (args.row.querySelector('.e-treegridexpand')) {
@@ -3311,7 +3326,6 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3311
3326
  var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
3312
3327
  var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
3313
3328
  : results.length;
3314
- var qry = new Query();
3315
3329
  var gridQuery = getObject('query', args);
3316
3330
  var filterQuery;
3317
3331
  var searchQuery;
@@ -3327,11 +3341,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3327
3341
  gridQuery = getValue('grid.renderModule.data', this.parent).filterQuery(gridQuery);
3328
3342
  gridQuery = getValue('grid.renderModule.data', this.parent).searchQuery(gridQuery);
3329
3343
  }
3330
- var fltrQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
3331
- var srchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
3332
- qry.queries = fltrQuery.concat(srchQuery);
3333
- var filteredData = new DataManager(results).executeLocal(qry);
3334
- this.parent.notify('updateFilterRecs', { data: filteredData });
3344
+ this.parent.getData({ query: gridQuery, isFilter: true });
3335
3345
  results = this.dataResults.result;
3336
3346
  this.dataResults.result = null;
3337
3347
  if (this.parent.grid.aggregates.length > 0) {
@@ -3356,34 +3366,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3356
3366
  }
3357
3367
  if (this.parent.grid.sortSettings.columns.length > 0 || this.isSortAction) {
3358
3368
  this.isSortAction = false;
3359
- var parentData = this.parent.parentData;
3360
3369
  var query = getObject('query', args);
3361
- var srtQry = new Query();
3362
- for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
3363
- var getColumnByField = 'getColumnByField';
3364
- var col = this.parent.grid.renderModule.data["" + getColumnByField](this.parent.grid.
3365
- sortSettings.columns[parseInt(srt.toString(), 10)].field);
3366
- var compFun = col.sortComparer && isOffline(this.parent) ?
3367
- col.sortComparer.bind(col) :
3368
- this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].direction;
3369
- srtQry.sortBy(this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].field, compFun);
3370
- }
3371
- var modifiedData = new DataManager(parentData).executeLocal(srtQry);
3372
- if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
3373
- this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
3374
- var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
3375
- modifiedData.splice(dragdIndex, 1);
3376
- var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
3377
- if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
3378
- modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
3379
- }
3380
- else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
3381
- modifiedData.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);
3382
- }
3383
- }
3384
- var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };
3385
- this.parent.notify('createSort', sortArgs);
3386
- results = sortArgs.modifiedData;
3370
+ results = this.parent.getData({ query: query, isSort: true });
3387
3371
  this.dataResults.result = null;
3388
3372
  this.sortedData = results;
3389
3373
  this.parent.notify('updateModel', {});
@@ -4351,6 +4335,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4351
4335
  _this.isComponentRefresh = false;
4352
4336
  _this.isVirtualExpandCollapse = false;
4353
4337
  _this.isInfiniteCollapse = false;
4338
+ /** @hidden */
4339
+ _this.enableSeamlessScrolling = false;
4354
4340
  _this.objectEqualityChecker = function (old, current) {
4355
4341
  if (old) {
4356
4342
  var keys = Object.keys(old);
@@ -5098,7 +5084,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5098
5084
  this.renderModule = new Render(this);
5099
5085
  this.dataModule = new DataManipulation(this);
5100
5086
  this.printModule = new Print(this);
5101
- this.trigger(load);
5087
+ if (this.enableVirtualization || this.enableColumnVirtualization) {
5088
+ var args = { enableSeamlessScrolling: this.enableSeamlessScrolling };
5089
+ this.trigger(load, args);
5090
+ this.enableSeamlessScrolling = args.enableSeamlessScrolling;
5091
+ setEnableSeamlessScrolling(this.enableSeamlessScrolling);
5092
+ }
5093
+ else {
5094
+ this.trigger(load);
5095
+ }
5102
5096
  this.autoGenerateColumns();
5103
5097
  this.initialRender = true;
5104
5098
  if (!isNullOrUndefined(this.dataSource)) {
@@ -5371,6 +5365,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5371
5365
  this.grid.clipMode = getActualProperties(this.clipMode);
5372
5366
  this.grid.enableColumnSpan = this.enableColumnSpan;
5373
5367
  this.grid.enableRowSpan = this.enableRowSpan;
5368
+ this.grid.enableSeamlessScrolling = this.enableSeamlessScrolling;
5374
5369
  var templateInstance = 'templateDotnetInstance';
5375
5370
  this.grid["" + templateInstance] = this["" + templateInstance];
5376
5371
  var isJsComponent = 'isJsComponent';
@@ -5848,7 +5843,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5848
5843
  }
5849
5844
  _this.notify('updateGridActions', args);
5850
5845
  _this.isVirtualExpandCollapse = false;
5851
- if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
5846
+ if (args.requestType === 'save' && _this.aggregates.some(function (ag) { return ag.showChildSummary === true; })) {
5852
5847
  _this.grid.refresh();
5853
5848
  }
5854
5849
  if ((args.action === 'clearFilter' || args.action === 'clear-filter' || args.requestType === 'sorting') && _this.enableInfiniteScrolling) {
@@ -6594,6 +6589,115 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6594
6589
  }
6595
6590
  }
6596
6591
  };
6592
+ /**
6593
+ * Retrieves all records that match the current search criteria and are sorted according to the active sort settings.
6594
+ *
6595
+ * This method processes the data source by applying search filters and sort operations,
6596
+ * returning the searched and sorted records excluding summary rows.
6597
+ *
6598
+ * @param {Object} args - Optional arguments object to control query execution behavior.
6599
+ * @param {Query} args.query - Optional custom Query object to override the default generated query.
6600
+ * @param {boolean} args.isFilter - Optional flag to include only filtered records without sorting (default: false).
6601
+ * @param {boolean} args.isSort - Optional flag to apply only sorting without filtering (default: false).
6602
+ *
6603
+ * @returns {ITreeData[]} - Array of searched and sorted TreeGrid records with summary rows excluded.
6604
+ * @hidden
6605
+ */
6606
+ TreeGrid.prototype.getData = function (args) {
6607
+ var dataObj = isCountRequired(this) ? getValue('result', this.grid.dataSource)
6608
+ : this.grid.dataSource;
6609
+ var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
6610
+ var gridQuery = (!isNullOrUndefined(args) && args.query) ? args.query : this.getDataModule().baseModule.generateQuery();
6611
+ var filterQuery;
6612
+ var searchQuery;
6613
+ if (!isNullOrUndefined(gridQuery)) {
6614
+ filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
6615
+ searchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
6616
+ }
6617
+ var skipFilterSearch = (!isNullOrUndefined(args) && args.isSort);
6618
+ if (!skipFilterSearch && (this.grid.allowFiltering && this.grid.filterSettings.columns.length) ||
6619
+ (this.grid.searchSettings.key.length > 0) && (!isNullOrUndefined(gridQuery))
6620
+ || ((filterQuery && filterQuery.length > 0) || (searchQuery && searchQuery.length > 0))) {
6621
+ var filterQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
6622
+ var searchQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
6623
+ var query = new Query();
6624
+ query.queries = filterQuery_1.concat(searchQuery_1);
6625
+ var filteredData = new DataManager(results).executeLocal(query);
6626
+ this.notify('updateFilterRecs', { data: filteredData });
6627
+ results = isRemoteData(this) ? this.dataResults : this.filterModule.filteredResult;
6628
+ if (!isNullOrUndefined(args) && args.isFilter) {
6629
+ return isRemoteData(this) ? results.result.filter(function (item) { return !item.isSummaryRow; })
6630
+ : results.filter(function (item) { return !item.isSummaryRow; });
6631
+ }
6632
+ }
6633
+ var sortQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSortBy'; });
6634
+ if (this.grid.sortSettings.columns.length > 0 || sortQuery.length) {
6635
+ var parentData = this.parentData;
6636
+ var query = new Query();
6637
+ query.queries = sortQuery;
6638
+ var modifiedData = new DataManager(parentData).executeLocal(query);
6639
+ if (this.allowRowDragAndDrop && !isNullOrUndefined(this.rowDragAndDropModule['draggedRecord']) &&
6640
+ this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
6641
+ var dragdIndex = modifiedData.indexOf(this.rowDragAndDropModule['draggedRecord']);
6642
+ modifiedData.splice(dragdIndex, 1);
6643
+ var dropdIndex = modifiedData.indexOf(this.rowDragAndDropModule['droppedRecord']);
6644
+ if (this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] === 'topSegment') {
6645
+ modifiedData.splice(dropdIndex, 0, this.rowDragAndDropModule['draggedRecord']);
6646
+ }
6647
+ else if (this.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
6648
+ modifiedData.splice(dropdIndex + 1, 0, this.rowDragAndDropModule['draggedRecord']);
6649
+ }
6650
+ }
6651
+ var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: query };
6652
+ this.notify('createSort', sortArgs);
6653
+ results = isRemoteData(this) ? this.dataResults : sortArgs.modifiedData;
6654
+ }
6655
+ return isRemoteData(this) ? this.dataResults.result.filter(function (item) { return !item.isSummaryRow; })
6656
+ : results.filter(function (item) { return !item.isSummaryRow; });
6657
+ };
6658
+ /**
6659
+ * Retrieves the processed Tree Grid data based on current operations such as
6660
+ * sorting, filtering, and searching. Maintains hierarchy and current structure.
6661
+ *
6662
+ * For local data: when skipPage is true (the default), it returns all available records;
6663
+ * when skipPage is false, it returns only the records for the current page.
6664
+ * For remote data: it always returns only the records for the current page.
6665
+ *
6666
+ * @param {boolean} skipPage - if set to false, returns only the records for the current page.
6667
+ * @returns {ITreeData[]} - Array of tree records (summary rows excluded).
6668
+ * @hidden
6669
+ */
6670
+ TreeGrid.prototype.getProcessedRecords = function (skipPage) {
6671
+ var _this = this;
6672
+ var result;
6673
+ if (skipPage !== true || isRemoteData(this)) {
6674
+ result = this.getData();
6675
+ var dm = new DataManager(result);
6676
+ var expanded = new Predicate$1('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
6677
+ var parents_1 = dm.executeLocal(new Query().where(expanded));
6678
+ var visualData = parents_1.filter(function (e) {
6679
+ return getExpandStatus(_this, e);
6680
+ });
6681
+ var query = new Query();
6682
+ if (this.allowPaging || this.enableVirtualization || this.enableInfiniteScrolling) {
6683
+ var pageSize = this.grid.pageSettings.pageSize;
6684
+ var currentPage = this.grid.pageSettings.currentPage;
6685
+ if (visualData.length < (currentPage * pageSize)) {
6686
+ currentPage = (Math.floor(visualData.length / pageSize)) + ((visualData.length % pageSize) ? 1 : 0);
6687
+ currentPage = currentPage ? currentPage : 1;
6688
+ this.grid.setProperties({ pageSettings: { currentPage: currentPage } }, true);
6689
+ }
6690
+ var skip = pageSize * (currentPage - 1);
6691
+ query = query.skip(skip).take(pageSize);
6692
+ }
6693
+ dm.dataSource.json = visualData;
6694
+ result = dm.executeLocal(query);
6695
+ }
6696
+ else {
6697
+ result = this.getData();
6698
+ }
6699
+ return result;
6700
+ };
6597
6701
  /**
6598
6702
  * Retrieves all the TreeGrid row elements.
6599
6703
  *
@@ -10010,8 +10114,10 @@ var RowDD = /** @__PURE__ @class */ (function () {
10010
10114
  var record = this.getChildrecordsByParentID(droppedRecord.parentUniqueID)[0];
10011
10115
  var childRecords = record.childRecords;
10012
10116
  for (var i = 0; i < childRecords.length; i++) {
10013
- droppedRecord.parentItem.taskData[this.parent.childMapping][parseInt(i.toString(), 10)]
10014
- = childRecords[parseInt(i.toString(), 10)].taskData;
10117
+ if (!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].taskData)) {
10118
+ droppedRecord.parentItem.taskData[this.parent.childMapping][parseInt(i.toString(), 10)]
10119
+ = childRecords[parseInt(i.toString(), 10)].taskData;
10120
+ }
10015
10121
  }
10016
10122
  }
10017
10123
  }
@@ -10597,6 +10703,11 @@ var RowDD = /** @__PURE__ @class */ (function () {
10597
10703
  * @returns {void} This function does not return a value.
10598
10704
  */
10599
10705
  RowDD.prototype.rowDropped = function (args) {
10706
+ if (!isNullOrUndefined(this.parent.aggregates[0]) && this.parent.aggregates[0].showChildSummary) {
10707
+ var records = this.parent.grid.getCurrentViewRecords();
10708
+ args.fromIndex = records[args.fromIndex].index;
10709
+ args.dropIndex = records[args.dropIndex].index;
10710
+ }
10600
10711
  var tObj = this.parent;
10601
10712
  var parentItem = 'parentItem';
10602
10713
  if (!tObj.rowDropSettings.targetID) {
@@ -10821,10 +10932,16 @@ var RowDD = /** @__PURE__ @class */ (function () {
10821
10932
  var droppedRecord = void 0;
10822
10933
  if (isNullOrUndefined(args.dropIndex)) {
10823
10934
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
10824
- var rowIndex = tObj.selectedRowIndex === -1 ?
10935
+ var rowIndex_1 = tObj.selectedRowIndex === -1 ?
10825
10936
  (this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField])) - 1
10826
10937
  : tObj.getSelectedRowIndexes()[0] - 1;
10827
- var record = tObj.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
10938
+ var record = void 0;
10939
+ if (this.parent.enableVirtualization) {
10940
+ record = tObj.getCurrentViewRecords().find(function (e) { return e.index === rowIndex_1; });
10941
+ }
10942
+ else {
10943
+ record = tObj.getCurrentViewRecords()[parseInt(rowIndex_1.toString(), 10)];
10944
+ }
10828
10945
  this.getParentData(record, args.data);
10829
10946
  }
10830
10947
  else {
@@ -11640,6 +11757,25 @@ var Filter = /** @__PURE__ @class */ (function () {
11640
11757
  if (this.flatFilteredData.length > 0 && this.isHierarchyFilter) {
11641
11758
  this.updateFilterLevel();
11642
11759
  }
11760
+ var _loop_1 = function (i) {
11761
+ var record = this_1.filteredResult[parseInt(i.toString(), 10)];
11762
+ if (!isNullOrUndefined(record.parentItem)) {
11763
+ var parentUID_1 = record.parentItem.uniqueID;
11764
+ var parentPresent = this_1.filteredResult.some(function (r) {
11765
+ return !isNullOrUndefined(r.uniqueID) && r.uniqueID === parentUID_1;
11766
+ });
11767
+ if (parentPresent) {
11768
+ record.isCollapsedChild = !getExpandStatus(this_1.parent, record, this_1.parent.parentData);
11769
+ }
11770
+ else {
11771
+ record.isCollapsedChild = false;
11772
+ }
11773
+ }
11774
+ };
11775
+ var this_1 = this;
11776
+ for (var i = 0; i < this.filteredResult.length; i++) {
11777
+ _loop_1(i);
11778
+ }
11643
11779
  this.parent.notify('updateAction', { result: this.filteredResult });
11644
11780
  };
11645
11781
  Filter.prototype.updateParentFilteredRecord = function (record) {
@@ -13360,7 +13496,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
13360
13496
  added.childRecords = [];
13361
13497
  this.batchRecords.splice(added.index, 0, added);
13362
13498
  this.currentViewRecords.splice(added.index, 0, added);
13363
- if (currentDataIndex) {
13499
+ if (currentDataIndex > -1) {
13364
13500
  indexvalue = currentDataIndex;
13365
13501
  }
13366
13502
  else {
@@ -13998,6 +14134,9 @@ var Edit = /** @__PURE__ @class */ (function () {
13998
14134
  }
13999
14135
  }
14000
14136
  }
14137
+ if (eventName === 'actionComplete' && eventArgs.requestType === 'save') {
14138
+ this.addRowRecord = null;
14139
+ }
14001
14140
  if (this.parent.enableInfiniteScrolling && eventName === 'actionComplete') {
14002
14141
  this.infiniteAddAction(eventArgs);
14003
14142
  }
@@ -15299,7 +15438,11 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15299
15438
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
15300
15439
  this.parent["" + action]('data-ready', this.onDataReady, this);
15301
15440
  this.parent["" + action]('refresh-virtual-block', this.refreshContentRows, this);
15441
+ this.parent.on(destroy, this.destroy, this);
15302
15442
  this.fn = function () {
15443
+ if (_this.parent.root.enableSeamlessScrolling) {
15444
+ window.addEventListener('resize', _this.updateScrollbar.bind(_this));
15445
+ }
15303
15446
  _this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); }, _this.onEnteredAction(), _this.parent);
15304
15447
  var gObj = _this.parent;
15305
15448
  if (gObj.root.enablePersistence && gObj.root.scrollPosition) {
@@ -15349,6 +15492,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15349
15492
  var virtualCellFocus = 'virtualCellFocus';
15350
15493
  _super.prototype["" + virtualCellFocus].call(this, e);
15351
15494
  };
15495
+ VirtualTreeContentRenderer.prototype.updateScrollbar = function () {
15496
+ var updateScrollbarOnResize = 'updateScrollbarOnResize';
15497
+ _super.prototype["" + updateScrollbarOnResize].call(this);
15498
+ };
15352
15499
  /**
15353
15500
  * Handles the data ready event for the virtual tree grid content renderer.
15354
15501
  *
@@ -15389,9 +15536,6 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15389
15536
  _super.prototype.renderTable.call(this);
15390
15537
  if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
15391
15538
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
15392
- if (this.observers) {
15393
- this.observers.disconnect();
15394
- }
15395
15539
  getValue('observer', this).options.debounceEvent = false;
15396
15540
  this.observers = new TreeInterSectionObserver(getValue('observer', this).element, getValue('observer', this).options);
15397
15541
  this.contents = this.getPanel().firstChild;
@@ -15472,7 +15616,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15472
15616
  }
15473
15617
  var treeGridParent = this.parent.clipboardModule['treeGridParent'];
15474
15618
  if (isNullOrUndefined(treeGridParent.editModule) ||
15475
- isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== 0) {
15619
+ isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== -1) {
15476
15620
  if (!isNullOrUndefined(treeGridParent.grid.sortModule) && treeGridParent.grid.sortModule['sortedColumns'].length > 0) {
15477
15621
  var sortedData = treeGridParent.dataModule['sortedData'];
15478
15622
  if (!isNullOrUndefined(sortedData) && sortedData.length > 0) {
@@ -15772,16 +15916,28 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15772
15916
  var maxLeft = _this.vgenerator.cOffsets[idx - 1];
15773
15917
  x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
15774
15918
  }
15775
- var y = _this.getTranslateY(e.top, height, xAxis && top_1 === e.top ? _this.prevInfo : undefined, true);
15919
+ var isRowScrollAction = _this.prevInfo && _this.prevInfo.page === 1 &&
15920
+ (direction !== _this.prevInfo.direction || direction !== _this.prevInfo.direction);
15921
+ var translateY = _this.getTranslateY(e.top, height, xAxis && top_1 === e.top ? _this.prevInfo : undefined, isRowScrollAction ? false : true);
15776
15922
  if (!_this.parent.isFrozenGrid() || _this.parent.enableVirtualMaskRow) {
15777
15923
  if (_this.parent.enableVirtualMaskRow) {
15778
15924
  var upScroll = (e.top - _this.translateY) < 0;
15779
- y = (Math.round(_this.translateY) > y && !upScroll) ? Math.round(_this.translateY) : y;
15780
- _this.virtualEle.adjustTable(x, y);
15925
+ translateY = (Math.round(_this.translateY) > translateY && !upScroll) ? Math.round(_this.translateY) : translateY;
15926
+ _this.virtualEle.adjustTable(x, translateY);
15781
15927
  }
15782
15928
  else {
15783
15929
  _this.virtualEle.adjustTable(x, _this.translateY);
15784
15930
  }
15931
+ var wrapperBottom = _this.virtualEle.wrapper.getBoundingClientRect().bottom;
15932
+ var contentBottom = _this.virtualEle.content.getBoundingClientRect().bottom;
15933
+ if (direction === 'up' && _this.prevInfo.page === Math.ceil(_this.getTotalBlocks() / 2) &&
15934
+ Math.round(wrapperBottom) < Math.round(contentBottom)) {
15935
+ var bottomGap = Math.round(contentBottom) - Math.round(wrapperBottom);
15936
+ var adjustedTranslateY = Math.min(translateY + bottomGap, _this.offsets[_this['maxBlock']]);
15937
+ if (adjustedTranslateY !== translateY) {
15938
+ _this.virtualEle.adjustTable(x, adjustedTranslateY);
15939
+ }
15940
+ }
15785
15941
  if (_this.parent.enableColumnVirtualization) {
15786
15942
  _this.header.virtualEle.adjustTable(x, 0);
15787
15943
  if (_this.parent.isFrozenGrid()) {
@@ -16110,10 +16266,17 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
16110
16266
  this.parent.off('refresh-virtual-editform-cells', this.refreshCell);
16111
16267
  this.parent.off('virtaul-cell-focus', this.cellFocus);
16112
16268
  this.parent.off('virtual-scroll-edit', this.restoreEditState);
16113
- if (this.observers) {
16114
- this.observers.disconnect();
16269
+ this.parent.off(destroy, this.destroy);
16270
+ if (this.parent.root.enableSeamlessScrolling) {
16271
+ window.removeEventListener('resize', this.updateScrollbar);
16115
16272
  }
16116
16273
  };
16274
+ VirtualTreeContentRenderer.prototype.destroy = function () {
16275
+ if (this.parent.isDestroyed) {
16276
+ return;
16277
+ }
16278
+ this.removeEventListener();
16279
+ };
16117
16280
  return VirtualTreeContentRenderer;
16118
16281
  }(VirtualContentRenderer));
16119
16282
  var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
@@ -16126,6 +16289,9 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16126
16289
  _this.timer = 0;
16127
16290
  return _this;
16128
16291
  }
16292
+ TreeInterSectionObserver.prototype.onWheelEvent = function () {
16293
+ this.isWheeling = true;
16294
+ };
16129
16295
  /**
16130
16296
  * Sets up observers to monitor scroll events on a given container
16131
16297
  * and its movable companion within a virtual grid setup.
@@ -16138,28 +16304,28 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16138
16304
  TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback, instance) {
16139
16305
  var containerRect = 'containerRect';
16140
16306
  _super.prototype["" + containerRect] = getValue('options', this).container.getBoundingClientRect();
16141
- this.containerEl = getValue('options', this).container;
16142
- this.containerScrollHandler = this.virtualScrollHandlers(callback, onEnterCallback, instance);
16143
- EventHandler.add(this.containerEl, 'scroll', this.containerScrollHandler, this);
16144
- if (getValue('options', this).movableContainer) {
16145
- var movableContainerRect = 'movableContainerRect';
16146
- _super.prototype["" + movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
16147
- this.movableContainerEl = getValue('options', this).movableContainer;
16148
- this.movableScrollHandler = this.virtualScrollHandlers(callback, onEnterCallback, instance);
16149
- EventHandler.add(this.movableContainerEl, 'scroll', this.movableScrollHandler, this);
16150
- }
16151
- };
16152
- TreeInterSectionObserver.prototype.disconnect = function () {
16153
- if (this.containerEl && this.containerScrollHandler) {
16154
- EventHandler.remove(this.containerEl, 'scroll', this.containerScrollHandler);
16155
- this.containerScrollHandler = null;
16307
+ var options = getValue('options', this);
16308
+ EventHandler.add(options.container, 'wheel', this.onWheelEvent, this);
16309
+ if (!isNullOrUndefined(options.horizontalScrollbar)) {
16310
+ EventHandler.add(options.horizontalScrollbar, 'wheel', this.onWheelEvent, this);
16311
+ EventHandler.add(options.horizontalScrollbar, 'scroll', this.onVirtualContentScrolling(), this);
16156
16312
  }
16157
- if (this.movableContainerEl && this.movableScrollHandler) {
16158
- EventHandler.remove(this.movableContainerEl, 'scroll', this.movableScrollHandler);
16159
- this.movableScrollHandler = null;
16313
+ if (!isNullOrUndefined(options.verticalScrollbar)) {
16314
+ EventHandler.add(options.verticalScrollbar, 'wheel', this.onWheelEvent, this);
16315
+ EventHandler.add(options.verticalScrollbar, 'scroll', this.onVirtualContentScrolling(), this);
16160
16316
  }
16161
- this.containerEl = null;
16162
- this.movableContainerEl = null;
16317
+ EventHandler.add(options.container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback, instance), this);
16318
+ };
16319
+ TreeInterSectionObserver.prototype.onVirtualContentScrolling = function () {
16320
+ var _this = this;
16321
+ return function (e) {
16322
+ if (e.target.classList.contains('e-virtual-vertical-scrollbar')) {
16323
+ getValue('options', _this).container.scrollTop = e.target.scrollTop;
16324
+ }
16325
+ if (e.target.classList.contains('e-virtual-horizontal-scrollbar')) {
16326
+ getValue('options', _this).container.scrollLeft = e.target.scrollLeft;
16327
+ }
16328
+ };
16163
16329
  };
16164
16330
  /**
16165
16331
  * Clears the last known position.
@@ -16205,6 +16371,12 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16205
16371
  direction = _this["" + options].prevLeft === left ? direction : _this["" + options].prevLeft < left ? 'right' : 'left';
16206
16372
  _this["" + options].prevTop = top;
16207
16373
  _this["" + options].prevLeft = left;
16374
+ if (!isNullOrUndefined(_this["" + options].verticalScrollbar)) {
16375
+ _this["" + options].verticalScrollbar.scrollTop = _this["" + options].container.scrollTop;
16376
+ }
16377
+ if (!isNullOrUndefined(_this["" + options].horizontalScrollbar)) {
16378
+ _this["" + options].horizontalScrollbar.scrollLeft = _this["" + options].container.scrollLeft;
16379
+ }
16208
16380
  var current = _this.sentinelInfo["" + direction];
16209
16381
  var delta = 0;
16210
16382
  _this.newPos = top;
@@ -16384,7 +16556,8 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
16384
16556
  var dm = new DataManager(pageingDetails.result);
16385
16557
  var expanded = new Predicate$1('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
16386
16558
  var parents = dm.executeLocal(new Query().where(expanded));
16387
- var isFiltering = pageingDetails.actionArgs.requestType === 'filtering';
16559
+ var isFiltering = (pageingDetails.actionArgs.requestType === 'filtering' && pageingDetails.actionArgs.action !== 'clear-filter') ||
16560
+ (!isNullOrUndefined(this.parent['filterModule']) && (this.parent['filterModule'].filteredResult && this.parent['filterModule'].filteredResult.length > 0));
16388
16561
  var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
16389
16562
  this.parent.filterSettings.hierarchyMode === 'None';
16390
16563
  var visualData = isFiltering && isFlatHierarchy