@syncfusion/ej2-treegrid 19.3.55 → 19.4.41

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 (55) 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 +6 -47
  4. package/README.md +1 -1
  5. package/dist/ej2-treegrid.umd.min.js +2 -2
  6. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es2015.js +182 -28
  8. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  9. package/dist/es6/ej2-treegrid.es5.js +196 -31
  10. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  11. package/dist/global/ej2-treegrid.min.js +2 -2
  12. package/dist/global/ej2-treegrid.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +9 -9
  15. package/src/treegrid/actions/batch-edit.js +5 -5
  16. package/src/treegrid/actions/edit.js +20 -7
  17. package/src/treegrid/base/interface.d.ts +4 -0
  18. package/src/treegrid/base/treegrid-model.d.ts +16 -1
  19. package/src/treegrid/base/treegrid.d.ts +43 -2
  20. package/src/treegrid/base/treegrid.js +146 -19
  21. package/src/treegrid/models/column.d.ts +10 -1
  22. package/src/treegrid/models/column.js +19 -0
  23. package/src/treegrid/renderer/virtual-row-model-generator.js +6 -0
  24. package/src/treegrid/renderer/virtual-tree-content-render.js +2 -1
  25. package/styles/bootstrap-dark.css +5 -0
  26. package/styles/bootstrap.css +5 -0
  27. package/styles/bootstrap4.css +5 -0
  28. package/styles/bootstrap5-dark.css +31 -26
  29. package/styles/bootstrap5.css +31 -26
  30. package/styles/fabric-dark.css +5 -0
  31. package/styles/fabric.css +5 -0
  32. package/styles/highcontrast-light.css +5 -0
  33. package/styles/highcontrast.css +5 -0
  34. package/styles/material-dark.css +5 -0
  35. package/styles/material.css +5 -0
  36. package/styles/tailwind-dark.css +31 -26
  37. package/styles/tailwind.css +5 -0
  38. package/styles/treegrid/_bootstrap5-definition.scss +4 -4
  39. package/styles/treegrid/_fluent-definition.scss +31 -0
  40. package/styles/treegrid/_layout.scss +8 -0
  41. package/styles/treegrid/_tailwind-definition.scss +4 -4
  42. package/styles/treegrid/bootstrap-dark.css +5 -0
  43. package/styles/treegrid/bootstrap.css +5 -0
  44. package/styles/treegrid/bootstrap4.css +5 -0
  45. package/styles/treegrid/bootstrap5-dark.css +31 -26
  46. package/styles/treegrid/bootstrap5.css +31 -26
  47. package/styles/treegrid/fabric-dark.css +5 -0
  48. package/styles/treegrid/fabric.css +5 -0
  49. package/styles/treegrid/highcontrast-light.css +5 -0
  50. package/styles/treegrid/highcontrast.css +5 -0
  51. package/styles/treegrid/icons/_fluent.scss +26 -0
  52. package/styles/treegrid/material-dark.css +5 -0
  53. package/styles/treegrid/material.css +5 -0
  54. package/styles/treegrid/tailwind-dark.css +31 -26
  55. 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
 
@@ -3773,6 +3792,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3773
3792
  this.grid.allowResizing = this.allowResizing;
3774
3793
  this.grid.enableHover = this.enableHover;
3775
3794
  this.grid.enableAutoFill = this.enableAutoFill;
3795
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
3776
3796
  this.grid.enableImmutableMode = this.enableImmutableMode;
3777
3797
  this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
3778
3798
  this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
@@ -3822,7 +3842,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3822
3842
  _this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
3823
3843
  var updateRowSelection = 'updateRowSelection';
3824
3844
  for (var i = 0; i < _this.getRows().length; i++) {
3825
- if (_this.getRows()[i].getElementsByClassName("e-frame e-icons e-uncheck").length) {
3845
+ if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
3826
3846
  _this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
3827
3847
  }
3828
3848
  }
@@ -4134,8 +4154,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4134
4154
  _this.notify('clearFilters', { flatData: _this.grid.dataSource });
