@syncfusion/ej2-treegrid 19.3.48 → 19.4.38

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 (56) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +60 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
  3. package/CHANGELOG.md +5 -38
  4. package/dist/ej2-treegrid.umd.min.js +2 -2
  5. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es2015.js +204 -26
  7. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  8. package/dist/es6/ej2-treegrid.es5.js +218 -29
  9. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  10. package/dist/global/ej2-treegrid.min.js +2 -2
  11. package/dist/global/ej2-treegrid.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +9 -9
  14. package/src/treegrid/actions/batch-edit.js +5 -5
  15. package/src/treegrid/actions/edit.js +24 -5
  16. package/src/treegrid/actions/virtual-scroll.js +5 -0
  17. package/src/treegrid/base/data.js +3 -1
  18. package/src/treegrid/base/interface.d.ts +4 -0
  19. package/src/treegrid/base/treegrid-model.d.ts +16 -1
  20. package/src/treegrid/base/treegrid.d.ts +43 -2
  21. package/src/treegrid/base/treegrid.js +154 -18
  22. package/src/treegrid/models/column.d.ts +9 -0
  23. package/src/treegrid/models/column.js +19 -0
  24. package/src/treegrid/renderer/virtual-row-model-generator.js +6 -0
  25. package/src/treegrid/renderer/virtual-tree-content-render.js +4 -1
  26. package/styles/bootstrap-dark.css +5 -0
  27. package/styles/bootstrap.css +5 -0
  28. package/styles/bootstrap4.css +5 -0
  29. package/styles/bootstrap5-dark.css +32 -26
  30. package/styles/bootstrap5.css +32 -26
  31. package/styles/fabric-dark.css +5 -0
  32. package/styles/fabric.css +5 -0
  33. package/styles/highcontrast-light.css +5 -0
  34. package/styles/highcontrast.css +5 -0
  35. package/styles/material-dark.css +5 -0
  36. package/styles/material.css +5 -0
  37. package/styles/tailwind-dark.css +31 -26
  38. package/styles/tailwind.css +5 -0
  39. package/styles/treegrid/_bootstrap5-definition.scss +4 -4
  40. package/styles/treegrid/_fluent-definition.scss +31 -0
  41. package/styles/treegrid/_layout.scss +8 -0
  42. package/styles/treegrid/_tailwind-definition.scss +4 -4
  43. package/styles/treegrid/bootstrap-dark.css +5 -0
  44. package/styles/treegrid/bootstrap.css +5 -0
  45. package/styles/treegrid/bootstrap4.css +5 -0
  46. package/styles/treegrid/bootstrap5-dark.css +32 -26
  47. package/styles/treegrid/bootstrap5.css +32 -26
  48. package/styles/treegrid/fabric-dark.css +5 -0
  49. package/styles/treegrid/fabric.css +5 -0
  50. package/styles/treegrid/highcontrast-light.css +5 -0
  51. package/styles/treegrid/highcontrast.css +5 -0
  52. package/styles/treegrid/icons/_fluent.scss +26 -0
  53. package/styles/treegrid/material-dark.css +5 -0
  54. package/styles/treegrid/material.css +5 -0
  55. package/styles/treegrid/tailwind-dark.css +31 -26
  56. package/styles/treegrid/tailwind.css +5 -0
@@ -1,5 +1,5 @@
1
1
  import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setValue } from '@syncfusion/ej2-base';
2
- import { Aggregate, Cell, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
2
+ import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
@@ -76,6 +76,25 @@ var Column = /** @__PURE__ @class */ (function () {
76
76
  this.filter = {};
77
77
  merge(this, options);
78
78
  }
79
+ /**
80
+ * Update the State changes reflected for TreeGrid columndirective in react platform.
81
+ *
82
+ * @param {Column} column - specifies the column
83
+ * @returns {void}
84
+ * @hidden
85
+ */
86
+ Column.prototype.setProperties = function (column) {
87
+ //Angular two way binding
88
+ var keys = Object.keys(column);
89
+ for (var i = 0; i < keys.length; i++) {
90
+ this[keys[i]] = column[keys[i]];
91
+ //Refresh the react columnTemplates on state change
92
+ if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
93
+ var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
94
+ this.parent.clipboardModule['treeGridParent'][refreshReactColumnTemplateByUid](this.uid);
95
+ }
96
+ }
97
+ };
79
98
  return Column;
80
99
  }());
81
100
 
@@ -2286,7 +2305,9 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2286
2305
  var query = getObject('query', args);
2287
2306
  var srtQry = new Query();
2288
2307
  for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
2289
- var col = this.parent.grid.getColumnByField(this.parent.grid.sortSettings.columns[srt].field);
2308
+ var getColumnByField = 'getColumnByField';
2309
+ var col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.
2310
+ sortSettings.columns[srt].field);
2290
2311
  var compFun = col.sortComparer && isOffline(this.parent) ?
2291
2312
  col.sortComparer.bind(col) :
2292
2313
  this.parent.grid.sortSettings.columns[srt].direction;
@@ -3771,6 +3792,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3771
3792
  this.grid.allowResizing = this.allowResizing;
3772
3793
  this.grid.enableHover = this.enableHover;
3773
3794
  this.grid.enableAutoFill = this.enableAutoFill;
3795
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
3774
3796
  this.grid.enableImmutableMode = this.enableImmutableMode;
3775
3797
  this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
3776
3798
  this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
@@ -3816,6 +3838,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3816
3838
  _this.trigger(rowSelecting, args);
3817
3839
  };
3818
3840
  this.grid.rowSelected = function (args) {
3841
+ if (_this.enableVirtualization && args.isHeaderCheckboxClicked &&
3842
+ _this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
3843
+ var updateRowSelection = 'updateRowSelection';
3844
+ for (var i = 0; i < _this.getRows().length; i++) {
3845
+ if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
3846
+ _this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
3847
+ }
3848
+ }
3849
+ }
3819
3850
  _this.selectedRowIndex = _this.grid.selectedRowIndex;
3820
3851
  _this.notify(rowSelected, args);
3821
3852
  _this.trigger(rowSelected, args);
@@ -4123,8 +4154,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4123
4154
  _this.notify('clearFilters', { flatData: _this.grid.dataSource });
4124
4155
  _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
4125
4156
  if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
4126
- _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ? _this.grid.dataSource :
4157
+ _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?
4158
+ _this.grid.dataSource :
4127
4159
  (isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));
4160
+ _this.grid.renderModule.data.isQueryInvokedFromData = true;
4161
+ _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
4128
4162
  }
4129
4163
  }
4130
4164
  var callBackPromise = new Deferred();
@@ -4574,6 +4608,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4574
4608
  case 'enableAutoFill':
4575
4609
  this.grid.enableAutoFill = this.enableAutoFill;
4576
4610
  break;
4611
+ case 'enableAdaptiveUI':
4612
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
4613
+ break;
4577
4614
  case 'enableImmutableMode':
4578
4615
  this.grid.enableImmutableMode = this.enableImmutableMode;
4579
4616
  break;
@@ -5170,6 +5207,32 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5170
5207
  this[merge$$1] = undefined; // Workaround for blazor updateModel
5171
5208
  return this.columnModel;
5172
5209
  };
5210
+ /**
5211
+ * @param {string} columnUid - Defines column uid
5212
+ * @returns {void}
5213
+ * @hidden
5214
+ */
5215
+ TreeGrid.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
5216
+ var _this = this;
5217
+ if (this.isReact) {
5218
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5219
+ this.clearTemplate(['columnTemplate'], undefined, function () {
5220
+ var cells = 'cells';
5221
+ var rowIdx = 'index';
5222
+ var rowsObj = _this.grid.getRowsObject();
5223
+ var indent = _this.grid.getIndentCount();
5224
+ var cellIndex = _this.grid.getNormalizedColumnIndex(columnUid);
5225
+ for (var j = 0; j < rowsObj.length; j++) {
5226
+ if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
5227
+ var cell = rowsObj[j][cells][cellIndex];
5228
+ var cellRenderer = new CellRenderer(_this.grid, _this.grid.serviceLocator);
5229
+ var td = _this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
5230
+ cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
5231
+ }
5232
+ }
5233
+ });
5234
+ }
5235
+ };
5173
5236
  /**
5174
5237
  * Gets the content div of the TreeGrid.
5175
5238
  *
@@ -5439,9 +5502,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5439
5502
  *
5440
5503
  * @param {HTMLTableRowElement} row - Expands the given row
5441
5504
  * @param {Object} record - Expands the given record
5505
+ * @param {Object} key - Primary key value
5506
+ * @param {number} level - Specifies the hierarchical level of the record
5442
5507
  * @returns {void}
5443
5508
  */