4135
4155
  _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
4136
4156
  if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
4137
- _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 :
4138
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();
4139
4162
  }
4140
4163
  }
4141
4164
  var callBackPromise = new Deferred();
@@ -4585,6 +4608,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4585
4608
  case 'enableAutoFill':
4586
4609
  this.grid.enableAutoFill = this.enableAutoFill;
4587
4610
  break;
4611
+ case 'enableAdaptiveUI':
4612
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
4613
+ break;
4588
4614
  case 'enableImmutableMode':
4589
4615
  this.grid.enableImmutableMode = this.enableImmutableMode;
4590
4616
  break;
@@ -5181,6 +5207,32 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5181
5207
  this[merge$$1] = undefined; // Workaround for blazor updateModel
5182
5208
  return this.columnModel;
5183
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
+ };
5184
5236
  /**
5185
5237
  * Gets the content div of the TreeGrid.
5186
5238
  *
@@ -5450,9 +5502,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5450
5502
  *
5451
5503
  * @param {HTMLTableRowElement} row - Expands the given row
5452
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
5453
5507
  * @returns {void}
5454
5508
  */
5455
- TreeGrid.prototype.expandRow = function (row, record) {
5509
+ TreeGrid.prototype.expandRow = function (row, record, key, level) {
5456
5510
  var _this = this;
5457
5511
  record = this.getCollapseExpandRecords(row, record);
5458
5512
  if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
@@ -5462,6 +5516,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5462
5516
  this.trigger(expanding, args, function (expandingArgs) {
5463
5517
  if (!expandingArgs.cancel) {
5464
5518
  _this.expandCollapse('expand', row, record);
5519
+ if (expandingArgs.expandAll) {
5520
+ _this.expandCollapseAllChildren(record, 'expand', key, level);
5521
+ }
5465
5522
  var children = 'Children';
5466
5523
  if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
5467
5524
  var collapseArgs = { data: record, row: row };
@@ -5471,6 +5528,19 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5471
5528
  }
5472
5529
  });
5473
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
+ };
5474
5544
  TreeGrid.prototype.setHeightForFrozenContent = function () {
5475
5545
  var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
5476
5546
  if (this.grid.getFrozenColumns() > 0 || freeze) {
@@ -5494,14 +5564,18 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5494
5564
  *
5495
5565
  * @param {HTMLTableRowElement} row - Collapse the given row
5496
5566
  * @param {Object} record - Collapse the given record
5567
+ * @param {Object} key - Primary key value
5497
5568
  * @returns {void}
5498
5569
  */
5499
- TreeGrid.prototype.collapseRow = function (row, record) {
5570
+ TreeGrid.prototype.collapseRow = function (row, record, key) {
5500
5571
  var _this = this;
5501
5572
  record = this.getCollapseExpandRecords(row, record);
5502
5573
  var args = { data: record, row: row, cancel: false };
5503
5574
  this.trigger(collapsing, args, function (collapsingArgs) {
5504
5575
  if (!collapsingArgs.cancel) {
5576
+ if (collapsingArgs.collapseAll) {
5577
+ _this.expandCollapseAllChildren(record, 'collapse', key);
5578
+ }
5505
5579
  _this.expandCollapse('collapse', row, record);
5506
5580
  var collapseArgs = { data: record, row: row };
5507
5581
  if (!isRemoteData(_this)) {
@@ -5532,22 +5606,58 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5532
5606
  }
5533
5607
  return e.hasChildRecords && e.level === level;
5534
5608
  });
5535
- this.expandRow(null, rec);
5609
+ this.expandAction(rec, null, level, true);
5536
5610
  }
5537
5611
  else {
5538
5612
  var rec = this.getRecordDetails(level);
5539
- var row = getObject('rows', rec);
5540
5613
  var record = getObject('records', rec);
5541
- for (var i = 0; i < record.length; i++) {
5542
- if (record[i].parentItem !== undefined) {
5543
- var pindex = this.flatData[record[i].parentItem.index].index;
5544
- if (this.flatData[pindex].expanded === false) {
5545
- record.push(this.flatData[pindex]);
5546
- 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
+ }
5547
5648
  }
5548
5649
  }
5549
- this.expandRow(row[i], record[i]);
5550
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);
5551
5661
  }
5552
5662
  };
5553
5663
  TreeGrid.prototype.getRecordDetails = function (level) {
@@ -5575,14 +5685,46 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5575
5685
  }
5576
5686
  return e.hasChildRecords && e.level === level;
5577
5687
  });
5578
- this.collapseRow(null, record);
5688
+ this.collapseAction(record, null, true);
5579
5689
  }