5444
- TreeGrid.prototype.expandRow = function (row, record) {
5509
+ TreeGrid.prototype.expandRow = function (row, record, key, level) {
5445
5510
  var _this = this;
5446
5511
  record = this.getCollapseExpandRecords(row, record);
5447
5512
  if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
@@ -5451,6 +5516,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5451
5516
  this.trigger(expanding, args, function (expandingArgs) {
5452
5517
  if (!expandingArgs.cancel) {
5453
5518
  _this.expandCollapse('expand', row, record);
5519
+ if (expandingArgs.expandAll) {
5520
+ _this.expandCollapseAllChildren(record, 'expand', key, level);
5521
+ }
5454
5522
  var children = 'Children';
5455
5523
  if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
5456
5524
  var collapseArgs = { data: record, row: row };
@@ -5460,6 +5528,19 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5460
5528
  }
5461
5529
  });
5462
5530
  };
5531
+ TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {
5532
+ if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
5533
+ (!isNullOrUndefined(level) && level !== record.level)) {
5534
+ return;
5535
+ }
5536
+ var records = findChildrenRecords(record).filter(function (e) {
5537
+ return e.hasChildRecords;
5538
+ });
5539
+ records.unshift(record);
5540
+ for (var i = 0; i < records.length; i++) {
5541
+ this.expandCollapse(action, null, records[i]);
5542
+ }
5543
+ };
5463
5544
  TreeGrid.prototype.setHeightForFrozenContent = function () {
5464
5545
  var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
5465
5546
  if (this.grid.getFrozenColumns() > 0 || freeze) {
@@ -5483,14 +5564,18 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5483
5564
  *
5484
5565
  * @param {HTMLTableRowElement} row - Collapse the given row
5485
5566
  * @param {Object} record - Collapse the given record
5567
+ * @param {Object} key - Primary key value
5486
5568
  * @returns {void}
5487
5569
  */
5488
- TreeGrid.prototype.collapseRow = function (row, record) {
5570
+ TreeGrid.prototype.collapseRow = function (row, record, key) {
5489
5571
  var _this = this;
5490
5572
  record = this.getCollapseExpandRecords(row, record);
5491
5573
  var args = { data: record, row: row, cancel: false };
5492
5574
  this.trigger(collapsing, args, function (collapsingArgs) {
5493
5575
  if (!collapsingArgs.cancel) {
5576
+ if (collapsingArgs.collapseAll) {
5577
+ _this.expandCollapseAllChildren(record, 'collapse', key);
5578
+ }
5494
5579
  _this.expandCollapse('collapse', row, record);
5495
5580
  var collapseArgs = { data: record, row: row };
5496
5581
  if (!isRemoteData(_this)) {
@@ -5521,22 +5606,58 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5521
5606
  }
5522
5607
  return e.hasChildRecords && e.level === level;
5523
5608
  });
5524
- this.expandRow(null, rec);
5609
+ this.expandAction(rec, null, level, true);
5525
5610
  }
5526
5611
  else {
5527
5612
  var rec = this.getRecordDetails(level);
5528
- var row = getObject('rows', rec);
5529
5613
  var record = getObject('records', rec);
5530
- for (var i = 0; i < record.length; i++) {
5531
- if (record[i].parentItem !== undefined) {
5532
- var pindex = this.flatData[record[i].parentItem.index].index;
5533
- if (this.flatData[pindex].expanded === false) {
5534
- record.push(this.flatData[pindex]);
5535
- this.flatData[pindex].expanded = true;
5614
+ this.expandAction(record, null, level);
5615
+ }
5616
+ };
5617
+ /**
5618
+ * Expands the records by given primary key value
5619
+ *
5620
+ * @param {Object} key - Expands the parent rows with given primary key value
5621
+ * @returns {void}
5622
+ */
5623
+ TreeGrid.prototype.expandByKey = function (key) {
5624
+ this.expandCollapseActionByKey(key, 'Expand');
5625
+ };
5626
+ TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
5627
+ if (isPaging === void 0) { isPaging = false; }
5628
+ var _loop_1 = function (i) {
5629
+ if (!isNullOrUndefined(record[i].parentItem)) {
5630
+ var puniqueID_1 = record[i].parentItem.uniqueID;
5631
+ var parentItem = this_1.flatData.filter(function (e) {
5632
+ return e.uniqueID === puniqueID_1;
5633
+ });
5634
+ if (isRemoteData(this_1)) {
5635
+ parentItem = this_1.getCurrentViewRecords().filter(function (e) {
5636
+ return e.uniqueID === puniqueID_1;
5637
+ });
5638
+ }
5639
+ if (parentItem[0].expanded === false) {
5640
+ record.push(parentItem[0]);
5641
+ parentItem[0].expanded = true;
5642
+ }
5643
+ else {
5644
+ if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
5645
+ if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
5646
+ record.push(parentItem[0]);
5647
+ }
5536
5648
  }
5537
5649
  }
5538
- this.expandRow(row[i], record[i]);
5539
5650
  }
5651
+ if (!isPaging) {
5652
+ this_1.expandRow(null, record[i], key, level);
5653
+ }
5654
+ };
5655
+ var this_1 = this;
5656
+ for (var i = 0; i < record.length; i++) {
5657
+ _loop_1(i);
5658
+ }
5659
+ if (isPaging) {
5660
+ this.expandRow(null, record, key, level);
5540
5661
  }
5541
5662
  };
5542
5663
  TreeGrid.prototype.getRecordDetails = function (level) {
@@ -5564,14 +5685,46 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5564
5685
  }
5565
5686
  return e.hasChildRecords && e.level === level;
5566
5687
  });
5567
- this.collapseRow(null, record);
5688
+ this.collapseAction(record, null, true);
5568
5689
  }