5580
5690
  else {
5581
5691
  var rec = this.getRecordDetails(level);
5582
- var rows = getObject('rows', rec);
5583
5692
  var records = getObject('records', rec);
5584
- for (var i = 0; i < records.length; i++) {
5585
- 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);
5586
5728
  }
5587
5729
  }
5588
5730
  if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
@@ -6492,6 +6634,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6492
6634
  __decorate([
6493
6635
  Property(false)
6494
6636
  ], TreeGrid.prototype, "enableAutoFill", void 0);
6637
+ __decorate([
6638
+ Property(false)
6639
+ ], TreeGrid.prototype, "enableAdaptiveUI", void 0);
6495
6640
  __decorate([
6496
6641
  Property(false)
6497
6642
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
@@ -8082,6 +8227,12 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8082
8227
  return _super.prototype.getData.call(this);
8083
8228
  };
8084
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
+ }
8085
8236
  var info = this.getDataInfo();
8086
8237
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
8087
8238
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
@@ -9933,11 +10084,6 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9933
10084
  var data = (this.parent.grid.dataSource instanceof DataManager ?
9934
10085
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
9935
10086
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
9936
- if (!isNullOrUndefined(this.parent[targetElement])) {
9937
- var row = this.parent[targetElement].closest('tr');
9938
- this.parent.collapseRow(row);
9939
- this.parent[targetElement] = null;
9940
- }
9941
10087
  if (!isNullOrUndefined(this.batchAddedRecords)) {
9942
10088
  for (var i = 0; i < this.batchAddedRecords.length; i++) {
9943
10089
  index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
@@ -9957,6 +10103,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9957
10103
  }
9958
10104
  }
9959
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
+ }
9960
10111
  if (!isNullOrUndefined(this.batchDeletedRecords)) {
9961
10112
  for (var i = 0; i < this.batchDeletedRecords.length; i++) {
9962
10113
  if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
@@ -10834,14 +10985,28 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10834
10985
  return;
10835
10986
  }
10836
10987
  if (args.requestType === 'delete') {
10837
- var data = args.data;
10838
- for (var i = 0; i < data.length; i++) {
10839
- this.deleteUniqueID(data[i].uniqueID);
10840
- 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]);
10841
11006
  for (var c = 0; c < childs.length; c++) {
10842
11007
  this.deleteUniqueID(childs[c].uniqueID);
10843
11008
  }
10844
- args.data = data.concat(childs);
11009
+ args.data = args.data.concat(childs);
10845
11010
  }
10846
11011
  }
10847
11012
  if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {
@@ -10917,8 +11082,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10917
11082
  var currentData = this.parent.grid.getCurrentViewRecords();
10918
11083
  if (this.parent.enableVirtualization && args.index !== 0) {
10919
11084
  this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
10920
- this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
10921
-
11085
+ this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
10922
11086
  }
10923
11087
  var index = this.addRowIndex;
10924
11088
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11441,7 +11605,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
11441
11605
  if (isNullOrUndefined(this.observer[containerRect])) {
11442
11606
  this.observer[containerRect] = this.observers[containerRect];
11443
11607
  }
11444
- if (args.selectedIndex !== 0 || isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11608
+ if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
11609
+ isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11445
11610
  _super.prototype[selectVirtualRow].call(this, args);
11446
11611
  }
11447
11612
  };