5569
5690
  else {
5570
5691
  var rec = this.getRecordDetails(level);
5571
- var rows = getObject('rows', rec);
5572
5692
  var records = getObject('records', rec);
5573
- for (var i = 0; i < records.length; i++) {
5574
- this.collapseRow(rows[i], records[i]);
5693
+ this.collapseAction(records);
5694
+ }
5695
+ };
5696
+ /**
5697
+ * Collapses the records by given primary key value
5698
+ *
5699
+ * @param {Object} key - Collapses the parent rows with given primary key value
5700
+ * @returns {void}
5701
+ */
5702
+ TreeGrid.prototype.collapseByKey = function (key) {
5703
+ this.expandCollapseActionByKey(key, 'Collapse');
5704
+ };
5705
+ TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
5706
+ var primaryKeyField = this.getPrimaryKeyFieldNames()[0];
5707
+ var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
5708
+ if (!isNullOrUndefined(primaryKeyField)) {
5709
+ var rec = dataSource.filter(function (e) {
5710
+ return e[primaryKeyField].toString() === key.toString();
5711
+ });
5712
+ if (action === 'Expand') {
5713
+ this.expandAction(rec, key, null);
5714
+ }
5715
+ else {
5716
+ this.collapseAction(rec, key);
5717
+ }
5718
+ }
5719
+ };
5720
+ TreeGrid.prototype.collapseAction = function (record, key, isPaging) {
5721
+ if (isPaging === void 0) { isPaging = false; }
5722
+ if (isPaging) {
5723
+ this.collapseRow(null, record);
5724
+ }
5725
+ else {
5726
+ for (var i = 0; i < record.length; i++) {
5727
+ this.collapseRow(null, record[i], key);
5575
5728
  }
5576
5729
  }
5577
5730
  if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
@@ -6481,6 +6634,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6481
6634
  __decorate([
6482
6635
  Property(false)
6483
6636
  ], TreeGrid.prototype, "enableAutoFill", void 0);
6637
+ __decorate([
6638
+ Property(false)
6639
+ ], TreeGrid.prototype, "enableAdaptiveUI", void 0);
6484
6640
  __decorate([
6485
6641
  Property(false)
6486
6642
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
@@ -8071,6 +8227,12 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8071
8227
  return _super.prototype.getData.call(this);
8072
8228
  };
8073
8229
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
8230
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
8231
+ this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
8232
+ }
8233
+ else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
8234
+ this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
8235
+ }
8074
8236
  var info = this.getDataInfo();
8075
8237
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
8076
8238
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
@@ -9922,11 +10084,6 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9922
10084
  var data = (this.parent.grid.dataSource instanceof DataManager ?
9923
10085
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
9924
10086
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
9925
- if (!isNullOrUndefined(this.parent[targetElement])) {
9926
- var row = this.parent[targetElement].closest('tr');
9927
- this.parent.collapseRow(row);
9928
- this.parent[targetElement] = null;
9929
- }
9930
10087
  if (!isNullOrUndefined(this.batchAddedRecords)) {
9931
10088
  for (var i = 0; i < this.batchAddedRecords.length; i++) {
9932
10089
  index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
@@ -9946,6 +10103,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9946
10103
  }
9947
10104
  }
9948
10105
  }
10106
+ if (!isNullOrUndefined(this.parent[targetElement])) {
10107
+ var row = this.parent[targetElement].closest('tr');
10108
+ this.parent.collapseRow(row);
10109
+ this.parent[targetElement] = null;
10110
+ }
9949
10111
  if (!isNullOrUndefined(this.batchDeletedRecords)) {
9950
10112
  for (var i = 0; i < this.batchDeletedRecords.length; i++) {
9951
10113
  if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
@@ -10823,14 +10985,28 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10823
10985
  return;
10824
10986
  }
10825
10987
  if (args.requestType === 'delete') {
10826
- var data = args.data;
10827
- for (var i = 0; i < data.length; i++) {
10828
- this.deleteUniqueID(data[i].uniqueID);
10829
- var childs = findChildrenRecords(data[i]);
10988
+ var data_1 = args.data;
10989
+ if (isNullOrUndefined(args.data[0].uniqueID)) {
10990
+ var primaryKeys_2 = this.parent.getPrimaryKeyFieldNames();
10991
+ var _loop_1 = function (i) {
10992
+ this_1.parent.flatData.filter(function (e) {
10993
+ if (e[primaryKeys_2[0]] === args.data[i][primaryKeys_2[0]]) {
10994
+ data_1[i] = e;
10995
+ }
10996
+ });
10997
+ };
10998
+ var this_1 = this;
10999
+ for (var i = 0; i < data_1.length; i++) {
11000
+ _loop_1(i);
11001
+ }
11002
+ }
11003
+ for (var i = 0; i < data_1.length; i++) {
11004
+ this.deleteUniqueID(data_1[i].uniqueID);
11005
+ var childs = findChildrenRecords(data_1[i]);
10830
11006
  for (var c = 0; c < childs.length; c++) {
10831
11007
  this.deleteUniqueID(childs[c].uniqueID);
10832
11008
  }
10833
- args.data = data.concat(childs);
11009
+ args.data = args.data.concat(childs);
10834
11010
  }
10835
11011
  }
10836
11012
  if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {
@@ -10875,6 +11051,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10875
11051
  }
10876
11052
  if (this.isAddedRowByMethod && args.index !== 0) {
10877
11053
  this.addRowRecord = this.parent.flatData[args.index];
11054
+ this.addRowIndex = args.index;
10878
11055
  }
10879
11056
  if (this.parent.editSettings.newRowPosition === 'Child' && isNullOrUndefined(this.addRowRecord)
10880
11057
  && !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
@@ -10903,6 +11080,10 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10903
11080
  var position = null;
10904
11081
  value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
10905
11082
  var currentData = this.parent.grid.getCurrentViewRecords();
11083
+ if (this.parent.enableVirtualization && args.index !== 0) {
11084
+ this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
11085
+ this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
11086
+ }
10906
11087
  var index = this.addRowIndex;
10907
11088
  value.uniqueID = getUid(this.parent.element.id + '_data_');
10908
11089
  setValue('uniqueIDCollection.' + value.uniqueID, value, this.parent);
@@ -11424,7 +11605,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
11424
11605
  if (isNullOrUndefined(this.observer[containerRect])) {
11425
11606
  this.observer[containerRect] = this.observers[containerRect];
11426
11607
  }
11427
- _super.prototype[selectVirtualRow].call(this, args);
11608
+ if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
11609
+ isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11610
+ _super.prototype[selectVirtualRow].call(this, args);
11611
+ }
11428
11612
  };
11429
11613
  VirtualTreeContentRenderer.prototype.refreshCell = function (rowObj) {
11430
11614
  rowObj.cells = this.generateCells();
@@ -11910,6 +12094,11 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
11910
12094
  }
11911
12095
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
11912
12096
  //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
12097
+ if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||
12098
+ (pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&
12099
+ (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {
12100
+ startIndex = 0;
12101
+ }
11913
12102
  if (!isNullOrUndefined(this.expandCollapseRec)) {
11914
12103
  var resourceCount = this.parent.getRows();
11915
12104
  var sIndex = visualData.indexOf(this.expandCollapseRec);