@syncfusion/ej2-treegrid 34.2.8 → 35.1.46

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 (229) hide show
  1. package/README.md +16 -2
  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 +1054 -590
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +1159 -618
  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 +5 -5
  13. package/src/global.js +1 -1
  14. package/src/treegrid/actions/crud-actions.js +4 -9
  15. package/src/treegrid/actions/dom-virtualization.d.ts +71 -0
  16. package/src/treegrid/actions/dom-virtualization.js +251 -0
  17. package/src/treegrid/actions/edit.d.ts +1 -4
  18. package/src/treegrid/actions/edit.js +23 -191
  19. package/src/treegrid/actions/filter.js +1 -1
  20. package/src/treegrid/actions/index.d.ts +1 -0
  21. package/src/treegrid/actions/index.js +1 -0
  22. package/src/treegrid/actions/page.js +12 -6
  23. package/src/treegrid/actions/rowdragdrop.js +20 -1
  24. package/src/treegrid/actions/selection.d.ts +21 -0
  25. package/src/treegrid/actions/selection.js +198 -32
  26. package/src/treegrid/actions/summary.js +25 -9
  27. package/src/treegrid/actions/toolbar.js +8 -5
  28. package/src/treegrid/base/constant.d.ts +6 -0
  29. package/src/treegrid/base/constant.js +6 -0
  30. package/src/treegrid/base/data.d.ts +17 -0
  31. package/src/treegrid/base/data.js +189 -132
  32. package/src/treegrid/base/treegrid-model.d.ts +35 -4
  33. package/src/treegrid/base/treegrid.d.ts +45 -7
  34. package/src/treegrid/base/treegrid.js +181 -73
  35. package/src/treegrid/enum.d.ts +12 -0
  36. package/src/treegrid/models/column.d.ts +2 -2
  37. package/src/treegrid/models/dom-virtualization-settings-model.d.ts +50 -0
  38. package/src/treegrid/models/dom-virtualization-settings.d.ts +43 -0
  39. package/src/treegrid/models/dom-virtualization-settings.js +47 -0
  40. package/src/treegrid/models/index.d.ts +2 -0
  41. package/src/treegrid/models/index.js +1 -0
  42. package/src/treegrid/models/summary-model.d.ts +1 -1
  43. package/src/treegrid/models/summary.d.ts +1 -1
  44. package/src/treegrid/renderer/dom-virtual-tree-content-renderer.d.ts +20 -0
  45. package/src/treegrid/renderer/dom-virtual-tree-content-renderer.js +49 -0
  46. package/src/treegrid/renderer/index.d.ts +1 -0
  47. package/src/treegrid/renderer/index.js +1 -0
  48. package/src/treegrid/renderer/render.js +4 -3
  49. package/src/treegrid/renderer/virtual-tree-content-render.js +1 -2
  50. package/helpers/e2e/index.d.ts +0 -1
  51. package/helpers/e2e/index.js +0 -8
  52. package/helpers/e2e/treegridhelper.d.ts +0 -21
  53. package/helpers/e2e/treegridhelper.js +0 -83
  54. package/styles/bds-lite.css +0 -402
  55. package/styles/bds-lite.scss +0 -3
  56. package/styles/bds.css +0 -422
  57. package/styles/bds.scss +0 -4
  58. package/styles/bootstrap-dark-lite.css +0 -406
  59. package/styles/bootstrap-dark-lite.scss +0 -3
  60. package/styles/bootstrap-dark.css +0 -426
  61. package/styles/bootstrap-dark.scss +0 -4
  62. package/styles/bootstrap-lite.css +0 -409
  63. package/styles/bootstrap-lite.scss +0 -3
  64. package/styles/bootstrap.css +0 -432
  65. package/styles/bootstrap.scss +0 -4
  66. package/styles/bootstrap4-lite.css +0 -406
  67. package/styles/bootstrap4-lite.scss +0 -3
  68. package/styles/bootstrap4.css +0 -426
  69. package/styles/bootstrap4.scss +0 -4
  70. package/styles/bootstrap5-dark-lite.css +0 -406
  71. package/styles/bootstrap5-dark-lite.scss +0 -3
  72. package/styles/bootstrap5-dark.css +0 -426
  73. package/styles/bootstrap5-dark.scss +0 -4
  74. package/styles/bootstrap5-lite.css +0 -406
  75. package/styles/bootstrap5-lite.scss +0 -3
  76. package/styles/bootstrap5.3-lite.css +0 -490
  77. package/styles/bootstrap5.3-lite.scss +0 -3
  78. package/styles/bootstrap5.3.css +0 -510
  79. package/styles/bootstrap5.3.scss +0 -4
  80. package/styles/bootstrap5.css +0 -426
  81. package/styles/bootstrap5.scss +0 -4
  82. package/styles/fabric-dark-lite.css +0 -409
  83. package/styles/fabric-dark-lite.scss +0 -3
  84. package/styles/fabric-dark.css +0 -432
  85. package/styles/fabric-dark.scss +0 -4
  86. package/styles/fabric-lite.css +0 -409
  87. package/styles/fabric-lite.scss +0 -3
  88. package/styles/fabric.css +0 -432
  89. package/styles/fabric.scss +0 -4
  90. package/styles/fluent-dark-lite.css +0 -417
  91. package/styles/fluent-dark-lite.scss +0 -3
  92. package/styles/fluent-dark.css +0 -444
  93. package/styles/fluent-dark.scss +0 -4
  94. package/styles/fluent-lite.css +0 -417
  95. package/styles/fluent-lite.scss +0 -3
  96. package/styles/fluent.css +0 -444
  97. package/styles/fluent.scss +0 -4
  98. package/styles/fluent2-lite.css +0 -507
  99. package/styles/fluent2-lite.scss +0 -3
  100. package/styles/fluent2.css +0 -531
  101. package/styles/fluent2.scss +0 -4
  102. package/styles/highcontrast-light-lite.css +0 -406
  103. package/styles/highcontrast-light-lite.scss +0 -3
  104. package/styles/highcontrast-light.css +0 -426
  105. package/styles/highcontrast-light.scss +0 -4
  106. package/styles/highcontrast-lite.css +0 -413
  107. package/styles/highcontrast-lite.scss +0 -3
  108. package/styles/highcontrast.css +0 -439
  109. package/styles/highcontrast.scss +0 -4
  110. package/styles/material-dark-lite.css +0 -406
  111. package/styles/material-dark-lite.scss +0 -3
  112. package/styles/material-dark.css +0 -426
  113. package/styles/material-dark.scss +0 -4
  114. package/styles/material-lite.css +0 -406
  115. package/styles/material-lite.scss +0 -3
  116. package/styles/material.css +0 -426
  117. package/styles/material.scss +0 -4
  118. package/styles/material3-dark-lite.css +0 -488
  119. package/styles/material3-dark-lite.scss +0 -3
  120. package/styles/material3-dark.css +0 -508
  121. package/styles/material3-dark.scss +0 -4
  122. package/styles/material3-lite.css +0 -490
  123. package/styles/material3-lite.scss +0 -3
  124. package/styles/material3.css +0 -510
  125. package/styles/material3.scss +0 -4
  126. package/styles/tailwind-dark-lite.css +0 -406
  127. package/styles/tailwind-dark-lite.scss +0 -3
  128. package/styles/tailwind-dark.css +0 -426
  129. package/styles/tailwind-dark.scss +0 -4
  130. package/styles/tailwind-lite.css +0 -406
  131. package/styles/tailwind-lite.scss +0 -3
  132. package/styles/tailwind.css +0 -426
  133. package/styles/tailwind.scss +0 -4
  134. package/styles/tailwind3-lite.css +0 -480
  135. package/styles/tailwind3-lite.scss +0 -3
  136. package/styles/tailwind3.css +0 -500
  137. package/styles/tailwind3.scss +0 -4
  138. package/styles/treegrid/_all.scss +0 -2
  139. package/styles/treegrid/_bds-definition.scss +0 -28
  140. package/styles/treegrid/_bigger.scss +0 -70
  141. package/styles/treegrid/_bootstrap-dark-definition.scss +0 -33
  142. package/styles/treegrid/_bootstrap-definition.scss +0 -33
  143. package/styles/treegrid/_bootstrap4-definition.scss +0 -33
  144. package/styles/treegrid/_bootstrap5-dark-definition.scss +0 -28
  145. package/styles/treegrid/_bootstrap5-definition.scss +0 -28
  146. package/styles/treegrid/_bootstrap5.3-definition.scss +0 -28
  147. package/styles/treegrid/_fabric-dark-definition.scss +0 -33
  148. package/styles/treegrid/_fabric-definition.scss +0 -33
  149. package/styles/treegrid/_fluent-dark-definition.scss +0 -29
  150. package/styles/treegrid/_fluent-definition.scss +0 -29
  151. package/styles/treegrid/_fluent2-definition.scss +0 -28
  152. package/styles/treegrid/_fusionnew-definition.scss +0 -26
  153. package/styles/treegrid/_highcontrast-definition.scss +0 -33
  154. package/styles/treegrid/_highcontrast-light-definition.scss +0 -33
  155. package/styles/treegrid/_icons.scss +0 -47
  156. package/styles/treegrid/_layout.scss +0 -531
  157. package/styles/treegrid/_material-dark-definition.scss +0 -33
  158. package/styles/treegrid/_material-definition.scss +0 -33
  159. package/styles/treegrid/_material3-dark-definition.scss +0 -28
  160. package/styles/treegrid/_material3-definition.scss +0 -28
  161. package/styles/treegrid/_tailwind-dark-definition.scss +0 -28
  162. package/styles/treegrid/_tailwind-definition.scss +0 -28
  163. package/styles/treegrid/_tailwind3-definition.scss +0 -28
  164. package/styles/treegrid/_theme.scss +0 -1
  165. package/styles/treegrid/_variables.scss +0 -2
  166. package/styles/treegrid/bds.css +0 -422
  167. package/styles/treegrid/bds.scss +0 -4
  168. package/styles/treegrid/bootstrap-dark.css +0 -426
  169. package/styles/treegrid/bootstrap-dark.scss +0 -4
  170. package/styles/treegrid/bootstrap.css +0 -432
  171. package/styles/treegrid/bootstrap.scss +0 -4
  172. package/styles/treegrid/bootstrap4.css +0 -426
  173. package/styles/treegrid/bootstrap4.scss +0 -4
  174. package/styles/treegrid/bootstrap5-dark.css +0 -426
  175. package/styles/treegrid/bootstrap5-dark.scss +0 -4
  176. package/styles/treegrid/bootstrap5.3.css +0 -510
  177. package/styles/treegrid/bootstrap5.3.scss +0 -4
  178. package/styles/treegrid/bootstrap5.css +0 -426
  179. package/styles/treegrid/bootstrap5.scss +0 -4
  180. package/styles/treegrid/fabric-dark.css +0 -432
  181. package/styles/treegrid/fabric-dark.scss +0 -4
  182. package/styles/treegrid/fabric.css +0 -432
  183. package/styles/treegrid/fabric.scss +0 -4
  184. package/styles/treegrid/fluent-dark.css +0 -444
  185. package/styles/treegrid/fluent-dark.scss +0 -4
  186. package/styles/treegrid/fluent.css +0 -444
  187. package/styles/treegrid/fluent.scss +0 -4
  188. package/styles/treegrid/fluent2.css +0 -531
  189. package/styles/treegrid/fluent2.scss +0 -4
  190. package/styles/treegrid/highcontrast-light.css +0 -426
  191. package/styles/treegrid/highcontrast-light.scss +0 -4
  192. package/styles/treegrid/highcontrast.css +0 -439
  193. package/styles/treegrid/highcontrast.scss +0 -4
  194. package/styles/treegrid/icons/_bds.scss +0 -38
  195. package/styles/treegrid/icons/_bootstrap-dark.scss +0 -48
  196. package/styles/treegrid/icons/_bootstrap.scss +0 -48
  197. package/styles/treegrid/icons/_bootstrap4.scss +0 -48
  198. package/styles/treegrid/icons/_bootstrap5-dark.scss +0 -1
  199. package/styles/treegrid/icons/_bootstrap5.3.scss +0 -48
  200. package/styles/treegrid/icons/_bootstrap5.scss +0 -48
  201. package/styles/treegrid/icons/_fabric-dark.scss +0 -48
  202. package/styles/treegrid/icons/_fabric.scss +0 -48
  203. package/styles/treegrid/icons/_fluent-dark.scss +0 -1
  204. package/styles/treegrid/icons/_fluent.scss +0 -48
  205. package/styles/treegrid/icons/_fluent2.scss +0 -48
  206. package/styles/treegrid/icons/_fusionnew.scss +0 -31
  207. package/styles/treegrid/icons/_highcontrast-light.scss +0 -48
  208. package/styles/treegrid/icons/_highcontrast.scss +0 -48
  209. package/styles/treegrid/icons/_material-dark.scss +0 -48
  210. package/styles/treegrid/icons/_material.scss +0 -48
  211. package/styles/treegrid/icons/_material3-dark.scss +0 -1
  212. package/styles/treegrid/icons/_material3.scss +0 -48
  213. package/styles/treegrid/icons/_tailwind-dark.scss +0 -48
  214. package/styles/treegrid/icons/_tailwind.scss +0 -48
  215. package/styles/treegrid/icons/_tailwind3.scss +0 -48
  216. package/styles/treegrid/material-dark.css +0 -426
  217. package/styles/treegrid/material-dark.scss +0 -4
  218. package/styles/treegrid/material.css +0 -426
  219. package/styles/treegrid/material.scss +0 -4
  220. package/styles/treegrid/material3-dark.css +0 -508
  221. package/styles/treegrid/material3-dark.scss +0 -4
  222. package/styles/treegrid/material3.css +0 -510
  223. package/styles/treegrid/material3.scss +0 -4
  224. package/styles/treegrid/tailwind-dark.css +0 -426
  225. package/styles/treegrid/tailwind-dark.scss +0 -4
  226. package/styles/treegrid/tailwind.css +0 -426
  227. package/styles/treegrid/tailwind.scss +0 -4
  228. package/styles/treegrid/tailwind3.css +0 -500
  229. package/styles/treegrid/tailwind3.scss +0 -4
@@ -1,5 +1,5 @@
1
1
  import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, initializeTelemetryFeature, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, initializeTelemetry, 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, 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';
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, DomVirtualContentRenderer, 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, destroy as destroy$1, initialLoad, DomVirtualization as DomVirtualization$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';
@@ -489,6 +489,8 @@ var remoteExpand = 'remoteExpand';
489
489
  /** @hidden */
490
490
  var localPagedExpandCollapse = 'localPagedExpandCollapse';
491
491
  /** @hidden */
492
+ var virtualExpandCollapse = 'virtualExpandCollapse';
493
+ /** @hidden */
492
494
  var pagingActions = 'pagingActions';
493
495
  /** @hidden */
494
496
  var printGridInit = 'printGrid-Init';
@@ -602,6 +604,10 @@ var ariaRowIndex = 'aria-rowindex';
602
604
  var actionFailure = 'actionFailure';
603
605
  /** @hidden */
604
606
  var collapseActionComplete = 'collapseActionComplete';
607
+ /** @hidden */
608
+ var hierarchyCheckstateUpdate = 'hierarchy-checkstate-update';
609
+ /** @hidden */
610
+ var beforeDomVirtualRenderRows = 'before-dom-virtual-rows-render';
605
611
 
606
612
  var __extends$5 = (undefined && undefined.__extends) || (function () {
607
613
  var extendStatics = function (d, b) {
@@ -1062,6 +1068,7 @@ var Selection = /** @__PURE__ @class */ (function () {
1062
1068
  this.parent.on('updateGridActions', this.updateGridActions, this);
1063
1069
  this.parent.grid.on('colgroup-refresh', this.headerCheckbox, this);
1064
1070
  this.parent.on('checkboxSelection', this.checkboxSelection, this);
1071
+ this.parent.on(hierarchyCheckstateUpdate, this.rowDropCompleteSelection, this);
1065
1072
  };
1066
1073
  /**
1067
1074
  * Removes previously added event listeners.
@@ -1077,6 +1084,7 @@ var Selection = /** @__PURE__ @class */ (function () {
1077
1084
  this.parent.grid.off('colgroup-refresh', this.headerCheckbox);
1078
1085
  this.parent.off('checkboxSelection', this.checkboxSelection);
1079
1086
  this.parent.off('updateGridActions', this.updateGridActions);
1087
+ this.parent.off(hierarchyCheckstateUpdate, this.rowDropCompleteSelection);
1080
1088
  };
1081
1089
  /**
1082
1090
  * Destroys the selection module and clears internal caches.
@@ -1124,8 +1132,9 @@ var Selection = /** @__PURE__ @class */ (function () {
1124
1132
  this.selectCheckboxes(rowIndex);
1125
1133
  var newCheckState = checkBox.nextElementSibling.classList.contains('e-check');
1126
1134
  this.triggerChkChangeEvent(checkBox, newCheckState, target.closest('tr'));
1135
+ this.updateHeaderCheckboxState();
1127
1136
  }
1128
- else if (checkWrap && checkWrap.querySelectorAll('.e-treeselectall').length > 0 && this.parent.autoCheckHierarchy) {
1137
+ else if (checkWrap && checkWrap.querySelectorAll('.e-treeselectall').length > 0) {
1129
1138
  var frame = checkWrap.querySelector('.e-frame');
1130
1139
  var targetState = frame.classList.contains('e-uncheck') || frame.classList.contains('e-stop');
1131
1140
  this.headerSelection(targetState);
@@ -1202,8 +1211,9 @@ var Selection = /** @__PURE__ @class */ (function () {
1202
1211
  var headerElement = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[this.columnIndex];
1203
1212
  if (headerElement && headerElement.querySelectorAll('.e-treeselectall').length === 0) {
1204
1213
  var value = false; // Initial state can be false.
1205
- var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox' } });
1214
+ var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox', 'aria-label': 'Select all checkbox' } });
1206
1215
  var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });
1216
+ headerElement.classList.add('e-headerchkcelldiv');
1207
1217
  checkWrap.classList.add('e-hierarchycheckbox');
1208
1218
  checkWrap.insertBefore(rowChkBox.cloneNode(), checkWrap.firstChild);
1209
1219
  if (!isNullOrUndefined(headerElement)) {
@@ -1220,6 +1230,7 @@ var Selection = /** @__PURE__ @class */ (function () {
1220
1230
  this.headerSelection();
1221
1231
  } // Update status based on current selections
1222
1232
  }
1233
+ this.updateHeaderCheckboxState();
1223
1234
  }
1224
1235
  };
1225
1236
  /**
@@ -1292,7 +1303,16 @@ var Selection = /** @__PURE__ @class */ (function () {
1292
1303
  for (var i = 0; i < rowIndexes.length; i++) {
1293
1304
  var viewRec = this.parent.getCurrentViewRecords()[rowIndexes[parseInt(i.toString(), 10)]];
1294
1305
  var flatRec = getParentData(this.parent, viewRec.uniqueID);
1295
- var nextState = (flatRec.checkboxState === 'check') ? 'uncheck' : 'check';
1306
+ var nextState = void 0;
1307
+ if (flatRec.checkboxState === 'check') {
1308
+ nextState = 'uncheck';
1309
+ }
1310
+ else if (flatRec.checkboxState === 'indeterminate') {
1311
+ nextState = this.shouldConsiderAllChildren() ? 'uncheck' : 'check';
1312
+ }
1313
+ else {
1314
+ nextState = 'check';
1315
+ }
1296
1316
  flatRec.checkboxState = nextState;
1297
1317
  viewRec.checkboxState = nextState;
1298
1318
  this.traverSelection(flatRec, nextState, false);
@@ -1315,7 +1335,7 @@ var Selection = /** @__PURE__ @class */ (function () {
1315
1335
  if ((!effectiveChildren || effectiveChildren.length === 0) && this.parent.autoCheckHierarchy) {
1316
1336
  effectiveChildren = this.getChildrenFromFlat(record);
1317
1337
  }
1318
- if (this.parent.filterModule && this.parent.filterModule.filteredResult.length > 0
1338
+ if (this.parent.hierarchyCheckboxMode === 'filteredHierarchy' && this.parent.filterModule && this.parent.filterModule.filteredResult.length > 0
1319
1339
  && effectiveChildren && effectiveChildren.length) {
1320
1340
  effectiveChildren = this.getFilteredChildRecords(effectiveChildren);
1321
1341
  }
@@ -1362,8 +1382,15 @@ var Selection = /** @__PURE__ @class */ (function () {
1362
1382
  };
1363
1383
  }
1364
1384
  var summary = this.parentSelectionCounters[record.uniqueID];
1385
+ if (this.shouldConsiderAllChildren()) {
1386
+ summary = this.buildSelectionSummary(record, true, true);
1387
+ if (record.uniqueID) {
1388
+ this.parentSelectionCounters[record.uniqueID] = summary;
1389
+ }
1390
+ }
1365
1391
  var finalState = this.deriveParentState(record, summary);
1366
- if (checkboxState === 'check' && summary.total > 0 && summary.checked === summary.total && summary.indeterminate === 0) {
1392
+ if (checkboxState === 'check' && summary.total > 0 && summary.checked === summary.total && summary.indeterminate === 0
1393
+ && !this.shouldConsiderAllChildren()) {
1367
1394
  finalState = 'check';
1368
1395
  }
1369
1396
  this.updateSelectedItems(record, finalState);
@@ -1429,7 +1456,9 @@ var Selection = /** @__PURE__ @class */ (function () {
1429
1456
  if (!parent) {
1430
1457
  return;
1431
1458
  }
1432
- var summary = this.buildSelectionSummary(parent);
1459
+ var ignoreFilter = this.parent.hierarchyCheckboxMode === 'filteredHierarchy';
1460
+ var useFullChildList = this.shouldConsiderAllChildren();
1461
+ var summary = this.buildSelectionSummary(parent, !ignoreFilter, useFullChildList);
1433
1462
  if (previousChildState) {
1434
1463
  this.applySummaryDelta(summary, previousChildState, -1);
1435
1464
  }
@@ -1443,11 +1472,10 @@ var Selection = /** @__PURE__ @class */ (function () {
1443
1472
  if (parent.checkboxState === desiredState) {
1444
1473
  return;
1445
1474
  }
1446
- var parentPrev = parent.checkboxState;
1447
1475
  parent.checkboxState = desiredState;
1448
1476
  this.updateSelectedItems(parent, desiredState);
1449
1477
  if (parent.parentItem) {
1450
- this.updateParentSelection(parent.parentItem, parentPrev, desiredState);
1478
+ this.updateParentSelection(parent.parentItem);
1451
1479
  }
1452
1480
  };
1453
1481
  /**
@@ -1455,9 +1483,11 @@ var Selection = /** @__PURE__ @class */ (function () {
1455
1483
  *
1456
1484
  * @param {Object} record - The record whose children should be summarized.
1457
1485
  * @param {boolean} [ignoreFilter] - If true, ignore current filter when computing summary.
1486
+ * @param {boolean} [useFullChildList] - If true, skip the `getFilteredChildRecords` narrowing
1487
+ * step even when a filter is active.
1458
1488
  * @returns {{ total: number, checked: number, indeterminate: number }} The computed summary.
1459
1489
  */
1460
- Selection.prototype.buildSelectionSummary = function (record, ignoreFilter) {
1490
+ Selection.prototype.buildSelectionSummary = function (record, ignoreFilter, useFullChildList) {
1461
1491
  var summary = { total: 0, checked: 0, indeterminate: 0 };
1462
1492
  var children = [];
1463
1493
  if (record && Array.isArray(record.childRecords) && record.childRecords.length) {
@@ -1466,7 +1496,8 @@ var Selection = /** @__PURE__ @class */ (function () {
1466
1496
  else {
1467
1497
  children = this.getChildrenFromFlat(record);
1468
1498
  }
1469
- if (!ignoreFilter && this.parent.filterModule && this.parent.filterModule.filteredResult.length > 0) {
1499
+ var filterActive = !!(this.parent.filterModule && this.parent.filterModule.filteredResult.length > 0);
1500
+ if (!ignoreFilter && !useFullChildList && filterActive) {
1470
1501
  children = this.getFilteredChildRecords(children);
1471
1502
  }
1472
1503
  for (var i = 0; i < children.length; i++) {
@@ -1485,6 +1516,22 @@ var Selection = /** @__PURE__ @class */ (function () {
1485
1516
  }
1486
1517
  return summary;
1487
1518
  };
1519
+ /**
1520
+ * Decides whether the parent `checkboxState` derivation should consider the full original
1521
+ * child set instead of the filtered subset.
1522
+ *
1523
+ * @returns {boolean} `true` when derivation should use the full child list.
1524
+ */
1525
+ Selection.prototype.shouldConsiderAllChildren = function () {
1526
+ if (this.parent.hierarchyCheckboxMode !== 'filteredHierarchy') {
1527
+ return false;
1528
+ }
1529
+ var filterActive = !!(this.parent.filterModule && this.parent.filterModule.filteredResult &&
1530
+ this.parent.filterModule.filteredResult.length > 0);
1531
+ var searchActive = !!(this.parent.grid && this.parent.grid.searchSettings && this.parent.grid.searchSettings.key &&
1532
+ this.parent.grid.searchSettings.key.length);
1533
+ return filterActive || searchActive;
1534
+ };
1488
1535
  /**
1489
1536
  * Applies a delta to a selection summary based on a state change.
1490
1537
  *
@@ -1550,6 +1597,13 @@ var Selection = /** @__PURE__ @class */ (function () {
1550
1597
  this.filteredList = [];
1551
1598
  }
1552
1599
  var records = this.resolveHeaderSelectionList(true);
1600
+ if (!isNullOrUndefined(checkAll)
1601
+ && (this.parent.hierarchyCheckboxMode === 'hierarchy' ||
1602
+ (this.parent.hierarchyCheckboxMode === 'filteredHierarchy' && checkAll))
1603
+ && !isRemoteData(this.parent)
1604
+ && this.parent.flatData.length > records.length) {
1605
+ records = this.parent.flatData;
1606
+ }
1553
1607
  if (!isNullOrUndefined(checkAll)) {
1554
1608
  this.resetSelectionCaches();
1555
1609
  var targetState = checkAll ? 'check' : 'uncheck';
@@ -1573,16 +1627,18 @@ var Selection = /** @__PURE__ @class */ (function () {
1573
1627
  */
1574
1628
  Selection.prototype.finalizeParentsAfterBulk = function (records) {
1575
1629
  var all = records;
1630
+ var useFullChildList = this.shouldConsiderAllChildren();
1576
1631
  for (var i = 0; i < all.length; i++) {
1577
1632
  var rec = all[parseInt(i.toString(), 10)];
1578
1633
  if (!rec || !rec.hasChildRecords) {
1579
1634
  continue;
1580
1635
  }
1581
- var summary = this.buildSelectionSummary(rec, true);
1636
+ var summary = this.buildSelectionSummary(rec, true, useFullChildList);
1582
1637
  this.parentSelectionCounters[rec.uniqueID] = summary;
1583
1638
  var finalState = this.deriveParentState(rec, summary);
1584
1639
  if (this.headerSelectionState === 'check' &&
1585
- summary.total > 0 && summary.checked === summary.total && summary.indeterminate === 0) {
1640
+ summary.total > 0 && summary.checked === summary.total && summary.indeterminate === 0 &&
1641
+ !useFullChildList) {
1586
1642
  finalState = 'check';
1587
1643
  }
1588
1644
  else if (this.headerSelectionState === 'uncheck') {
@@ -1632,15 +1688,32 @@ var Selection = /** @__PURE__ @class */ (function () {
1632
1688
  var hasSearch = !!(this.parent.grid && this.parent.grid.searchSettings &&
1633
1689
  this.parent.grid.searchSettings.key && this.parent.grid.searchSettings.key.length);
1634
1690
  var isFilterOrSearch = hasFilter || hasSearch || requestType === 'refresh' || requestType === 'searching';
1691
+ var isSortOrPageRequest = requestType === 'sorting' || requestType === 'paging';
1692
+ var isFilterCleared = (requestType === 'filtering' || requestType === 'searching' ||
1693
+ requestType === 'refresh') && !isFilterOrSearch;
1694
+ var shouldUpdateParents = isSortOrPageRequest || isFilterCleared;
1635
1695
  var currentlySelectedItemsInOrder = isFilterOrSearch ? records : this.selectedItems.slice();
1696
+ var parentsToUpdate = shouldUpdateParents && this.parent.flatData ?
1697
+ this.parent.flatData : currentlySelectedItemsInOrder;
1636
1698
  var newSelectedItems = [];
1637
1699
  var newSelectedUidMap = new Map();
1638
1700
  var newSelectedIndexes = [];
1639
- for (var _i = 0, currentlySelectedItemsInOrder_1 = currentlySelectedItemsInOrder; _i < currentlySelectedItemsInOrder_1.length; _i++) {
1640
- var item = currentlySelectedItemsInOrder_1[_i];
1641
- if (item.hasChildRecords && isFilterOrSearch && item.level === 0 && this.parent.autoCheckHierarchy) {
1642
- this.updateParentSelection(item);
1701
+ for (var _i = 0, parentsToUpdate_1 = parentsToUpdate; _i < parentsToUpdate_1.length; _i++) {
1702
+ var item = parentsToUpdate_1[_i];
1703
+ if (shouldUpdateParents && item.hasChildRecords && item.level === 0 && this.parent.autoCheckHierarchy) {
1704
+ var actualRecord = this.getRecordFromUidCollection(item);
1705
+ var isFilteredHierarchyMode = this.parent.hierarchyCheckboxMode === 'filteredHierarchy';
1706
+ if (isFilterCleared && isFilteredHierarchyMode && actualRecord &&
1707
+ (actualRecord.checkboxState === 'check' || actualRecord.checkboxState === 'uncheck')) {
1708
+ this.traverSelection(actualRecord, actualRecord.checkboxState, false);
1709
+ }
1710
+ else {
1711
+ this.updateParentSelection(item);
1712
+ }
1643
1713
  }
1714
+ }
1715
+ for (var _a = 0, currentlySelectedItemsInOrder_1 = currentlySelectedItemsInOrder; _a < currentlySelectedItemsInOrder_1.length; _a++) {
1716
+ var item = currentlySelectedItemsInOrder_1[_a];
1644
1717
  var actualItem = this.getRecordFromUidCollection(item);
1645
1718
  if (actualItem.uniqueID && actualItem.checkboxState === 'check') {
1646
1719
  newSelectedItems.push(actualItem);
@@ -1650,8 +1723,8 @@ var Selection = /** @__PURE__ @class */ (function () {
1650
1723
  if (!isFilterOrSearch) {
1651
1724
  var allFlatData = this.parent.flatData;
1652
1725
  if (allFlatData) {
1653
- for (var _a = 0, allFlatData_1 = allFlatData; _a < allFlatData_1.length; _a++) {
1654
- var record = allFlatData_1[_a];
1726
+ for (var _b = 0, allFlatData_1 = allFlatData; _b < allFlatData_1.length; _b++) {
1727
+ var record = allFlatData_1[_b];
1655
1728
  if (!record || record.isSummaryRow) {
1656
1729
  continue;
1657
1730
  }
@@ -1665,8 +1738,8 @@ var Selection = /** @__PURE__ @class */ (function () {
1665
1738
  this.selectedItems = newSelectedItems;
1666
1739
  this.selectedUidMap = newSelectedUidMap;
1667
1740
  this.buildVisibleUidMap();
1668
- for (var _b = 0, _c = this.selectedItems; _b < _c.length; _b++) {
1669
- var item = _c[_b];
1741
+ for (var _c = 0, _d = this.selectedItems; _c < _d.length; _c++) {
1742
+ var item = _d[_c];
1670
1743
  var visibleIdx = this.visibleUidIndex[item.uniqueID];
1671
1744
  if (visibleIdx !== undefined) {
1672
1745
  newSelectedIndexes.push(visibleIdx);
@@ -1960,7 +2033,8 @@ var Selection = /** @__PURE__ @class */ (function () {
1960
2033
  else if (args.requestType === 'add' && this.parent.autoCheckHierarchy) {
1961
2034
  args.data.checkboxState = 'uncheck';
1962
2035
  }
1963
- else if (requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh') {
2036
+ else if (requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh' ||
2037
+ requestType === 'save' || requestType === 'cancel') {
1964
2038
  this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(), requestType);
1965
2039
  this.refreshVisibleCheckboxes();
1966
2040
  if (this.parent.autoCheckHierarchy) {
@@ -1972,21 +2046,108 @@ var Selection = /** @__PURE__ @class */ (function () {
1972
2046
  if ((requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh' ||
1973
2047
  requestType === 'sorting' || requestType === 'paging' || requestType === 'expanding' ||
1974
2048
  requestType === 'expand' || requestType === 'collapsing' || requestType === 'collapse') && !isRemoteData(this.parent)) {
1975
- if (!(isCheckboxcolumn(this.parent) && (requestType === 'refresh' && this.parent['isVirtualExpandCollapse']))) {
1976
- this.selectedItems = [];
1977
- this.selectedUidMap = new Map();
1978
- this.selectedIndexes = [];
1979
- }
1980
- if (requestType === 'filtering' || requestType === 'searching' || requestType === 'sorting') {
1981
- this.headerSelection(false);
1982
- }
2049
+ this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(), requestType);
1983
2050
  this.refreshVisibleCheckboxes();
1984
- if (this.parent.autoCheckHierarchy) {
1985
- this.updateHeaderCheckboxState();
1986
- }
2051
+ this.updateHeaderCheckboxState();
2052
+ }
2053
+ }
2054
+ }
2055
+ };
2056
+ /**
2057
+ *
2058
+ * @param {Object} args - The notification payload from `rowDragdrop.dropRows`.
2059
+ * @returns {void}
2060
+ */
2061
+ Selection.prototype.rowDropCompleteSelection = function (args) {
2062
+ var _this = this;
2063
+ var dragged = args.draggedRecords;
2064
+ var draggedUids = new Set();
2065
+ for (var dragIndex = 0; dragIndex < dragged.length; dragIndex++) {
2066
+ var draggedRecord = dragged[parseInt(dragIndex.toString(), 10)];
2067
+ var draggedUid = draggedRecord.uniqueID;
2068
+ if (draggedUid) {
2069
+ draggedUids.add(draggedUid);
2070
+ }
2071
+ }
2072
+ var walked = new Set();
2073
+ var deriveState = function (startingRecord) {
2074
+ if (!startingRecord) {
2075
+ return;
2076
+ }
2077
+ var recordUid = startingRecord.uniqueID;
2078
+ if (!recordUid || walked.has(recordUid) || draggedUids.has(recordUid)) {
2079
+ return;
2080
+ }
2081
+ var liveRecord = _this.parent.uniqueIDCollection[String(recordUid)] || startingRecord;
2082
+ walked.add(recordUid);
2083
+ var childRecords = _this.getChildrenFromFlat(liveRecord);
2084
+ var totalChildren = 0;
2085
+ var checkedChildren = 0;
2086
+ var indeterminateChildren = 0;
2087
+ for (var childIndex = 0; childIndex < childRecords.length; childIndex++) {
2088
+ var childRecord = childRecords[parseInt(childIndex.toString(), 10)];
2089
+ if (!childRecord || childRecord.isSummaryRow) {
2090
+ continue;
2091
+ }
2092
+ if (childRecord.hasChildRecords) {
2093
+ deriveState(childRecord);
2094
+ }
2095
+ totalChildren++;
2096
+ if (childRecord.checkboxState === 'check') {
2097
+ checkedChildren++;
2098
+ }
2099
+ else if (childRecord.checkboxState === 'indeterminate') {
2100
+ indeterminateChildren++;
2101
+ }
2102
+ }
2103
+ var summary = {
2104
+ total: totalChildren,
2105
+ checked: checkedChildren,
2106
+ indeterminate: indeterminateChildren
2107
+ };
2108
+ _this.parentSelectionCounters["" + recordUid] = summary;
2109
+ var desiredState = _this.deriveParentState(liveRecord, { total: totalChildren, checked: checkedChildren, indeterminate: indeterminateChildren });
2110
+ if (liveRecord.checkboxState !== desiredState) {
2111
+ _this.updateSelectedItems(liveRecord, desiredState);
2112
+ }
2113
+ };
2114
+ var startingAncestors = [];
2115
+ var startingAncestorUids = new Set();
2116
+ var collectAncestorChain = function (record) {
2117
+ var currentRecord = record;
2118
+ while (currentRecord) {
2119
+ var currentUid = currentRecord.uniqueID;
2120
+ if (currentUid && !startingAncestorUids.has(currentUid)) {
2121
+ startingAncestors.push(currentRecord);
2122
+ startingAncestorUids.add(currentUid);
2123
+ }
2124
+ currentRecord = currentRecord.parentItem;
2125
+ }
2126
+ };
2127
+ if (args && args.oldParents) {
2128
+ for (var oldIndex = 0; oldIndex < args.oldParents.length; oldIndex++) {
2129
+ var oldParent = args.oldParents[parseInt(oldIndex.toString(), 10)];
2130
+ if (oldParent) {
2131
+ collectAncestorChain(oldParent);
1987
2132
  }
1988
2133
  }
1989
2134
  }
2135
+ for (var dragIndex = 0; dragIndex < dragged.length; dragIndex++) {
2136
+ var draggedRecord = dragged[parseInt(dragIndex.toString(), 10)];
2137
+ var newParent = draggedRecord && draggedRecord.parentItem;
2138
+ if (newParent) {
2139
+ collectAncestorChain(newParent);
2140
+ }
2141
+ }
2142
+ if (args && args.droppedRecord && args.dropPosition === 'middleSegment') {
2143
+ collectAncestorChain(args.droppedRecord);
2144
+ }
2145
+ for (var startIndex = 0; startIndex < startingAncestors.length; startIndex++) {
2146
+ deriveState(startingAncestors[parseInt(startIndex.toString(), 10)]);
2147
+ }
2148
+ this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(true), '');
2149
+ this.refreshVisibleCheckboxes();
2150
+ this.updateHeaderCheckboxState();
1990
2151
  };
1991
2152
  /**
1992
2153
  * Retrieves checked record objects.
@@ -2014,6 +2175,17 @@ var Selection = /** @__PURE__ @class */ (function () {
2014
2175
  }
2015
2176
  return orderedVisibleIndexes;
2016
2177
  };
2178
+ /**
2179
+ * Deletes all currently checked records in the TreeGrid.
2180
+ *
2181
+ * @returns {void}
2182
+ */
2183
+ Selection.prototype.deleteCheckedRecords = function () {
2184
+ if (!isNullOrUndefined(this.parent.editModule) && !isNullOrUndefined(this.parent.editSettings)
2185
+ && this.parent.editSettings.allowDeleting) {
2186
+ this.parent.deleteRecord(this.parent.getPrimaryKeyFieldNames()[0], this.getCheckedrecords());
2187
+ }
2188
+ };
2017
2189
  return Selection;
2018
2190
  }());
2019
2191
 
@@ -2206,7 +2378,7 @@ var Render = /** @__PURE__ @class */ (function () {
2206
2378
  var collapsed = (this.parent.initialRender && (!(isNullOrUndefined(parentData[this.parent.expandStateMapping]) ||
2207
2379
  parentData[this.parent.expandStateMapping]) || this.parent.enableCollapseAll)) ||
2208
2380
  !getExpandStatus(this.parent, args.data, this.parent.grid.getCurrentViewRecords());
2209
- if (collapsed && !isNullOrUndefined(args.row)) {
2381
+ if (collapsed && !isNullOrUndefined(args.row) && !this.parent.enableDomVirtualization) {
2210
2382
  this.parent['toggleRowVisibility'](args.row, 'e-childrow-hidden');
2211
2383
  var rowsObj = this.parent.grid.getRowsObject();
2212
2384
  if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
@@ -2219,7 +2391,8 @@ var Render = /** @__PURE__ @class */ (function () {
2219
2391
  var parentrec = this.parent.getCurrentViewRecords().filter(function (rec) {
2220
2392
  return getValue(proxy_1.idMapping, rec) === getValue(proxy_1.parentIdMapping, data);
2221
2393
  });
2222
- if (parentrec.length > 0 && !parentrec[0].isSummaryRow && !isNullOrUndefined(args.row)) {
2394
+ if (parentrec.length > 0 && !parentrec[0].isSummaryRow && !isNullOrUndefined(args.row) &&
2395
+ !this.parent.enableDomVirtualization) {
2223
2396
  var display = parentrec[0].expanded ? 'e-childrow-visible' : 'e-childrow-hidden';
2224
2397
  this.parent['toggleRowVisibility'](args.row, display);
2225
2398
  }
@@ -2241,7 +2414,7 @@ var Render = /** @__PURE__ @class */ (function () {
2241
2414
  else if (args.row.querySelector('.e-treegridcollapse')) {
2242
2415
  args.row.setAttribute('aria-expanded', 'false');
2243
2416
  }
2244
- if (this.parent.enableCollapseAll && this.parent.initialRender) {
2417
+ if (this.parent.enableCollapseAll && this.parent.initialRender && !this.parent.enableDomVirtualization) {
2245
2418
  if (!isNullOrUndefined(data.parentItem)) {
2246
2419
  this.parent['toggleRowVisibility'](args.row, 'e-childrow-hidden');
2247
2420
  }
@@ -2567,6 +2740,17 @@ var Render = /** @__PURE__ @class */ (function () {
2567
2740
  return Render;
2568
2741
  }());
2569
2742
 
2743
+ var __assign = (undefined && undefined.__assign) || function () {
2744
+ __assign = Object.assign || function(t) {
2745
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2746
+ s = arguments[i];
2747
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2748
+ t[p] = s[p];
2749
+ }
2750
+ return t;
2751
+ };
2752
+ return __assign.apply(this, arguments);
2753
+ };
2570
2754
  /**
2571
2755
  * Internal dataoperations for tree grid
2572
2756
  *
@@ -2585,6 +2769,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2585
2769
  this.addEventListener();
2586
2770
  this.dataResults = {};
2587
2771
  this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);
2772
+ this.enableCollapseAll = this.parent.enableCollapseAll;
2773
+ this.uniqueIDCollection = this.parent.uniqueIDCollection;
2588
2774
  }
2589
2775
  /**
2590
2776
  * @hidden
@@ -2694,17 +2880,19 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2694
2880
  this.hierarchyData = data;
2695
2881
  }
2696
2882
  else {
2883
+ var idMapping = this.parent.idMapping;
2697
2884
  var keys = Object.keys(data);
2698
2885
  for (var i = 0; i < keys.length; i++) {
2699
2886
  var tempData = data[parseInt(i.toString(), 10)];
2700
2887
  this.hierarchyData.push(extend$1({}, tempData));
2701
- if (!isNullOrUndefined(tempData[this.parent.idMapping])) {
2702
- this.taskIds.push(tempData[this.parent.idMapping]);
2888
+ if (!isNullOrUndefined(tempData["" + idMapping])) {
2889
+ this.taskIds.push(tempData["" + idMapping]);
2703
2890
  }
2704
2891
  }
2705
2892
  }
2706
2893
  if (this.isSelfReference) {
2707
2894
  var selfData = [];
2895
+ var childMapping = this.parent.childMapping;
2708
2896
  var mappingData = new DataManager(this.hierarchyData).executeLocal(new Query()
2709
2897
  .group(this.parent.parentIdMapping));
2710
2898
  for (var i = 0; i < mappingData.length; i++) {
@@ -2713,7 +2901,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2713
2901
  if (!isNullOrUndefined(groupData.key)) {
2714
2902
  if (index > -1) {
2715
2903
  var childData = (groupData.items);
2716
- this.hierarchyData[parseInt(index.toString(), 10)][this.parent.childMapping] = childData;
2904
+ this.hierarchyData[parseInt(index.toString(), 10)]["" + childMapping] = childData;
2717
2905
  continue;
2718
2906
  }
2719
2907
  }
@@ -2760,7 +2948,6 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2760
2948
  * @returns {void}
2761
2949
  */
2762
2950
  DataManipulation.prototype.updateParentRemoteData = function (args) {
2763
- var _this = this;
2764
2951
  var actionArgs = 'actionArgs';
2765
2952
  if (isRemoteData(this.parent) && this.parent.enableVirtualization && args["" + actionArgs].requestType === 'virtualscroll') {
2766
2953
  this.parent.hideSpinner();
@@ -2776,16 +2963,20 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2776
2963
  }
2777
2964
  else {
2778
2965
  if (this.parent.loadChildOnDemand) {
2966
+ var isRemote = isRemoteData(this.parent);
2967
+ var enableVirtualization = this.parent.enableVirtualization;
2968
+ var getUidval = getUid(this.parent.element.id + '_data_');
2969
+ var parentIdMapping_1 = this.parent.parentIdMapping;
2970
+ var idMapping_1 = this.parent.idMapping;
2779
2971
  var _loop_1 = function (rec) {
2780
2972
  if (isCountRequired(this_1.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&
2781
2973
  this_1.parent.initialRender) {
2782
2974
  records[parseInt(rec.toString(), 10)].expanded = false;
2783
2975
  }
2784
- if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization) {
2976
+ if (isRemote && enableVirtualization) {
2785
2977
  var childRecords_1 = [];
2786
- var parent_1 = this_1.parent;
2787
2978
  records.filter(function (e) {
2788
- if (e["" + parent_1.parentIdMapping] === records[parseInt(rec.toString(), 10)]["" + parent_1.idMapping]) {
2979
+ if (e["" + parentIdMapping_1] === records[parseInt(rec.toString(), 10)]["" + idMapping_1]) {
2789
2980
  childRecords_1.push(e);
2790
2981
  }
2791
2982
  });
@@ -2798,17 +2989,17 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2798
2989
  }
2799
2990
  if (isNullOrUndefined(records[parseInt(rec.toString(), 10)].index)) {
2800
2991
  records[parseInt(rec.toString(), 10)].taskData = extend$1({}, records[parseInt(rec.toString(), 10)]);
2801
- records[parseInt(rec.toString(), 10)].uniqueID = getUid(this_1.parent.element.id + '_data_');
2992
+ records[parseInt(rec.toString(), 10)].uniqueID = getUidval;
2802
2993
  setValue('uniqueIDCollection.' + records[parseInt(rec.toString(), 10)].uniqueID, records[parseInt(rec.toString(), 10)], this_1.parent);
2803
- if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization && records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping] && (isNullOrUndefined(records[parseInt(rec.toString(), 10)].level) || records[parseInt(rec.toString(), 10)].level === 0)) {
2804
- var parentID_1 = records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping];
2805
- var parentRec = records.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
2994
+ if (isRemote && enableVirtualization && records[parseInt(rec.toString(), 10)]["" + parentIdMapping_1] && (isNullOrUndefined(records[parseInt(rec.toString(), 10)].level) || records[parseInt(rec.toString(), 10)].level === 0)) {
2995
+ var parentID_1 = records[parseInt(rec.toString(), 10)]["" + parentIdMapping_1];
2996
+ var parentRec = records.find(function (record) { return record["" + idMapping_1] === parentID_1; });
2806
2997
  if (parentRec) {
2807
2998
  records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
2808
2999
  }
2809
3000
  else {
2810
- var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
2811
- if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
3001
+ var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + idMapping_1] === parentID_1; });
3002
+ if (isNullOrUndefined(parentRec_1["" + parentIdMapping_1])) {
2812
3003
  records[parseInt(rec.toString(), 10)].level = 1;
2813
3004
  }
2814
3005
  else {
@@ -2821,7 +3012,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2821
3012
  }
2822
3013
  records[parseInt(rec.toString(), 10)].index = Math.ceil(Math.random() * 1000);
2823
3014
  if ((records[parseInt(rec.toString(), 10)][this_1.parent.hasChildMapping] ||
2824
- this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)][this_1.parent.idMapping]) !== -1)) {
3015
+ this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)]["" + idMapping_1]) !== -1)) {
2825
3016
  records[parseInt(rec.toString(), 10)].hasChildRecords = true;
2826
3017
  }
2827
3018
  records[parseInt(rec.toString(), 10)].checkboxState = 'uncheck';
@@ -2878,35 +3069,44 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2878
3069
  gridRows = [].slice.call(rows);
2879
3070
  }
2880
3071
  var childRecord;
2881
- if (rowDetails.rows.length > 0) {
2882
- if (!isChild) {
2883
- rowDetails.record.expanded = true;
2884
- }
2885
- for (var i = 0; i < rowDetails.rows.length; i++) {
2886
- this.parent['toggleRowVisibility'](rowDetails.rows[parseInt(i.toString(), 10)], 'e-childrow-visible');
2887
- if (!this.parent.loadChildOnDemand) {
2888
- var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
2889
- childRecord = this.parent.rowTemplate ?
2890
- this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
2891
- this.parent.grid.getRowObjectFromUID(rowDetails.rows[parseInt(i.toString(), 10)].getAttribute('data-uid')).data;
2892
- if (!isNullOrUndefined(targetEle) && childRecord.expanded) {
2893
- addClass([targetEle], 'e-treegridexpand');
2894
- removeClass([targetEle], 'e-treegridcollapse');
3072
+ if (rowDetails.rows.length > 0 || (this.parent.enableDomVirtualization &&
3073
+ this.parent.uniqueIDCollpaseCollection[rowDetails.record.uniqueID])) {
3074
+ if (this.parent.enableDomVirtualization) {
3075
+ this.parent.notify(virtualExpandCollapse, { action: 'expand', row: rowDetails.parentRow, record: rowDetails.record });
3076
+ this.parent.notify(localPagedExpandCollapse, { action: 'expand', row: rowDetails.parentRow, record: rowDetails.record });
3077
+ }
3078
+ else {
3079
+ if (!isChild) {
3080
+ rowDetails.record.expanded = true;
3081
+ }
3082
+ var rowTemplate = this.parent.rowTemplate;
3083
+ var loadChildOnDemand = this.parent.loadChildOnDemand;
3084
+ for (var i = 0; i < rowDetails.rows.length; i++) {
3085
+ this.parent['toggleRowVisibility'](rowDetails.rows[parseInt(i.toString(), 10)], 'e-childrow-visible');
3086
+ if (!loadChildOnDemand) {
3087
+ var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
3088
+ childRecord = rowTemplate ?
3089
+ this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
3090
+ this.parent.grid.getRowObjectFromUID(rowDetails.rows[parseInt(i.toString(), 10)].getAttribute('data-uid')).data;
3091
+ if (!isNullOrUndefined(targetEle) && childRecord.expanded) {
3092
+ addClass([targetEle], 'e-treegridexpand');
3093
+ removeClass([targetEle], 'e-treegridcollapse');
3094
+ }
3095
+ var childRows = [];
3096
+ childRows = gridRows.filter(function (r) {
3097
+ return r.querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1));
3098
+ });
3099
+ if (childRows.length && childRecord.expanded) {
3100
+ this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);
3101
+ }
2895
3102
  }
2896
- var childRows = [];
2897
- childRows = gridRows.filter(function (r) {
2898
- return r.querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1));
2899
- });
2900
- if (childRows.length && childRecord.expanded) {
2901
- this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);
3103
+ var expandingTd = rowDetails.rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowcollapse');
3104
+ if (!isNullOrUndefined(expandingTd)) {
3105
+ this.parent.grid.detailRowModule.expand(expandingTd);
2902
3106
  }
2903
3107
  }
2904
- var expandingTd = rowDetails.rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowcollapse');
2905
- if (!isNullOrUndefined(expandingTd)) {
2906
- this.parent.grid.detailRowModule.expand(expandingTd);
2907
- }
3108
+ this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
2908
3109
  }
2909
- this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
2910
3110
  }
2911
3111
  else {
2912
3112
  this.fetchRemoteChildData({ action: rowDetails["" + name], record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
@@ -2946,12 +3146,14 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2946
3146
  var remoteExpandedData = 'remoteExpandedData';
2947
3147
  var remoteCollapsedData = 'remoteCollapsedData';
2948
3148
  var level = 'level';
2949
- var datas = _this.parent.grid.currentViewData.slice();
3149
+ var currentViewData = _this.parent.grid.currentViewData;
3150
+ var datas = currentViewData.slice();
2950
3151
  var inx;
2951
3152
  var idMapping = _this.parent.idMapping;
3153
+ var parentIdMapping = _this.parent.parentIdMapping;
2952
3154
  if (_this.parent['isGantt'] && _this.parent.loadChildOnDemand && _this.parent.hasChildMapping) {
2953
- for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {
2954
- if (rowDetails.record[idMapping] === _this.parent.grid.currentViewData[i][idMapping]) {
3155
+ for (var i = 0; i < currentViewData.length; i++) {
3156
+ if (rowDetails.record[idMapping] === currentViewData[i][idMapping]) {
2955
3157
  inx = i;
2956
3158
  break;
2957
3159
  }
@@ -2963,7 +3165,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2963
3165
  if (_this.parent.enableVirtualization && (rowDetails.action === 'collapse' || rowDetails.action === 'remoteExpand')) {
2964
3166
  datas = [];
2965
3167
  for (var i = 0; i < inx; i++) {
2966
- datas.push(_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
3168
+ datas.push(currentViewData[parseInt(i.toString(), 10)]);
2967
3169
  }
2968
3170
  }
2969
3171
  if (inx === -1) {
@@ -2978,14 +3180,14 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2978
3180
  var resultChildData = [];
2979
3181
  if (rowDetails.action === 'remoteExpand' && _this.parent.grid.filterModule && _this.parent.grid.filterModule['value']) {
2980
3182
  for (var i = 0; i < datas.length; i++) {
2981
- if (Object.prototype.hasOwnProperty.call(datas[parseInt(i.toString(), 10)], _this.parent.parentIdMapping) && datas[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping] !== null && datas[parseInt(i.toString(), 10)].level === 0) {
3183
+ if (Object.prototype.hasOwnProperty.call(datas[parseInt(i.toString(), 10)], parentIdMapping) && datas[parseInt(i.toString(), 10)]['' + parentIdMapping] !== null && datas[parseInt(i.toString(), 10)].level === 0) {
2982
3184
  datas.splice(i, 1);
2983
3185
  i--;
2984
3186
  }
2985
3187
  }
2986
3188
  for (var i = 0; i < result.length; i++) {
2987
- if (rowDetails.record['' + _this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + _this.parent.idMapping] &&
2988
- rowDetails.record['' + _this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping]) {
3189
+ if (rowDetails.record['' + idMapping] !== result[parseInt(i.toString(), 10)]['' + idMapping] &&
3190
+ rowDetails.record['' + idMapping] === result[parseInt(i.toString(), 10)]['' + parentIdMapping]) {
2989
3191
  if (Object.prototype.hasOwnProperty.call(result, i)) {
2990
3192
  resultChildData.push(result[parseInt(i.toString(), 10)]);
2991
3193
  }
@@ -2996,8 +3198,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2996
3198
  if (_this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2997
3199
  rowDetails.record.childRecords = [];
2998
3200
  for (var i = 0; i < result.length; i++) {
2999
- if (rowDetails.record['' + _this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + _this.parent.idMapping] &&
3000
- rowDetails.record['' + _this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
3201
+ if (rowDetails.record['' + idMapping] !== result[parseInt(i.toString(), 10)]['' + idMapping] &&
3202
+ rowDetails.record['' + idMapping] === result[parseInt(i.toString(), 10)]['' + parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
3001
3203
  rowDetails.record.childRecords.push(result[parseInt(i.toString(), 10)]);
3002
3204
  }
3003
3205
  }
@@ -3007,20 +3209,20 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3007
3209
  }
3008
3210
  var _loop_2 = function (r) {
3009
3211
  var record = result[parseInt(r.toString(), 10)];
3010
- if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
3212
+ if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action === 'remoteExpand') {
3011
3213
  _this.parent["" + remoteExpandedData].push(rowDetails.record);
3012
3214
  }
3013
- else if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'collapse') {
3215
+ else if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action === 'collapse') {
3014
3216
  for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
3015
- if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
3217
+ if (rowDetails.record["" + idMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + idMapping]) {
3016
3218
  _this.parent["" + remoteExpandedData].splice(i, 1);
3017
3219
  }
3018
3220
  }
3019
3221
  }
3020
3222
  record.taskData = extend$1({}, record);
3021
- if (record["" + _this.parent.parentIdMapping] && _this.parent.enableVirtualization && _this.parent["" + remoteExpandedData].length) {
3223
+ if (record["" + parentIdMapping] && _this.parent.enableVirtualization && _this.parent["" + remoteExpandedData].length) {
3022
3224
  for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
3023
- if (record["" + _this.parent.parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
3225
+ if (record["" + parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + idMapping]) {
3024
3226
  record.level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
3025
3227
  var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
3026
3228
  delete parentData.childRecords;
@@ -3031,9 +3233,9 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3031
3233
  }
3032
3234
  else if (_this.parent.enableVirtualization) {
3033
3235
  if ((record["" + _this.parent.hasChildMapping] ||
3034
- _this.parentItems.indexOf(record["" + _this.parent.idMapping]) !== -1)
3236
+ _this.parentItems.indexOf(record["" + idMapping]) !== -1)
3035
3237
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
3036
- if (isNullOrUndefined(record["" + _this.parent.parentIdMapping])) {
3238
+ if (isNullOrUndefined(record["" + parentIdMapping])) {
3037
3239
  record.level = 0;
3038
3240
  if (rowDetails.action === 'remoteExpand') {
3039
3241
  record.childRecords = [];
@@ -3060,45 +3262,45 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3060
3262
  }
3061
3263
  record.index = Math.ceil(Math.random() * 1000);
3062
3264
  record.uniqueID = getUid(_this.parent.element.id + '_data_');
3063
- if (rowDetails.record["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
3265
+ if (rowDetails.record["" + idMapping] === record["" + idMapping]) {
3064
3266
  rowDetails.record.uniqueID = record.uniqueID;
3065
3267
  }
3066
3268
  record.checkboxState = 'uncheck';
3067
3269
  if (_this.parent.enableVirtualization && isNullOrUndefined(record.level)) {
3068
- for (var p = 0; p < _this.parent.grid.currentViewData.length; p++) {
3069
- if (_this.parent.grid.currentViewData[parseInt(p.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.parentIdMapping]) {
3070
- record.level = _this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
3270
+ for (var p = 0; p < currentViewData.length; p++) {
3271
+ if (currentViewData[parseInt(p.toString(), 10)]["" + idMapping] === record["" + parentIdMapping]) {
3272
+ record.level = currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
3071
3273
  }
3072
3274
  }
3073
3275
  }
3074
3276
  setValue('uniqueIDCollection.' + record.uniqueID, record, _this.parent);
3075
3277
  // delete result[r].parentItem.childRecords;
3076
3278
  if ((record["" + _this.parent.hasChildMapping] ||
3077
- _this.parentItems.indexOf(record["" + _this.parent.idMapping]) !== -1)
3279
+ _this.parentItems.indexOf(record["" + idMapping]) !== -1)
3078
3280
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
3079
3281
  record.hasChildRecords = true;
3080
3282
  if (_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand) {
3081
3283
  for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
3082
- if (record["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
3284
+ if (record["" + idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + idMapping]) {
3083
3285
  record.expanded = _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];
3084
3286
  }
3085
3287
  }
3086
- if (rowDetails.action === 'collapse' && record["" + _this.parent.idMapping] !== rowDetails.record["" + _this.parent.idMapping] && record.expanded !== false) {
3288
+ if (rowDetails.action === 'collapse' && record["" + idMapping] !== rowDetails.record["" + idMapping] && record.expanded !== false) {
3087
3289
  record.expanded = true;
3088
3290
  }
3089
- else if (rowDetails.action === 'collapse' && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
3291
+ else if (rowDetails.action === 'collapse' && record["" + idMapping] === rowDetails.record["" + idMapping]) {
3090
3292
  record.expanded = false;
3091
3293
  _this.parent["" + remoteCollapsedData].push(rowDetails.record);
3092
3294
  }
3093
3295
  else if (rowDetails.action === 'remoteExpand') {
3094
- for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {
3095
- if (_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
3096
- result.splice(r, 1, _this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
3296
+ for (var i = 0; i < currentViewData.length; i++) {
3297
+ if (currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
3298
+ result.splice(r, 1, currentViewData[parseInt(i.toString(), 10)]);
3097
3299
  }
3098
3300
  }
3099
3301
  if (record[_this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
3100
3302
  for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
3101
- if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
3303
+ if (rowDetails.record["" + idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
3102
3304
  _this.parent["" + remoteCollapsedData].splice(i, 1);
3103
3305
  }
3104
3306
  }
@@ -3108,14 +3310,14 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3108
3310
  }
3109
3311
  }
3110
3312
  }
3111
- else if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action !== 'collapse') {
3313
+ else if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action !== 'collapse') {
3112
3314
  record.expanded = true;
3113
3315
  }
3114
3316
  else if (!(_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand)) {
3115
3317
  record.expanded = false;
3116
3318
  }
3117
3319
  }
3118
- var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
3320
+ var exists = datas.some(function (data) { return data["" + idMapping] === record["" + idMapping]; });
3119
3321
  if (!exists) {
3120
3322
  datas.splice(inx + r + 1, 0, record);
3121
3323
  }
@@ -3123,7 +3325,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3123
3325
  for (var r = 0; r < result.length; r++) {
3124
3326
  _loop_2(r);
3125
3327
  }
3126
- var localIdMapping = _this.parent.idMapping;
3328
+ var localIdMapping = idMapping;
3127
3329
  if (_this.parent.enableVirtualization && _this.parent.loadChildOnDemand) {
3128
3330
  datas.sort(function (firstRecord, secondRecord) {
3129
3331
  return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
@@ -3160,6 +3362,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3160
3362
  _this.parent.notify('infinite-remote-expand', notifyArgs);
3161
3363
  }
3162
3364
  else {
3365
+ virtualArgs = _this.parent.enableDomVirtualization ? { requestType: 'refresh' } : virtualArgs;
3163
3366
  getValue('grid.renderModule', _this.parent).dataManagerSuccess(e, virtualArgs);
3164
3367
  }
3165
3368
  _this.parent.trigger(expanded, args);
@@ -3191,100 +3394,123 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3191
3394
  }
3192
3395
  }
3193
3396
  };
3194
- DataManipulation.prototype.createRecords = function (data, parentRecords) {
3397
+ DataManipulation.prototype.createConvertRecords = function (data, parentRecords) {
3195
3398
  var treeGridData = [];
3399
+ var flatData = this.parent.flatData;
3400
+ var parentData = this.parent.parentData;
3196
3401
  var keys = Object.keys(data);
3197
- for (var i = 0, len = keys.length; i < len; i++) {
3198
- var currentData = extend$1({}, data[parseInt(i.toString(), 10)]);
3402
+ var levelBase = 0;
3403
+ var parentItem = null;
3404
+ var parentUniqueID = null;
3405
+ if (!isNullOrUndefined(parentRecords)) {
3406
+ parentItem = __assign({}, parentRecords);
3407
+ delete parentItem.childRecords;
3408
+ delete parentItem[this.childMapping];
3409
+ if (this.isSelfReference) {
3410
+ delete parentItem.taskData[this.childMapping];
3411
+ }
3412
+ levelBase = (parentItem.level || 0) + 1;
3413
+ parentUniqueID = parentItem.uniqueID;
3414
+ }
3415
+ for (var i = 0; i < keys.length; i++) {
3416
+ var currentData = __assign({}, data[parseInt(i.toString(), 10)]);
3199
3417
  currentData.taskData = data[parseInt(i.toString(), 10)];
3200
- var level = 0;
3201
- this.storedIndex++;
3202
- if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
3418
+ if (!currentData.index) {
3419
+ this.storedIndex++;
3203
3420
  currentData.index = this.storedIndex;
3204
3421
  }
3205
- var childMapping = currentData[this.parent.childMapping];
3206
- var hasChildren = !isNullOrUndefined(childMapping) && childMapping.length > 0;
3207
- var shouldCount = isCountRequired(this.parent);
3208
- var hasChildMapping = currentData[this.parent.hasChildMapping];
3209
- if ((hasChildren && !shouldCount) || (hasChildMapping && shouldCount)) {
3210
- currentData.hasChildRecords = true;
3211
- }
3212
3422
  else {
3213
- currentData.hasChildRecords = false;
3423
+ this.storedIndex++;
3214
3424
  }
3215
- if ((!isNullOrUndefined(childMapping) && !shouldCount) ||
3216
- (hasChildMapping) && shouldCount) {
3217
- if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
3218
- && isNullOrUndefined(childMapping)) {
3425
+ var childMapping = currentData[this.childMapping];
3426
+ var hasChildren = childMapping && childMapping.length > 0;
3427
+ var hasChildMapping = currentData[this.hasChildMapping];
3428
+ currentData.hasChildRecords = ((hasChildren && !this.isCountRequired) ||
3429
+ (hasChildMapping && this.isCountRequired)) ? true : false;
3430
+ if (currentData.hasChildRecords) {
3431
+ if (this.enableCollapseAll || (!isNullOrUndefined(this.parent.dataStateChange) && !childMapping)) {
3219
3432
  currentData.expanded = false;
3220
3433
  }
3221
3434
  else {
3222
- currentData.expanded = !isNullOrUndefined(currentData[this.parent.expandStateMapping])
3223
- ? currentData[this.parent.expandStateMapping] : true;
3435
+ currentData.expanded = !isNullOrUndefined(currentData["" + this.expandStateMapping]) ? currentData["" + this.expandStateMapping] : true;
3224
3436
  }
3225
3437
  }
3226
- if (this.isSelfReference && isNullOrUndefined(currentData[this.parent.parentIdMapping])) {
3227
- this.parent.parentData.push(currentData);
3438
+ if (this.isSelfReference && !currentData["" + this.parentIdMapping]) {
3439
+ parentData.push(currentData);
3228
3440
  }
3229
- currentData.uniqueID = getUid(this.parent.element.id + '_data_');
3230
- this.parent.uniqueIDCollection[currentData.uniqueID] = currentData;
3231
- if (!isNullOrUndefined(parentRecords)) {
3232
- var parentData = extend$1({}, parentRecords);
3233
- delete parentData.childRecords;
3234
- delete parentData[this.parent.childMapping];
3235
- if (this.isSelfReference) {
3236
- delete parentData.taskData[this.parent.childMapping];
3237
- }
3238
- currentData.parentItem = parentData;
3239
- currentData.parentUniqueID = parentData.uniqueID;
3240
- level = parentRecords.level + 1;
3441
+ currentData.uniqueID = getUid(this.cachedElementId);
3442
+ this.uniqueIDCollection[currentData.uniqueID] = currentData;
3443
+ if (parentItem) {
3444
+ currentData.parentItem = parentItem;
3445
+ currentData.parentUniqueID = parentUniqueID;
3446
+ currentData.level = levelBase;
3241
3447
  }
3242
- if (!Object.prototype.hasOwnProperty.call(currentData, 'level')) {
3243
- currentData.level = level;
3448
+ else {
3449
+ currentData.level = 0;
3244
3450
  }
3245
3451
  currentData.checkboxState = 'uncheck';
3246
- var remoteCollapsedData = 'remoteCollapsedData';
3247
- if (this.parent.enableVirtualization && !this.parent.loadChildOnDemand && isRemoteData(this.parent)
3248
- && !this.parent.initialRender) {
3249
- if (!currentData.hasChildRecords && isNullOrUndefined(currentData["" + this.parent.parentIdMapping])) {
3452
+ if (this.isVirtualRemote) {
3453
+ if (!currentData.hasChildRecords && !currentData["" + this.parentIdMapping]) {
3250
3454
  currentData.hasChildRecords = true;
3251
- for (var c = 0; c < this.parent["" + remoteCollapsedData].length; c++) {
3252
- if (this.parent["" + remoteCollapsedData][parseInt(c.toString(), 10)]["" + this.parent.idMapping] === currentData["" + this.parent.idMapping]) {
3455
+ var remoteCollapsedLen = this.remoteCollapsedList.length;
3456
+ var currentId = currentData["" + this.idMapping];
3457
+ for (var c = 0; c < remoteCollapsedLen; c++) {
3458
+ if (this.remoteCollapsedList[parseInt(c.toString(), 10)]["" + this.idMapping] === currentId) {
3253
3459
  currentData.expanded = false;
3460
+ break;
3254
3461
  }
3255
3462
  }
3256
3463
  }
3257
- else if (currentData.level === 0 && isNullOrUndefined(parentRecords) && !currentData.hasChildRecords) {
3258
- currentData.level = currentData.level + 1;
3464
+ else if (currentData.level === 0 && !parentRecords && !currentData.hasChildRecords) {
3465
+ currentData.level++;
3259
3466
  }
3260
- if (currentData["" + this.parent.hasChildMapping] && !isNullOrUndefined(currentData["" + this.parent.expandStateMapping])) {
3261
- currentData.expanded = currentData["" + this.parent.expandStateMapping];
3467
+ if (currentData["" + this.parent.hasChildMapping] && currentData["" + this.expandStateMapping] !== undefined) {
3468
+ currentData.expanded = currentData["" + this.expandStateMapping];
3262
3469
  currentData.hasChildRecords = true;
3263
3470
  }
3264
- this.parent.flatData.push(currentData);
3471
+ flatData.push(currentData);
3265
3472
  }
3266
- else if (isNullOrUndefined(currentData["" + this.parent.parentIdMapping]) || currentData.parentItem) {
3267
- if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
3473
+ else if (!currentData["" + this.parentIdMapping] || parentItem) {
3474
+ if (!isNullOrUndefined(this.rowDragAndDropTargetID)) {
3268
3475
  if (!this.parent.rowDragAndDropModule['isDuplicateData'](currentData)) {
3269
- this.parent.flatData.push(currentData);
3476
+ flatData.push(currentData);
3270
3477
  }
3271
3478
  }
3272
3479
  else {
3273
- this.parent.flatData.push(currentData);
3480
+ flatData.push(currentData);
3274
3481
  }
3275
- this.parent['infiniteScrollData'].push(currentData);
3482
+ this.infiniteScrollData.push(currentData);
3276
3483
  }
3277
3484
  if (!this.isSelfReference && currentData.level === 0) {
3278
- this.parent.parentData.push(currentData);
3485
+ parentData.push(currentData);
3279
3486
  }
3280
- if (!isNullOrUndefined(currentData[this.parent.childMapping] && currentData[this.parent.childMapping].length)) {
3281
- var record = this.createRecords(currentData[this.parent.childMapping], currentData);
3282
- currentData.childRecords = record;
3487
+ if (hasChildren) {
3488
+ currentData.childRecords = this.createConvertRecords(childMapping, currentData);
3283
3489
  }
3284
3490
  treeGridData.push(currentData);
3285
3491
  }
3286
3492
  return treeGridData;
3287
3493
  };
3494
+ DataManipulation.prototype.createRecords = function (data) {
3495
+ this.childMapping = this.parent.childMapping;
3496
+ this.hasChildMapping = this.parent.hasChildMapping;
3497
+ this.expandStateMapping = this.parent.expandStateMapping;
3498
+ this.parentIdMapping = this.parent.parentIdMapping;
3499
+ this.idMapping = this.parent.idMapping;
3500
+ this.cachedElementId = this.parent.element.id + '_data_';
3501
+ this.loadChildOnDemand = this.parent.loadChildOnDemand;
3502
+ this.initialRender = this.parent.initialRender;
3503
+ this.isCountRequired = isCountRequired(this.parent);
3504
+ this.rowDragAndDropTargetID = this.parent.rowDropSettings.targetID;
3505
+ this.isVirtualRemote = this.parent.enableVirtualization && !this.loadChildOnDemand &&
3506
+ isRemoteData(this.parent) && !this.initialRender;
3507
+ this.isRemoteData = isRemoteData(this.parent);
3508
+ var remoteCollapsedData = 'remoteCollapsedData';
3509
+ this.remoteCollapsedList = this.isVirtualRemote ? this.parent["" + remoteCollapsedData] : [];
3510
+ this.infiniteScrollData = this.parent['infiniteScrollData'];
3511
+ this.uniqueIDCollection = this.parent.uniqueIDCollection;
3512
+ return this.createConvertRecords(data);
3513
+ };
3288
3514
  /**
3289
3515
  * Function to perform filtering/sorting action for local data
3290
3516
  *
@@ -3325,8 +3551,9 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3325
3551
  dataObj = expresults;
3326
3552
  }
3327
3553
  else {
3328
- dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource)
3329
- : this.parent.grid.dataSource;
3554
+ dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource) :
3555
+ this.parent.enableDomVirtualization && (action === 'collapse' || action === 'expand') ? args.result
3556
+ : this.parent.grid.dataSource;
3330
3557
  }
3331
3558
  var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
3332
3559
  var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
@@ -3385,6 +3612,9 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3385
3612
  }
3386
3613
  count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
3387
3614
  : results.length;
3615
+ if (this.parent.enableDomVirtualization) {
3616
+ this.parent.virtualDomScrollData = results;
3617
+ }
3388
3618
  var temp = this.paging(results, count, isExport, isPrinting, exportType, args);
3389
3619
  results = temp.result;
3390
3620
  count = temp.count;
@@ -3400,9 +3630,9 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3400
3630
  count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
3401
3631
  : this.dataResults.count;
3402
3632
  }
3403
- else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) && (!isExport || exportType === 'CurrentPage')
3404
- && getValue('requestType', args) !== 'save') {
3405
- var actArgs = this.parent.enableInfiniteScrolling ? args : getValue('actionArgs', args);
3633
+ else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling || this.parent.enableDomVirtualization) &&
3634
+ (!isExport || exportType === 'CurrentPage') && getValue('requestType', args) !== 'save') {
3635
+ var actArgs = this.parent.enableInfiniteScrolling || this.parent.enableDomVirtualization ? args : getValue('actionArgs', args);
3406
3636
  this.parent.notify(pagingActions, { result: results, count: count, actionArgs: actArgs });
3407
3637
  results = this.dataResults.result;
3408
3638
  count = this.dataResults.count;
@@ -3868,9 +4098,9 @@ function editAction(details, control, isSelfReference, addRowIndex, selectedInde
3868
4098
  else {
3869
4099
  if (action === 'edit') {
3870
4100
  for (j = 0; j < keys.length; j++) {
3871
- if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) && ((control.editSettings.mode !== 'Cell'
3872
- || (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
3873
- || keys[parseInt(j.toString(), 10)] === columnName)) {
4101
+ if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) &&
4102
+ ((!isNullOrUndefined(control.editSettings.mode) || (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
4103
+ || keys[parseInt(j.toString(), 10)] === columnName)) {
3874
4104
  var editedData = getParentData(control, modifiedData[parseInt(k.toString(), 10)].uniqueID);
3875
4105
  treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =
3876
4106
  modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];
@@ -4023,16 +4253,11 @@ function removeChildRecords(childRecords, modifiedData, action, key, control, is
4023
4253
  var editedData = getParentData(control, modifiedData.uniqueID);
4024
4254
  for (var i = 0; i < keys.length; i++) {
4025
4255
  if (Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&
4026
- (control.editSettings.mode !== 'Cell' || keys[parseInt(i.toString(), 10)] === columnName)) {
4256
+ (!isNullOrUndefined(control.editSettings.mode) || keys[parseInt(i.toString(), 10)] === columnName)) {
4027
4257
  editedData[keys[parseInt(i.toString(), 10)]] =
4028
4258
  editedData.taskData[keys[parseInt(i.toString(), 10)]] =
4029
4259
  childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
4030
4260
  modifiedData[keys[parseInt(i.toString(), 10)]];
4031
- if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
4032
- var editModule = 'editModule';
4033
- control.grid.editModule["" + editModule].editRowIndex = modifiedData.index;
4034
- control.grid.editModule["" + editModule].updateCurrentViewData(modifiedData);
4035
- }
4036
4261
  }
4037
4262
  }
4038
4263
  break;
@@ -4308,6 +4533,62 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
4308
4533
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4309
4534
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4310
4535
  };
4536
+ /**
4537
+ * Configures the DOM virtualization settings for TreeGrid.
4538
+ */
4539
+ var DomVirtualizationSettings = /** @__PURE__ @class */ (function (_super) {
4540
+ __extends$e(DomVirtualizationSettings, _super);
4541
+ function DomVirtualizationSettings() {
4542
+ return _super !== null && _super.apply(this, arguments) || this;
4543
+ }
4544
+ __decorate$c([
4545
+ Property('Row')
4546
+ ], DomVirtualizationSettings.prototype, "virtualDomType", void 0);
4547
+ __decorate$c([
4548
+ Property(5)
4549
+ ], DomVirtualizationSettings.prototype, "rowBuffer", void 0);
4550
+ __decorate$c([
4551
+ Property(0)
4552
+ ], DomVirtualizationSettings.prototype, "scrollThrottle", void 0);
4553
+ __decorate$c([
4554
+ Property(500)
4555
+ ], DomVirtualizationSettings.prototype, "maxPoolSize", void 0);
4556
+ __decorate$c([
4557
+ Property(false)
4558
+ ], DomVirtualizationSettings.prototype, "autoRowHeight", void 0);
4559
+ return DomVirtualizationSettings;
4560
+ }(ChildProperty));
4561
+
4562
+ var __extends$f = (undefined && undefined.__extends) || (function () {
4563
+ var extendStatics = function (d, b) {
4564
+ extendStatics = Object.setPrototypeOf ||
4565
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4566
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4567
+ return extendStatics(d, b);
4568
+ };
4569
+ return function (d, b) {
4570
+ extendStatics(d, b);
4571
+ function __() { this.constructor = d; }
4572
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4573
+ };
4574
+ })();
4575
+ var __assign$1 = (undefined && undefined.__assign) || function () {
4576
+ __assign$1 = Object.assign || function(t) {
4577
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4578
+ s = arguments[i];
4579
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
4580
+ t[p] = s[p];
4581
+ }
4582
+ return t;
4583
+ };
4584
+ return __assign$1.apply(this, arguments);
4585
+ };
4586
+ var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4587
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4588
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4589
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4590
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4591
+ };
4311
4592
  /**
4312
4593
  * Represents the TreeGrid component.
4313
4594
  * ```html
@@ -4319,13 +4600,15 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
4319
4600
  * ```
4320
4601
  */
4321
4602
  var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4322
- __extends$e(TreeGrid, _super);
4603
+ __extends$f(TreeGrid, _super);
4323
4604
  function TreeGrid(options, element) {
4324
4605
  var _this = _super.call(this, options, element) || this;
4325
4606
  _this.dataResults = {};
4326
4607
  /** @hidden */
4327
4608
  _this.uniqueIDCollection = {};
4328
4609
  /** @hidden */
4610
+ _this.uniqueIDCollpaseCollection = {};
4611
+ /** @hidden */
4329
4612
  _this.uniqueIDFilterCollection = {};
4330
4613
  _this.changedRecords = 'changedRecords';
4331
4614
  _this.deletedRecords = 'deletedRecords';
@@ -4570,6 +4853,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4570
4853
  }
4571
4854
  this.TreeGridLocale();
4572
4855
  this.initProperties();
4856
+ this.autoCheckHierarchy = (this.hierarchyCheckboxMode === 'hierarchy' || this.hierarchyCheckboxMode === 'filteredHierarchy')
4857
+ ? true : false;
4573
4858
  this.defaultLocale = {
4574
4859
  Above: 'Above',
4575
4860
  Below: 'Below',
@@ -4622,7 +4907,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4622
4907
  };
4623
4908
  /**
4624
4909
  * Searches for TreeGrid records using a specified search string.
4625
- * Customize the search behavior through the [searchSettings](./#searchsettings/).
4910
+ * Customize the search behavior through the [searchSettings](./index-default#searchsettings).
4626
4911
  *
4627
4912
  * @param {string} searchString - The string used as the search key.
4628
4913
  * @returns {void}
@@ -4670,7 +4955,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4670
4955
  };
4671
4956
  /**
4672
4957
  * Prints all the pages of the TreeGrid and hides the pager by default.
4673
- * Customize print options using the [printMode](./#printmode).
4958
+ * Customize print options using the [printMode](./index-default#printmode).
4674
4959
  *
4675
4960
  * @returns {void}
4676
4961
  */
@@ -4685,6 +4970,20 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4685
4970
  var row = void 0;
4686
4971
  var summaryElement = void 0;
4687
4972
  switch (e.action) {
4973
+ case 'space': {
4974
+ target = e.target;
4975
+ var checkboxWrapper = target && target.closest('.e-checkbox-wrapper');
4976
+ var headerCheckbox = checkboxWrapper && checkboxWrapper.querySelector('.e-treeselectall');
4977
+ if (headerCheckbox && this.selectionModule) {
4978
+ if (this.selectionModule['headerSelectionState'] === 'check') {
4979
+ this.selectionModule['headerSelection'](false);
4980
+ }
4981
+ else {
4982
+ this.selectionModule['headerSelection'](true);
4983
+ }
4984
+ }
4985
+ break;
4986
+ }
4688
4987
  case 'ctrlDownArrow':
4689
4988
  this.expandAll();
4690
4989
  break;
@@ -4819,7 +5118,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4819
5118
  ctrlShiftUpArrow: 'ctrl+shift+uparrow',
4820
5119
  ctrlShiftDownArrow: 'ctrl+shift+downarrow',
4821
5120
  downArrow: 'downArrow',
4822
- upArrow: 'upArrow'
5121
+ upArrow: 'upArrow',
5122
+ space: 'space'
4823
5123
  };
4824
5124
  this.isLocalData = (!(this.dataSource instanceof DataManager) || this.dataSource.dataSource.offline
4825
5125
  || (!isNullOrUndefined(this.dataSource.ready)) || this.dataSource.adaptor instanceof RemoteSaveAdaptor);
@@ -5004,7 +5304,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5004
5304
  name: 'Selection'
5005
5305
  });
5006
5306
  }
5007
- if (this.enableVirtualization) {
5307
+ if (this.enableVirtualization && !this.enableDomVirtualization) {
5008
5308
  modules.push({
5009
5309
  member: 'virtualScroll',
5010
5310
  args: [this],
@@ -5018,6 +5318,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5018
5318
  name: 'InfiniteScroll'
5019
5319
  });
5020
5320
  }
5321
+ if (this.enableDomVirtualization) {
5322
+ modules.push({
5323
+ member: 'domVirtualization',
5324
+ args: [this],
5325
+ name: 'DomVirtualization'
5326
+ });
5327
+ }
5021
5328
  modules.push({
5022
5329
  member: 'logger',
5023
5330
  args: [this.grid]
@@ -5122,7 +5429,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5122
5429
  var modules = [];
5123
5430
  modules = gridRequiredModules.apply(this);
5124
5431
  for (var i = 0; i < modules.length; i++) {
5125
- if (modules[parseInt(i.toString(), 10)].member === 'virtualscroll') {
5432
+ if (modules[parseInt(i.toString(), 10)].member === 'domVirtualization') {
5433
+ modules[parseInt(i.toString(), 10)].member = 'treeDomVirtualization';
5434
+ }
5435
+ else if (modules[parseInt(i.toString(), 10)].member === 'virtualscroll') {
5126
5436
  modules[parseInt(i.toString(), 10)].member = 'treeVirtualScroll';
5127
5437
  }
5128
5438
  }
@@ -5322,6 +5632,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5322
5632
  this.grid.allowSorting = this.allowSorting;
5323
5633
  this.grid.allowMultiSorting = this.allowMultiSorting;
5324
5634
  this.grid.allowFiltering = this.allowFiltering;
5635
+ this.grid.enableDomVirtualization = this.enableDomVirtualization;
5636
+ this.grid.domVirtualizationSettings = this.domVirtualizationSettings;
5325
5637
  this.grid.enableVirtualization = this.enableVirtualization;
5326
5638
  this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
5327
5639
  this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
@@ -5424,7 +5736,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5424
5736
  _this.trigger(rowDeselecting, args);
5425
5737
  };
5426
5738
  this.grid.rowSelected = function (args) {
5427
- if (_this.enableVirtualization) {
5739
+ if (_this.enableVirtualization && !_this.enableDomVirtualization) {
5428
5740
  _this.virtualScrollModule.updateSelection(args);
5429
5741
  }
5430
5742
  _this.selectedRowIndex = _this.grid.selectedRowIndex;
@@ -5583,8 +5895,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5583
5895
  var dataSource = 'dataSource';
5584
5896
  var requestType = getObject('action', args);
5585
5897
  if (((isRemoteData(treeGrid) && !isOffline(treeGrid)) || isCountRequired(this)) && requestType !== 'edit') {
5586
- treeGrid.notify('updateRemoteLevel', args);
5587
- args = (treeGrid.dataResults);
5898
+ if (this.enableDomVirtualization && requestType === 'collapse' && !this.enableVirtualization) {
5899
+ args.result = args.result.slice();
5900
+ }
5901
+ else {
5902
+ treeGrid.notify('updateRemoteLevel', args);
5903
+ args = (treeGrid.dataResults);
5904
+ }
5588
5905
  }
5589
5906
  else if (treeGrid.flatData.length === 0 && isOffline(treeGrid) && treeGrid.dataSource instanceof DataManager) {
5590
5907
  var dm = treeGrid.dataSource;
@@ -5792,6 +6109,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5792
6109
  TreeGrid.prototype.extendedGridActionEvents = function () {
5793
6110
  var _this = this;
5794
6111
  this.grid.actionBegin = function (args) {
6112
+ var newArgs = __assign$1({}, args);
6113
+ var changeArgs = false;
6114
+ if (newArgs.requestType === 'save' && _this['isGantt'] && !isNullOrUndefined(_this.editSettings)
6115
+ && _this.editSettings.mode === 'Cell') {
6116
+ delete newArgs.requestType;
6117
+ newArgs.type = 'save';
6118
+ changeArgs = true;
6119
+ }
5795
6120
  if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
5796
6121
  args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
5797
6122
  args.cancel = true;
@@ -5828,7 +6153,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5828
6153
  }
5829
6154
  if (_this.action !== 'indenting' && _this.action !== 'outdenting') {
5830
6155
  var callBackPromise_2 = new Deferred();
5831
- _this.trigger(actionBegin, args, function (actionArgs) {
6156
+ _this.trigger(actionBegin, changeArgs ? newArgs : args, function (actionArgs) {
5832
6157
  if (!actionArgs.cancel) {
5833
6158
  _this.notify(beginEdit, actionArgs);
5834
6159
  }
@@ -5838,6 +6163,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5838
6163
  }
5839
6164
  };
5840
6165
  this.grid.actionComplete = function (args) {
6166
+ var newArgs = __assign$1({}, args);
6167
+ var changeArgs = false;
6168
+ if (newArgs.requestType === 'save' && _this['isGantt'] && !isNullOrUndefined(_this.editSettings)
6169
+ && _this.editSettings.mode === 'Cell') {
6170
+ delete newArgs.requestType;
6171
+ newArgs.type = 'save';
6172
+ changeArgs = true;
6173
+ }
5841
6174
  _this.notify('actioncomplete', args);
5842
6175
  _this.updateColumnModel();
5843
6176
  _this.updateTreeGridModel();
@@ -5886,7 +6219,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5886
6219
  var frozenContent$1 = _this.grid.element.querySelector('.' + frozenContent);
5887
6220
  movableContent$1.style.height = frozenContent$1.style.height = 'auto';
5888
6221
  }
5889
- _this.trigger(actionComplete, args);
6222
+ _this.trigger(actionComplete, changeArgs ? newArgs : args);
5890
6223
  }
5891
6224
  };
5892
6225
  };
@@ -6014,7 +6347,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6014
6347
  edit.mode = 'Normal';
6015
6348
  break;
6016
6349
  case 'Cell':
6017
- edit.mode = 'Normal';
6350
+ edit.mode = this.editSettings.mode;
6018
6351
  edit.showConfirmDialog = false;
6019
6352
  break;
6020
6353
  }
@@ -6225,6 +6558,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6225
6558
  case 'enableVirtualization':
6226
6559
  this.grid.enableVirtualization = this.enableVirtualization;
6227
6560
  break;
6561
+ case 'enableDomVirtualization':
6562
+ this.grid.enableDomVirtualization = this.enableDomVirtualization;
6563
+ break;
6228
6564
  case 'enableColumnVirtualization':
6229
6565
  this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
6230
6566
  break;
@@ -6432,6 +6768,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6432
6768
  this.grid.enableColumnSpan = this.enableColumnSpan;
6433
6769
  this.refreshColumns();
6434
6770
  break;
6771
+ case 'hierarchyCheckboxMode':
6772
+ this.autoCheckHierarchy = (this.hierarchyCheckboxMode === 'filteredHierarchy' ||
6773
+ this.hierarchyCheckboxMode === 'hierarchy');
6774
+ break;
6435
6775
  }
6436
6776
  }
6437
6777
  if (requireRefresh) {
@@ -6495,6 +6835,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6495
6835
  }
6496
6836
  this.dataResults = null;
6497
6837
  this.uniqueIDCollection = {};
6838
+ this.uniqueIDCollpaseCollection = {};
6498
6839
  this.uniqueIDFilterCollection = {};
6499
6840
  this.element.innerHTML = '';
6500
6841
  this.grid = null;
@@ -6570,6 +6911,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6570
6911
  };
6571
6912
  TreeGrid.prototype.mouseClickHandler = function (e) {
6572
6913
  var _this = this;
6914
+ this.resetDoubleClickTarget();
6573
6915
  if (!isNullOrUndefined(e.touches)) {
6574
6916
  return;
6575
6917
  }
@@ -8090,9 +8432,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8090
8432
  if (!rows.length && this.getRows().length) {
8091
8433
  rows.push(this.getRows()[0]);
8092
8434
  }
8093
- this.isExpandAll = true;
8094
- this.isCollapseAll = true;
8095
- if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
8435
+ this.isExpandAll = this.enableDomVirtualization ? action !== 'collapse' : true;
8436
+ this.isCollapseAll = this.enableDomVirtualization ? action === 'collapse' : true;
8437
+ if (this.enableDomVirtualization) {
8438
+ var collapseArgs = { data: this.parentData, row: rows[0] };
8439
+ this.trigger(collapsed, collapseArgs);
8440
+ this.notify(virtualExpandCollapse, { action: action, row: rows[0] });
8441
+ this.notify(localPagedExpandCollapse, { action: action, row: rows[0] });
8442
+ }
8443
+ else if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
8096
8444
  this.flatData.filter(function (e) {
8097
8445
  if (e.hasChildRecords) {
8098
8446
  e.expanded = action === 'collapse' ? false : true;
@@ -8162,64 +8510,65 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8162
8510
  if (!isNullOrUndefined(row)) {
8163
8511
  row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
8164
8512
  }
8165
- if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization) && !isRemoteData(this)
8513
+ if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization || this.enableDomVirtualization) && !isRemoteData(this)
8166
8514
  && !isCountRequired(this)) {
8515
+ this.notify(virtualExpandCollapse, { action: action, row: row, record: record });
8167
8516
  this.notify(localPagedExpandCollapse, { action: action, row: row, record: record });
8168
8517
  }
8169
8518
  else {
8170
- var displayAction = void 0;
8171
- if (action === 'expand') {
8172
- displayAction = 'e-childrow-visible';
8173
- if (!isChild) {
8174
- record.expanded = true;
8175
- this.flatData.forEach(function (e) {
8176
- e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
8177
- });
8178
- this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
8179
- }
8180
- if (!isNullOrUndefined(row)) {
8181
- targetEle = row.getElementsByClassName('e-treegridcollapse')[0];
8182
- }
8183
- if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&
8184
- record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {
8185
- targetEle = row.getElementsByClassName('e-treegridexpand')[0];
8186
- }
8187
- if (isNullOrUndefined(targetEle)) {
8188
- return;
8189
- }
8190
- if (!targetEle.classList.contains('e-treegridexpand')) {
8191
- addClass([targetEle], 'e-treegridexpand');
8519
+ var isExpand = action === 'expand';
8520
+ var displayAction = isExpand ? 'e-childrow-visible' : 'e-childrow-hidden';
8521
+ var expandStateMap = this.expandStateMapping;
8522
+ var recordUniqueID = record.uniqueID;
8523
+ if (!isChild) {
8524
+ record.expanded = isExpand;
8525
+ var flatRecord = this.flatData[record.index];
8526
+ if (!isNullOrUndefined(flatRecord)) {
8527
+ flatRecord.expanded = flatRecord.uniqueID === record.uniqueID &&
8528
+ flatRecord.expanded !== record.expanded ? record.expanded : flatRecord.expanded;
8529
+ }
8530
+ this.uniqueIDCollection["" + recordUniqueID].expanded = isExpand;
8531
+ }
8532
+ else if (isExpand || isCountRequired(this)) {
8533
+ record.expanded = isExpand;
8534
+ var flatRecord = this.flatData[record.index];
8535
+ if (!isNullOrUndefined(flatRecord)) {
8536
+ flatRecord.expanded = flatRecord.uniqueID === record.uniqueID &&
8537
+ flatRecord.expanded !== record.expanded ? record.expanded : flatRecord.expanded;
8538
+ }
8539
+ this.uniqueIDCollection["" + recordUniqueID].expanded = isExpand;
8540
+ }
8541
+ if (!isNullOrUndefined(row)) {
8542
+ var collapseEle = row.getElementsByClassName('e-treegridcollapse')[0];
8543
+ var expandEle = row.getElementsByClassName('e-treegridexpand')[0];
8544
+ targetEle = isExpand ? collapseEle : expandEle;
8545
+ if (isChild && !isNullOrUndefined(record["" + expandStateMap]) &&
8546
+ ((isExpand && record["" + expandStateMap]) || (!isExpand && !record["" + expandStateMap])) &&
8547
+ isNullOrUndefined(targetEle)) {
8548
+ targetEle = isExpand ? expandEle : collapseEle;
8549
+ }
8550
+ }
8551
+ if (isNullOrUndefined(targetEle)) {
8552
+ return;
8553
+ }
8554
+ var targetClsList = targetEle.classList;
8555
+ var expandClass = 'e-treegridexpand';
8556
+ var collapseClass = 'e-treegridcollapse';
8557
+ if (isExpand) {
8558
+ if (!targetClsList.contains(expandClass)) {
8559
+ addClass([targetEle], expandClass);
8560
+ removeClass([targetEle], collapseClass);
8192
8561
  }
8193
- removeClass([targetEle], 'e-treegridcollapse');
8194
8562
  }
8195
8563
  else {
8196
- displayAction = 'e-childrow-hidden';
8197
- if (!isChild || isCountRequired(this)) {
8198
- record.expanded = false;
8199
- this.flatData.forEach(function (e) {
8200
- e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
8201
- });
8202
- this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
8203
- }
8204
- if (!isNullOrUndefined(row)) {
8205
- targetEle = row.getElementsByClassName('e-treegridexpand')[0];
8206
- }
8207
- if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&
8208
- !record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {
8209
- targetEle = row.getElementsByClassName('e-treegridcollapse')[0];
8210
- }
8211
- if (isNullOrUndefined(targetEle)) {
8212
- return;
8213
- }
8214
- if (!targetEle.classList.contains('e-treegridcollapse')) {
8215
- addClass([targetEle], 'e-treegridcollapse');
8564
+ if (!targetClsList.contains(collapseClass)) {
8565
+ addClass([targetEle], collapseClass);
8566
+ removeClass([targetEle], expandClass);
8216
8567
  }
8217
- removeClass([targetEle], 'e-treegridexpand');
8218
8568
  }
8219
- row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
8220
- var detailrows = gridRows.filter(function (r) {
8221
- return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
8222
- });
8569
+ row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', isExpand ? 'true' : 'false');
8570
+ var detailRowClass_1 = 'e-griddetailrowindex' + record.index + 'level' + (record.level + 1);
8571
+ var detailrows = gridRows.filter(function (r) { return r.classList.contains(detailRowClass_1); });
8223
8572
  if (isRemoteData(this) && !isOffline(this)) {
8224
8573
  this.remoteExpand(action, row, record);
8225
8574
  }
@@ -8230,29 +8579,37 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8230
8579
  if (this.enableInfiniteScrolling && action === 'collapse' && !this.isCollapseAll) {
8231
8580
  this.notify(collapseActionComplete, { isCollapse: true, data: record, row: row });
8232
8581
  }
8233
- var lastrowIdx = this.getVisibleRecords()[this.getVisibleRecords().length - 1]['index'];
8234
- var lastRow = this.getRowByIndex(lastrowIdx);
8235
- var borderElement = lastRow ? lastRow.nextElementSibling ? lastRow.nextElementSibling.classList.contains('e-detailrow') ? lastRow.nextElementSibling : lastRow : lastRow : null;
8236
- if (!this.isInfiniteCollapse && this.grid.getContentTable().clientHeight <= this.grid.getContent().clientHeight && !isNullOrUndefined(borderElement) && !borderElement.cells[0].classList.contains('e-lastrowcell')) {
8237
- this.lastRowBorder(borderElement, true);
8582
+ var visibleRecords = this.getVisibleRecords();
8583
+ var lastRecord = visibleRecords[visibleRecords.length - 1];
8584
+ if (!isNullOrUndefined(lastRecord)) {
8585
+ var lastrowIdx = lastRecord.index;
8586
+ var lastRow = this.getRowByIndex(lastrowIdx);
8587
+ var borderElement = (lastRow ? lastRow.nextElementSibling ? lastRow.nextElementSibling.classList.contains('e-detailrow') ? lastRow.nextElementSibling : lastRow : lastRow : null);
8588
+ if (!this.isInfiniteCollapse && this.grid.getContentTable().clientHeight <= this.grid.getContent().clientHeight && !isNullOrUndefined(borderElement) && !(borderElement.cells[0].classList.contains('e-lastrowcell'))) {
8589
+ this.lastRowBorder(borderElement, true);
8590
+ }
8238
8591
  }
8239
8592
  }
8240
- if (isCountRequired(this) && action === 'expand') {
8593
+ if (isCountRequired(this) && isExpand) {
8241
8594
  var currentData = this.getCurrentViewRecords();
8242
- var visibleRecords = currentData.filter(function (e) {
8595
+ var filteredRecords = currentData.filter(function (e) {
8243
8596
  return getExpandStatus(_this, e, _this.parentData);
8244
8597
  });
8245
- this.dataResults.result = visibleRecords;
8598
+ this.dataResults.result = filteredRecords;
8246
8599
  }
8247
- if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
8248
- targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
8249
- targetEle.closest('.e-treerowcell').removeAttribute('aria-selected');
8600
+ if (!isNullOrUndefined(targetEle)) {
8601
+ var treeRowCell = targetEle.closest('.e-treerowcell');
8602
+ if (!isNullOrUndefined(treeRowCell) && treeRowCell.classList.contains('e-cellselectionbackground')) {
8603
+ treeRowCell.classList.remove('e-cellselectionbackground');
8604
+ treeRowCell.removeAttribute('aria-selected');
8605
+ }
8250
8606
  }
8251
8607
  if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell') && !this.isInfiniteCollapse) {
8252
8608
  var totalRows = this.getRows();
8253
8609
  var rows = this.getContentTable().rows;
8254
8610
  totalRows = [].slice.call(rows);
8255
- for (var i = totalRows.length - 1; i >= 0; i--) {
8611
+ var len = totalRows.length;
8612
+ for (var i = len - 1; i >= 0; i--) {
8256
8613
  if (!isHidden(totalRows[parseInt(i.toString(), 10)])) {
8257
8614
  var table = this.getContentTable();
8258
8615
  var sHeight = table.scrollHeight;
@@ -8393,7 +8750,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8393
8750
  this.dataModule["" + fetchRemoteChildData]({ action: action, record: args.data, rows: null, parentRow: args.row });
8394
8751
  }
8395
8752
  else {
8396
- this.collapseRemoteChild({ record: record, rows: rows });
8753
+ if (this.enableDomVirtualization) {
8754
+ this.notify(virtualExpandCollapse, { action: action, row: row, record: record });
8755
+ this.notify(localPagedExpandCollapse, { action: action, row: row, record: record });
8756
+ }
8757
+ else {
8758
+ this.collapseRemoteChild({ record: record, rows: rows });
8759
+ }
8397
8760
  this.trigger(collapsed, args);
8398
8761
  }
8399
8762
  };
@@ -8669,6 +9032,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8669
9032
  Array.prototype.push.apply(args.elements, cells);
8670
9033
  }
8671
9034
  };
9035
+ TreeGrid.prototype.resetDoubleClickTarget = function () {
9036
+ if (this.editModule) {
9037
+ this.notify('resetDoubleClickTarget', {});
9038
+ }
9039
+ };
8672
9040
  TreeGrid.prototype.partialFilterUpdate = function (args) {
8673
9041
  var gridFiltered = args.gridFiltered;
8674
9042
  if ((this.allowFiltering && this.filterModule && this.grid.filterSettings.columns.length) ||
@@ -9152,424 +9520,433 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
9152
9520
  return this.grid.getRowIndexByPrimaryKey(value);
9153
9521
  };
9154
9522
  var TreeGrid_1;
9155
- __decorate$c([
9523
+ __decorate$d([
9156
9524
  Property(0)
9157
9525
  ], TreeGrid.prototype, "frozenRows", void 0);
9158
- __decorate$c([
9526
+ __decorate$d([
9159
9527
  Property(0)
9160
9528
  ], TreeGrid.prototype, "frozenColumns", void 0);
9161
- __decorate$c([
9529
+ __decorate$d([
9162
9530
  Property('Ellipsis')
9163
9531
  ], TreeGrid.prototype, "clipMode", void 0);
9164
- __decorate$c([
9532
+ __decorate$d([
9165
9533
  Property([])
9166
9534
  ], TreeGrid.prototype, "columns", void 0);
9167
- __decorate$c([
9535
+ __decorate$d([
9168
9536
  Property(null)
9169
9537
  ], TreeGrid.prototype, "childMapping", void 0);
9170
- __decorate$c([
9538
+ __decorate$d([
9171
9539
  Property(null)
9172
9540
  ], TreeGrid.prototype, "hasChildMapping", void 0);
9173
- __decorate$c([
9541
+ __decorate$d([
9174
9542
  Property(0)
9175
9543
  ], TreeGrid.prototype, "treeColumnIndex", void 0);
9176
- __decorate$c([
9544
+ __decorate$d([
9177
9545
  Property(null)
9178
9546
  ], TreeGrid.prototype, "idMapping", void 0);
9179
- __decorate$c([
9547
+ __decorate$d([
9180
9548
  Property(null)
9181
9549
  ], TreeGrid.prototype, "parentIdMapping", void 0);
9182
- __decorate$c([
9550
+ __decorate$d([
9183
9551
  Property(false)
9184
9552
  ], TreeGrid.prototype, "enableCollapseAll", void 0);
9185
- __decorate$c([
9553
+ __decorate$d([
9186
9554
  Property(null)
9187
9555
  ], TreeGrid.prototype, "expandStateMapping", void 0);
9188
- __decorate$c([
9556
+ __decorate$d([
9189
9557
  Property(false)
9190
9558
  ], TreeGrid.prototype, "allowRowDragAndDrop", void 0);
9191
- __decorate$c([
9559
+ __decorate$d([
9192
9560
  Property([])
9193
9561
  ], TreeGrid.prototype, "dataSource", void 0);
9194
- __decorate$c([
9562
+ __decorate$d([
9195
9563
  Property()
9196
9564
  ], TreeGrid.prototype, "query", void 0);
9197
- __decorate$c([
9565
+ __decorate$d([
9198
9566
  Property()
9199
9567
  ], TreeGrid.prototype, "cloneQuery", void 0);
9200
- __decorate$c([
9568
+ __decorate$d([
9201
9569
  Property('AllPages')
9202
9570
  ], TreeGrid.prototype, "printMode", void 0);
9203
- __decorate$c([
9571
+ __decorate$d([
9204
9572
  Property(false)
9205
9573
  ], TreeGrid.prototype, "allowPaging", void 0);
9206
- __decorate$c([
9574
+ __decorate$d([
9207
9575
  Property(true)
9208
9576
  ], TreeGrid.prototype, "loadChildOnDemand", void 0);
9209
- __decorate$c([
9577
+ __decorate$d([
9210
9578
  Property(false)
9211
9579
  ], TreeGrid.prototype, "allowTextWrap", void 0);
9212
- __decorate$c([
9580
+ __decorate$d([
9213
9581
  Complex({}, TextWrapSettings)
9214
9582
  ], TreeGrid.prototype, "textWrapSettings", void 0);
9215
- __decorate$c([
9583
+ __decorate$d([
9216
9584
  Property(false)
9217
9585
  ], TreeGrid.prototype, "allowReordering", void 0);
9218
- __decorate$c([
9586
+ __decorate$d([
9219
9587
  Property(false)
9220
9588
  ], TreeGrid.prototype, "allowResizing", void 0);
9221
- __decorate$c([
9589
+ __decorate$d([
9222
9590
  Property(false)
9223
9591
  ], TreeGrid.prototype, "autoCheckHierarchy", void 0);
9224
- __decorate$c([
9592
+ __decorate$d([
9593
+ Property('self')
9594
+ ], TreeGrid.prototype, "hierarchyCheckboxMode", void 0);
9595
+ __decorate$d([
9225
9596
  Complex({}, PageSettings)
9226
9597
  ], TreeGrid.prototype, "pageSettings", void 0);
9227
- __decorate$c([
9598
+ __decorate$d([
9228
9599
  Complex({}, RowDropSettings$1)
9229
9600
  ], TreeGrid.prototype, "rowDropSettings", void 0);
9230
- __decorate$c([
9601
+ __decorate$d([
9231
9602
  Property('USD')
9232
9603
  ], TreeGrid.prototype, "currencyCode", void 0);
9233
- __decorate$c([
9604
+ __decorate$d([
9234
9605
  Property()
9235
9606
  ], TreeGrid.prototype, "pagerTemplate", void 0);
9236
- __decorate$c([
9607
+ __decorate$d([
9237
9608
  Property(false)
9238
9609
  ], TreeGrid.prototype, "showColumnMenu", void 0);
9239
- __decorate$c([
9610
+ __decorate$d([
9240
9611
  Property(false)
9241
9612
  ], TreeGrid.prototype, "showColumnChooser", void 0);
9242
- __decorate$c([
9613
+ __decorate$d([
9243
9614
  Complex({}, ColumnChooserSettings)
9244
9615
  ], TreeGrid.prototype, "columnChooserSettings", void 0);
9245
- __decorate$c([
9616
+ __decorate$d([
9246
9617
  Property(false)
9247
9618
  ], TreeGrid.prototype, "allowSorting", void 0);
9248
- __decorate$c([
9619
+ __decorate$d([
9249
9620
  Property(true)
9250
9621
  ], TreeGrid.prototype, "allowMultiSorting", void 0);
9251
- __decorate$c([
9622
+ __decorate$d([
9252
9623
  Complex({}, SortSettings)
9253
9624
  ], TreeGrid.prototype, "sortSettings", void 0);
9254
- __decorate$c([
9625
+ __decorate$d([
9255
9626
  Collection([], AggregateRow)
9256
9627
  ], TreeGrid.prototype, "aggregates", void 0);
9257
- __decorate$c([
9628
+ __decorate$d([
9258
9629
  Complex({}, EditSettings)
9259
9630
  ], TreeGrid.prototype, "editSettings", void 0);
9260
- __decorate$c([
9631
+ __decorate$d([
9261
9632
  Property(false)
9262
9633
  ], TreeGrid.prototype, "allowFiltering", void 0);
9263
- __decorate$c([
9634
+ __decorate$d([
9264
9635
  Property()
9265
9636
  ], TreeGrid.prototype, "detailTemplate", void 0);
9266
- __decorate$c([
9637
+ __decorate$d([
9267
9638
  Complex({}, FilterSettings)
9268
9639
  ], TreeGrid.prototype, "filterSettings", void 0);
9269
- __decorate$c([
9640
+ __decorate$d([
9270
9641
  Complex({}, SearchSettings)
9271
9642
  ], TreeGrid.prototype, "searchSettings", void 0);
9272
- __decorate$c([
9643
+ __decorate$d([
9273
9644
  Property()
9274
9645
  ], TreeGrid.prototype, "toolbar", void 0);
9275
- __decorate$c([
9646
+ __decorate$d([
9276
9647
  Property()
9277
9648
  ], TreeGrid.prototype, "toolbarTemplate", void 0);
9278
- __decorate$c([
9649
+ __decorate$d([
9279
9650
  Property('Default')
9280
9651
  ], TreeGrid.prototype, "gridLines", void 0);
9281
- __decorate$c([
9652
+ __decorate$d([
9282
9653
  Property()
9283
9654
  ], TreeGrid.prototype, "contextMenuItems", void 0);
9284
- __decorate$c([
9655
+ __decorate$d([
9285
9656
  Property()
9286
9657
  ], TreeGrid.prototype, "columnMenuItems", void 0);
9287
- __decorate$c([
9658
+ __decorate$d([
9288
9659
  Property()
9289
9660
  ], TreeGrid.prototype, "rowTemplate", void 0);
9290
- __decorate$c([
9661
+ __decorate$d([
9291
9662
  Property('Parent')
9292
9663
  ], TreeGrid.prototype, "copyHierarchyMode", void 0);
9293
- __decorate$c([
9664
+ __decorate$d([
9294
9665
  Property(null)
9295
9666
  ], TreeGrid.prototype, "rowHeight", void 0);
9296
- __decorate$c([
9667
+ __decorate$d([
9297
9668
  Property(true)
9298
9669
  ], TreeGrid.prototype, "enableAltRow", void 0);
9299
- __decorate$c([
9670
+ __decorate$d([
9300
9671
  Property(true)
9301
9672
  ], TreeGrid.prototype, "allowKeyboard", void 0);
9302
- __decorate$c([
9673
+ __decorate$d([
9303
9674
  Property(false)
9304
9675
  ], TreeGrid.prototype, "enableHover", void 0);
9305
- __decorate$c([
9676
+ __decorate$d([
9306
9677
  Property(false)
9307
9678
  ], TreeGrid.prototype, "enableAutoFill", void 0);
9308
- __decorate$c([
9679
+ __decorate$d([
9309
9680
  Property(false)
9310
9681
  ], TreeGrid.prototype, "enableAdaptiveUI", void 0);
9311
- __decorate$c([
9682
+ __decorate$d([
9312
9683
  Property(false)
9313
9684
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
9314
- __decorate$c([
9685
+ __decorate$d([
9315
9686
  Property(false)
9316
9687
  ], TreeGrid.prototype, "enableStickyHeader", void 0);
9317
- __decorate$c([
9688
+ __decorate$d([
9318
9689
  Property()
9319
9690
  ], TreeGrid.prototype, "emptyRecordTemplate", void 0);
9320
- __decorate$c([
9691
+ __decorate$d([
9321
9692
  Property('auto')
9322
9693
  ], TreeGrid.prototype, "height", void 0);
9323
- __decorate$c([
9694
+ __decorate$d([
9324
9695
  Property('auto')
9325
9696
  ], TreeGrid.prototype, "width", void 0);
9326
- __decorate$c([
9697
+ __decorate$d([
9327
9698
  Complex({}, LoadingIndicator)
9328
9699
  ], TreeGrid.prototype, "loadingIndicator", void 0);
9329
- __decorate$c([
9700
+ __decorate$d([
9330
9701
  Property(true)
9331
9702
  ], TreeGrid.prototype, "enableVirtualMaskRow", void 0);
9332
- __decorate$c([
9703
+ __decorate$d([
9333
9704
  Property(false)
9334
9705
  ], TreeGrid.prototype, "enableVirtualization", void 0);
9335
- __decorate$c([
9706
+ __decorate$d([
9336
9707
  Property(false)
9337
9708
  ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
9338
- __decorate$c([
9709
+ __decorate$d([
9339
9710
  Property(false)
9340
9711
  ], TreeGrid.prototype, "enableHtmlSanitizer", void 0);
9341
- __decorate$c([
9712
+ __decorate$d([
9342
9713
  Property(false)
9343
9714
  ], TreeGrid.prototype, "enableInfiniteScrolling", void 0);
9344
- __decorate$c([
9715
+ __decorate$d([
9345
9716
  Complex({}, InfiniteScrollSettings)
9346
9717
  ], TreeGrid.prototype, "infiniteScrollSettings", void 0);
9347
- __decorate$c([
9718
+ __decorate$d([
9719
+ Property(false)
9720
+ ], TreeGrid.prototype, "enableDomVirtualization", void 0);
9721
+ __decorate$d([
9722
+ Complex({}, DomVirtualizationSettings)
9723
+ ], TreeGrid.prototype, "domVirtualizationSettings", void 0);
9724
+ __decorate$d([
9348
9725
  Property('All')
9349
9726
  ], TreeGrid.prototype, "columnQueryMode", void 0);
9350
- __decorate$c([
9727
+ __decorate$d([
9351
9728
  Property(true)
9352
9729
  ], TreeGrid.prototype, "allowSelection", void 0);
9353
- __decorate$c([
9730
+ __decorate$d([
9354
9731
  Property(-1)
9355
9732
  ], TreeGrid.prototype, "selectedRowIndex", void 0);
9356
- __decorate$c([
9733
+ __decorate$d([
9357
9734
  Property(null)
9358
9735
  ], TreeGrid.prototype, "isRowSelectable", void 0);
9359
- __decorate$c([
9736
+ __decorate$d([
9360
9737
  Complex({}, SelectionSettings)
9361
9738
  ], TreeGrid.prototype, "selectionSettings", void 0);
9362
- __decorate$c([
9739
+ __decorate$d([
9363
9740
  Property(false)
9364
9741
  ], TreeGrid.prototype, "allowExcelExport", void 0);
9365
- __decorate$c([
9742
+ __decorate$d([
9366
9743
  Property(false)
9367
9744
  ], TreeGrid.prototype, "allowPdfExport", void 0);
9368
- __decorate$c([
9745
+ __decorate$d([
9369
9746
  Property(false)
9370
9747
  ], TreeGrid.prototype, "enableColumnSpan", void 0);
9371
- __decorate$c([
9748
+ __decorate$d([
9372
9749
  Property(false)
9373
9750
  ], TreeGrid.prototype, "enableRowSpan", void 0);
9374
- __decorate$c([
9751
+ __decorate$d([
9375
9752
  Event()
9376
9753
  ], TreeGrid.prototype, "created", void 0);
9377
- __decorate$c([
9754
+ __decorate$d([
9378
9755
  Event()
9379
9756
  ], TreeGrid.prototype, "load", void 0);
9380
- __decorate$c([
9757
+ __decorate$d([
9381
9758
  Event()
9382
9759
  ], TreeGrid.prototype, "expanding", void 0);
9383
- __decorate$c([
9760
+ __decorate$d([
9384
9761
  Event()
9385
9762
  ], TreeGrid.prototype, "expanded", void 0);
9386
- __decorate$c([
9763
+ __decorate$d([
9387
9764
  Event()
9388
9765
  ], TreeGrid.prototype, "collapsing", void 0);
9389
- __decorate$c([
9766
+ __decorate$d([
9390
9767
  Event()
9391
9768
  ], TreeGrid.prototype, "collapsed", void 0);
9392
- __decorate$c([
9769
+ __decorate$d([
9393
9770
  Event()
9394
9771
  ], TreeGrid.prototype, "cellSave", void 0);
9395
- __decorate$c([
9772
+ __decorate$d([
9396
9773
  Event()
9397
9774
  ], TreeGrid.prototype, "cellSaved", void 0);
9398
- __decorate$c([
9775
+ __decorate$d([
9399
9776
  Event()
9400
9777
  ], TreeGrid.prototype, "actionBegin", void 0);
9401
- __decorate$c([
9778
+ __decorate$d([
9402
9779
  Event()
9403
9780
  ], TreeGrid.prototype, "actionComplete", void 0);
9404
- __decorate$c([
9781
+ __decorate$d([
9405
9782
  Event()
9406
9783
  ], TreeGrid.prototype, "beginEdit", void 0);
9407
- __decorate$c([
9784
+ __decorate$d([
9408
9785
  Event()
9409
9786
  ], TreeGrid.prototype, "batchAdd", void 0);
9410
- __decorate$c([
9787
+ __decorate$d([
9411
9788
  Event()
9412
9789
  ], TreeGrid.prototype, "batchDelete", void 0);
9413
- __decorate$c([
9790
+ __decorate$d([
9414
9791
  Event()
9415
9792
  ], TreeGrid.prototype, "batchCancel", void 0);
9416
- __decorate$c([
9793
+ __decorate$d([
9417
9794
  Event()
9418
9795
  ], TreeGrid.prototype, "beforeBatchAdd", void 0);
9419
- __decorate$c([
9796
+ __decorate$d([
9420
9797
  Event()
9421
9798
  ], TreeGrid.prototype, "beforeBatchDelete", void 0);
9422
- __decorate$c([
9799
+ __decorate$d([
9423
9800
  Event()
9424
9801
  ], TreeGrid.prototype, "beforeBatchSave", void 0);
9425
- __decorate$c([
9802
+ __decorate$d([
9426
9803
  Event()
9427
9804
  ], TreeGrid.prototype, "cellEdit", void 0);
9428
- __decorate$c([
9805
+ __decorate$d([
9429
9806
  Event()
9430
9807
  ], TreeGrid.prototype, "actionFailure", void 0);
9431
- __decorate$c([
9808
+ __decorate$d([
9432
9809
  Event()
9433
9810
  ], TreeGrid.prototype, "dataBound", void 0);
9434
- __decorate$c([
9811
+ __decorate$d([
9435
9812
  Event()
9436
9813
  ], TreeGrid.prototype, "dataSourceChanged", void 0);
9437
- __decorate$c([
9814
+ __decorate$d([
9438
9815
  Event()
9439
9816
  ], TreeGrid.prototype, "dataStateChange", void 0);
9440
- __decorate$c([
9817
+ __decorate$d([
9441
9818
  Event()
9442
9819
  ], TreeGrid.prototype, "recordDoubleClick", void 0);
9443
- __decorate$c([
9820
+ __decorate$d([
9444
9821
  Event()
9445
9822
  ], TreeGrid.prototype, "rowDataBound", void 0);
9446
- __decorate$c([
9823
+ __decorate$d([
9447
9824
  Event()
9448
9825
  ], TreeGrid.prototype, "detailDataBound", void 0);
9449
- __decorate$c([
9826
+ __decorate$d([
9450
9827
  Event()
9451
9828
  ], TreeGrid.prototype, "queryCellInfo", void 0);
9452
- __decorate$c([
9829
+ __decorate$d([
9453
9830
  Event()
9454
9831
  ], TreeGrid.prototype, "rowSelecting", void 0);
9455
- __decorate$c([
9832
+ __decorate$d([
9456
9833
  Event()
9457
9834
  ], TreeGrid.prototype, "rowSelected", void 0);
9458
- __decorate$c([
9835
+ __decorate$d([
9459
9836
  Event()
9460
9837
  ], TreeGrid.prototype, "rowDeselecting", void 0);
9461
- __decorate$c([
9838
+ __decorate$d([
9462
9839
  Event()
9463
9840
  ], TreeGrid.prototype, "rowDeselected", void 0);
9464
- __decorate$c([
9841
+ __decorate$d([
9465
9842
  Event()
9466
9843
  ], TreeGrid.prototype, "headerCellInfo", void 0);
9467
- __decorate$c([
9844
+ __decorate$d([
9468
9845
  Event()
9469
9846
  ], TreeGrid.prototype, "cellSelecting", void 0);
9470
- __decorate$c([
9847
+ __decorate$d([
9471
9848
  Event()
9472
9849
  ], TreeGrid.prototype, "columnMenuOpen", void 0);
9473
- __decorate$c([
9850
+ __decorate$d([
9474
9851
  Event()
9475
9852
  ], TreeGrid.prototype, "columnMenuClick", void 0);
9476
- __decorate$c([
9853
+ __decorate$d([
9477
9854
  Event()
9478
9855
  ], TreeGrid.prototype, "cellSelected", void 0);
9479
- __decorate$c([
9856
+ __decorate$d([
9480
9857
  Event()
9481
9858
  ], TreeGrid.prototype, "cellDeselecting", void 0);
9482
- __decorate$c([
9859
+ __decorate$d([
9483
9860
  Event()
9484
9861
  ], TreeGrid.prototype, "cellDeselected", void 0);
9485
- __decorate$c([
9862
+ __decorate$d([
9486
9863
  Event()
9487
9864
  ], TreeGrid.prototype, "resizeStart", void 0);
9488
- __decorate$c([
9865
+ __decorate$d([
9489
9866
  Event()
9490
9867
  ], TreeGrid.prototype, "resizing", void 0);
9491
- __decorate$c([
9868
+ __decorate$d([
9492
9869
  Event()
9493
9870
  ], TreeGrid.prototype, "resizeStop", void 0);
9494
- __decorate$c([
9871
+ __decorate$d([
9495
9872
  Event()
9496
9873
  ], TreeGrid.prototype, "columnDragStart", void 0);
9497
- __decorate$c([
9874
+ __decorate$d([
9498
9875
  Event()
9499
9876
  ], TreeGrid.prototype, "columnDrag", void 0);
9500
- __decorate$c([
9877
+ __decorate$d([
9501
9878
  Event()
9502
9879
  ], TreeGrid.prototype, "columnDrop", void 0);
9503
- __decorate$c([
9880
+ __decorate$d([
9504
9881
  Event()
9505
9882
  ], TreeGrid.prototype, "checkboxChange", void 0);
9506
- __decorate$c([
9883
+ __decorate$d([
9507
9884
  Event()
9508
9885
  ], TreeGrid.prototype, "printComplete", void 0);
9509
- __decorate$c([
9886
+ __decorate$d([
9510
9887
  Event()
9511
9888
  ], TreeGrid.prototype, "beforePrint", void 0);
9512
- __decorate$c([
9889
+ __decorate$d([
9513
9890
  Event()
9514
9891
  ], TreeGrid.prototype, "toolbarClick", void 0);
9515
- __decorate$c([
9892
+ __decorate$d([
9516
9893
  Event()
9517
9894
  ], TreeGrid.prototype, "beforeDataBound", void 0);
9518
- __decorate$c([
9895
+ __decorate$d([
9519
9896
  Event()
9520
9897
  ], TreeGrid.prototype, "contextMenuOpen", void 0);
9521
- __decorate$c([
9898
+ __decorate$d([
9522
9899
  Event()
9523
9900
  ], TreeGrid.prototype, "contextMenuClick", void 0);
9524
- __decorate$c([
9901
+ __decorate$d([
9525
9902
  Event()
9526
9903
  ], TreeGrid.prototype, "beforeCopy", void 0);
9527
- __decorate$c([
9904
+ __decorate$d([
9528
9905
  Event()
9529
9906
  ], TreeGrid.prototype, "beforePaste", void 0);
9530
- __decorate$c([
9907
+ __decorate$d([
9531
9908
  Event()
9532
9909
  ], TreeGrid.prototype, "rowDrag", void 0);
9533
- __decorate$c([
9910
+ __decorate$d([
9534
9911
  Event()
9535
9912
  ], TreeGrid.prototype, "rowDragStart", void 0);
9536
- __decorate$c([
9913
+ __decorate$d([
9537
9914
  Event()
9538
9915
  ], TreeGrid.prototype, "rowDragStartHelper", void 0);
9539
- __decorate$c([
9916
+ __decorate$d([
9540
9917
  Event()
9541
9918
  ], TreeGrid.prototype, "rowDrop", void 0);
9542
- __decorate$c([
9919
+ __decorate$d([
9543
9920
  Event()
9544
9921
  ], TreeGrid.prototype, "pdfQueryCellInfo", void 0);
9545
- __decorate$c([
9922
+ __decorate$d([
9546
9923
  Event()
9547
9924
  ], TreeGrid.prototype, "pdfHeaderQueryCellInfo", void 0);
9548
- __decorate$c([
9925
+ __decorate$d([
9549
9926
  Event()
9550
9927
  ], TreeGrid.prototype, "excelQueryCellInfo", void 0);
9551
- __decorate$c([
9928
+ __decorate$d([
9552
9929
  Event()
9553
9930
  ], TreeGrid.prototype, "pdfAggregateQueryCellInfo", void 0);
9554
- __decorate$c([
9931
+ __decorate$d([
9555
9932
  Event()
9556
9933
  ], TreeGrid.prototype, "excelAggregateQueryCellInfo", void 0);
9557
- __decorate$c([
9934
+ __decorate$d([
9558
9935
  Event()
9559
9936
  ], TreeGrid.prototype, "excelHeaderQueryCellInfo", void 0);
9560
- __decorate$c([
9937
+ __decorate$d([
9561
9938
  Event()
9562
9939
  ], TreeGrid.prototype, "beforeExcelExport", void 0);
9563
- __decorate$c([
9940
+ __decorate$d([
9564
9941
  Event()
9565
9942
  ], TreeGrid.prototype, "excelExportComplete", void 0);
9566
- __decorate$c([
9943
+ __decorate$d([
9567
9944
  Event()
9568
9945
  ], TreeGrid.prototype, "beforePdfExport", void 0);
9569
- __decorate$c([
9946
+ __decorate$d([
9570
9947
  Event()
9571
9948
  ], TreeGrid.prototype, "pdfExportComplete", void 0);
9572
- TreeGrid = TreeGrid_1 = __decorate$c([
9949
+ TreeGrid = TreeGrid_1 = __decorate$d([
9573
9950
  NotifyPropertyChanges
9574
9951
  ], TreeGrid);
9575
9952
  return TreeGrid;
@@ -10983,6 +11360,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
10983
11360
  * @returns {void} - This function does not return any value.
10984
11361
  */
10985
11362
  RowDD.prototype.dropRows = function (args, isByMethod) {
11363
+ var oldParentsList = [];
10986
11364
  if (this.dropPosition !== 'Invalid' && !isRemoteData(this.parent)) {
10987
11365
  var tObj = this.parent;
10988
11366
  var draggedRecord_2;
@@ -11025,6 +11403,15 @@ var RowDD = /** @__PURE__ @class */ (function () {
11025
11403
  else {
11026
11404
  dragRecords = args.data;
11027
11405
  }
11406
+ if (isCheckboxcolumn(this.parent) && this.parent.autoCheckHierarchy) {
11407
+ for (var dragIndex = 0; dragIndex < dragRecords.length; dragIndex++) {
11408
+ var drag = dragRecords[parseInt(dragIndex.toString(), 10)];
11409
+ var oldParent = drag && drag.parentItem;
11410
+ if (oldParent) {
11411
+ oldParentsList.push(oldParent);
11412
+ }
11413
+ }
11414
+ }
11028
11415
  this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);
11029
11416
  var count = 0;
11030
11417
  var multiplegrid = this.parent.rowDropSettings.targetID;
@@ -11141,6 +11528,15 @@ var RowDD = /** @__PURE__ @class */ (function () {
11141
11528
  _loop_1(i);
11142
11529
  }
11143
11530
  }
11531
+ if (this.dropPosition !== 'Invalid' && !isNullOrUndefined(args.data) && args.data.length
11532
+ && isCheckboxcolumn(this.parent) && this.parent.autoCheckHierarchy) {
11533
+ this.parent.notify(hierarchyCheckstateUpdate, {
11534
+ draggedRecords: args.data,
11535
+ oldParents: oldParentsList,
11536
+ droppedRecord: this.droppedRecord,
11537
+ dropPosition: this.dropPosition
11538
+ });
11539
+ }
11144
11540
  };
11145
11541
  /**
11146
11542
  * Handles the logic for inserting a dragged record into the middle of a parent record's child records.
@@ -11591,7 +11987,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
11591
11987
  return RowDD;
11592
11988
  }());
11593
11989
 
11594
- var __extends$f = (undefined && undefined.__extends) || (function () {
11990
+ var __extends$g = (undefined && undefined.__extends) || (function () {
11595
11991
  var extendStatics = function (d, b) {
11596
11992
  extendStatics = Object.setPrototypeOf ||
11597
11993
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11604,7 +12000,7 @@ var __extends$f = (undefined && undefined.__extends) || (function () {
11604
12000
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11605
12001
  };
11606
12002
  })();
11607
- var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
12003
+ var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
11608
12004
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11609
12005
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
11610
12006
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -11614,17 +12010,17 @@ var __decorate$d = (undefined && undefined.__decorate) || function (decorators,
11614
12010
  * Configures the settings for row dragging and dropping within the TreeGrid, allowing for enhanced user interaction and data manipulation capabilities.
11615
12011
  */
11616
12012
  var RowDropSettings = /** @__PURE__ @class */ (function (_super) {
11617
- __extends$f(RowDropSettings, _super);
12013
+ __extends$g(RowDropSettings, _super);
11618
12014
  function RowDropSettings() {
11619
12015
  return _super !== null && _super.apply(this, arguments) || this;
11620
12016
  }
11621
- __decorate$d([
12017
+ __decorate$e([
11622
12018
  Property()
11623
12019
  ], RowDropSettings.prototype, "targetID", void 0);
11624
12020
  return RowDropSettings;
11625
12021
  }(ChildProperty));
11626
12022
 
11627
- var __extends$g = (undefined && undefined.__extends) || (function () {
12023
+ var __extends$h = (undefined && undefined.__extends) || (function () {
11628
12024
  var extendStatics = function (d, b) {
11629
12025
  extendStatics = Object.setPrototypeOf ||
11630
12026
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -11643,7 +12039,7 @@ var __extends$g = (undefined && undefined.__extends) || (function () {
11643
12039
  * @hidden
11644
12040
  */
11645
12041
  var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
11646
- __extends$g(TreeVirtualRowModelGenerator, _super);
12042
+ __extends$h(TreeVirtualRowModelGenerator, _super);
11647
12043
  function TreeVirtualRowModelGenerator(parent) {
11648
12044
  var _this = _super.call(this, parent) || this;
11649
12045
  _this.addEventListener();
@@ -11729,6 +12125,54 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
11729
12125
  return TreeVirtualRowModelGenerator;
11730
12126
  }(VirtualRowModelGenerator));
11731
12127
 
12128
+ var __extends$i = (undefined && undefined.__extends) || (function () {
12129
+ var extendStatics = function (d, b) {
12130
+ extendStatics = Object.setPrototypeOf ||
12131
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
12132
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
12133
+ return extendStatics(d, b);
12134
+ };
12135
+ return function (d, b) {
12136
+ extendStatics(d, b);
12137
+ function __() { this.constructor = d; }
12138
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12139
+ };
12140
+ })();
12141
+ /**
12142
+ * DomVirtualTreeContentRenderer extends Grid's DOM virtualization rendering layer to provide tree-specific hierarchy support.
12143
+ *
12144
+ * @hidden
12145
+ */
12146
+ var DomVirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
12147
+ __extends$i(DomVirtualTreeContentRenderer, _super);
12148
+ /**
12149
+ * Constructor for DomVirtualTreeContentRenderer
12150
+ *
12151
+ * @param {IGrid} parent - Grid/TreeGrid instance
12152
+ * @param {ServiceLocator} locator - Service locator for dependency injection
12153
+ */
12154
+ function DomVirtualTreeContentRenderer(parent, locator) {
12155
+ var _this = _super.call(this, parent, locator) || this;
12156
+ _this.addEventListener();
12157
+ return _this;
12158
+ }
12159
+ DomVirtualTreeContentRenderer.prototype.addEventListener = function () {
12160
+ if (this.parent.isDestroyed) {
12161
+ return;
12162
+ }
12163
+ };
12164
+ DomVirtualTreeContentRenderer.prototype.removeEventListener = function () {
12165
+ if (this.parent.isDestroyed) {
12166
+ return;
12167
+ }
12168
+ };
12169
+ DomVirtualTreeContentRenderer.prototype.destroy = function () {
12170
+ this.removeEventListener();
12171
+ _super.prototype.destroy.call(this);
12172
+ };
12173
+ return DomVirtualTreeContentRenderer;
12174
+ }(DomVirtualContentRenderer));
12175
+
11732
12176
  /**
11733
12177
  * TreeGrid Filter module will handle filtering action
11734
12178
  *
@@ -11741,7 +12185,7 @@ var Filter = /** @__PURE__ @class */ (function () {
11741
12185
  * @param {TreeGrid} parent - Tree Grid instance
11742
12186
  */
11743
12187
  function Filter(parent) {
11744
- initializeTelemetryFeature('Filter', 'TreeGrid');
12188
+ initializeTelemetryFeature('Filter', 'Treegrid');
11745
12189
  Grid.Inject(Filter$1);
11746
12190
  this.parent = parent;
11747
12191
  this.isHierarchyFilter = false;
@@ -12533,11 +12977,16 @@ var Page = /** @__PURE__ @class */ (function () {
12533
12977
  */
12534
12978
  Page.prototype.collapseExpandPagedchilds = function (rowDetails) {
12535
12979
  rowDetails.record.expanded = rowDetails.action === 'collapse' ? false : true;
12536
- this.parent.flatData.map(function (e) { return e.expanded = e.uniqueID === rowDetails.record.uniqueID &&
12980
+ var flatData = this.parent.flatData;
12981
+ var isRemote = isRemoteData(this.parent) && !isOffline(this.parent);
12982
+ if (this.parent.enableDomVirtualization && isRemote) {
12983
+ flatData = this.parent.getCurrentViewRecords();
12984
+ }
12985
+ flatData.map(function (e) { return e.expanded = e.uniqueID === rowDetails.record.uniqueID &&
12537
12986
  e.expanded !== rowDetails.record.expanded ? rowDetails.record.expanded : e.expanded; });
12538
12987
  if (this.parent.enableImmutableMode) {
12539
12988
  var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames()[0];
12540
- var record = this.parent.flatData.filter(function (e) {
12989
+ var record = flatData.filter(function (e) {
12541
12990
  return e["" + primaryKeyField_1] === rowDetails.record["" + primaryKeyField_1];
12542
12991
  });
12543
12992
  if (record.length) {
@@ -12545,13 +12994,14 @@ var Page = /** @__PURE__ @class */ (function () {
12545
12994
  }
12546
12995
  }
12547
12996
  var ret = {
12548
- result: this.parent.flatData,
12997
+ result: flatData,
12549
12998
  row: rowDetails.row,
12550
12999
  action: rowDetails.action,
12551
13000
  record: rowDetails.record,
12552
- count: this.parent.flatData.length
13001
+ count: flatData.length
12553
13002
  };
12554
- getValue('grid.renderModule', this.parent).dataManagerSuccess(ret);
13003
+ var request = this.parent.enableDomVirtualization ? { requestType: 'refresh' } : undefined;
13004
+ getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, request);
12555
13005
  if (this.parent.enableImmutableMode) {
12556
13006
  var row = 'row';
12557
13007
  var action = 'action';
@@ -12751,11 +13201,6 @@ var Toolbar = /** @__PURE__ @class */ (function () {
12751
13201
  Toolbar.prototype.toolbarClickHandler = function (args) {
12752
13202
  var tObj = this.parent;
12753
13203
  var indentOutdentAction = 'indentOutdentAction';
12754
- if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&
12755
- args.item.id === this.parent.grid.element.id + '_update') {
12756
- args.cancel = true;
12757
- this.parent.grid.editModule.saveCell();
12758
- }
12759
13204
  if (args.item.id === this.parent.grid.element.id + '_expandall') {
12760
13205
  this.parent.expandAll();
12761
13206
  }
@@ -12770,6 +13215,13 @@ var Toolbar = /** @__PURE__ @class */ (function () {
12770
13215
  && !isNullOrUndefined(tObj.rowDragAndDropModule)) {
12771
13216
  this.parent.rowDragAndDropModule["" + indentOutdentAction](null, 'outdent');
12772
13217
  }
13218
+ if (args.item.id === tObj.grid.element.id + '_delete'
13219
+ && isCheckboxcolumn(this.parent)
13220
+ && this.parent.getCheckedRecords().length > 0
13221
+ && !isNullOrUndefined(this.parent.selectionModule)) {
13222
+ this.parent.selectionModule['deleteCheckedRecords']();
13223
+ args.cancel = true;
13224
+ }
12773
13225
  };
12774
13226
  /**
12775
13227
  * Gets the toolbar of the TreeGrid.
@@ -12854,11 +13306,25 @@ var Aggregate = /** @__PURE__ @class */ (function () {
12854
13306
  var childRecordsLength;
12855
13307
  var columns = this.parent.getColumns();
12856
13308
  if (this.parent.aggregates.filter(function (x) { return x.showChildSummary; }).length) {
12857
- for (var i = 0, len = dataLength; i < len; i++) {
13309
+ var _loop_1 = function (i, len) {
12858
13310
  parentRecord = parentRecords[parseInt(i.toString(), 10)];
12859
- childRecordsLength = this.getChildRecordsLength(parentRecord, flatRecords);
13311
+ childRecordsLength = this_1.getChildRecordsLength(parentRecord, flatRecords);
12860
13312
  if (childRecordsLength) {
12861
- var _loop_1 = function (summaryRowIndex, len_1) {
13313
+ var childRecords_1 = getObject('childRecords', parentRecord) || [];
13314
+ var existingSummaryRows = childRecords_1.filter(function (e) {
13315
+ return getObject('isSummaryRow', e) && getObject('parentUniqueID', e) === parentRecord.uniqueID;
13316
+ });
13317
+ existingSummaryRows.forEach(function (summaryRow) {
13318
+ var summaryIndex = flatRecords.indexOf(summaryRow);
13319
+ if (summaryIndex !== -1) {
13320
+ flatRecords.splice(summaryIndex, 1);
13321
+ }
13322
+ var childSummaryIndex = childRecords_1.indexOf(summaryRow);
13323
+ if (childSummaryIndex !== -1) {
13324
+ childRecords_1.splice(childSummaryIndex, 1);
13325
+ }
13326
+ });
13327
+ var _loop_2 = function (summaryRowIndex, len_1) {
12862
13328
  var item = void 0;
12863
13329
  item = {};
12864
13330
  for (var i_1 = 0; i_1 < columns.length; i_1++) {
@@ -12885,9 +13351,8 @@ var Aggregate = /** @__PURE__ @class */ (function () {
12885
13351
  setValue('isSummaryRow', true, item);
12886
13352
  setValue('parentUniqueID', summaryParent.uniqueID, item);
12887
13353
  if (isSort) {
12888
- var childRecords = getObject('childRecords', parentRecord);
12889
- if (childRecords.length) {
12890
- childRecords.push(item);
13354
+ if (childRecords_1.length) {
13355
+ childRecords_1.push(item);
12891
13356
  }
12892
13357
  }
12893
13358
  flatRecords.splice(currentIndex, 0, item);
@@ -12896,12 +13361,15 @@ var Aggregate = /** @__PURE__ @class */ (function () {
12896
13361
  return "continue";
12897
13362
  }
12898
13363
  };
12899
- var this_1 = this;
12900
13364
  for (var summaryRowIndex = 1, len_1 = summaryLength; summaryRowIndex <= len_1; summaryRowIndex++) {
12901
- _loop_1(summaryRowIndex, len_1);
13365
+ _loop_2(summaryRowIndex, len_1);
12902
13366
  }
12903
- this.flatChildRecords = [];
13367
+ this_1.flatChildRecords = [];
12904
13368
  }
13369
+ };
13370
+ var this_1 = this;
13371
+ for (var i = 0, len = dataLength; i < len; i++) {
13372
+ _loop_1(i, len);
12905
13373
  }
12906
13374
  }
12907
13375
  else {
@@ -14107,14 +14575,13 @@ var Edit = /** @__PURE__ @class */ (function () {
14107
14575
  this.parent.on(cellEdit, this.cellEdit, this);
14108
14576
  this.parent.on('actionBegin', this.editActionEvents, this);
14109
14577
  this.parent.on('actionComplete', this.editActionEvents, this);
14578
+ this.parent.on('resetDoubleClickTarget', this.resetDoubleClickTarget, this);
14110
14579
  this.parent.grid.on(doubleTap, this.recordDoubleClick, this);
14111
14580
  this.parent.grid.on('dblclick', this.gridDblClick, this);
14112
14581
  this.parent.grid.on('recordAdded', this.customCellSave, this);
14113
14582
  this.parent.on('savePreviousRowPosition', this.savePreviousRowPosition, this);
14114
14583
  // this.parent.on(events.beforeDataBound, this.beforeDataBound, this);
14115
14584
  this.parent.grid.on(beforeStartEdit, this.beforeStartEdit, this);
14116
- this.parent.grid.on(beforeBatchCancel, this.beforeBatchCancel, this);
14117
- this.parent.grid.on('reset-edit-props', this.resetIsOnBatch, this);
14118
14585
  this.parent.grid.on('get-row-position', this.getRowPosition, this);
14119
14586
  this.parent.grid.on('last-row-validation', this.lastRowValidation, this);
14120
14587
  };
@@ -14130,7 +14597,6 @@ var Edit = /** @__PURE__ @class */ (function () {
14130
14597
  /* eslint-disable-next-line */
14131
14598
  this.parent.grid.getDataRows()[rowIndex].dataset.uid = this.parent.grid.contentModule.getRows()[rowIndex].uid;
14132
14599
  }
14133
- this.doubleClickTarget = null;
14134
14600
  }
14135
14601
  };
14136
14602
  Edit.prototype.getRowPosition = function (addArgs) {
@@ -14138,17 +14604,14 @@ var Edit = /** @__PURE__ @class */ (function () {
14138
14604
  addArgs.addRowIndex = this.addRowIndex;
14139
14605
  addArgs.dataRowIndex = +this.prevAriaRowIndex;
14140
14606
  };
14607
+ Edit.prototype.resetDoubleClickTarget = function () {
14608
+ this.doubleClickTarget = null;
14609
+ };
14141
14610
  Edit.prototype.beforeStartEdit = function (args) {
14142
14611
  if (this.parent.editSettings.mode === 'Cell') {
14143
14612
  this.parent.trigger(actionBegin, args);
14144
14613
  }
14145
14614
  };
14146
- Edit.prototype.beforeBatchCancel = function (args) {
14147
- if (this.parent.editSettings.mode === 'Cell') {
14148
- args['requestType'] = 'cancel';
14149
- this.parent.trigger(actionComplete, args);
14150
- }
14151
- };
14152
14615
  /**
14153
14616
  * @hidden
14154
14617
  * @returns {void}
@@ -14172,9 +14635,8 @@ var Edit = /** @__PURE__ @class */ (function () {
14172
14635
  this.parent.grid.off(doubleTap, this.recordDoubleClick);
14173
14636
  this.parent.off('savePreviousRowPosition', this.savePreviousRowPosition);
14174
14637
  this.parent.grid.off(beforeStartEdit, this.beforeStartEdit);
14175
- this.parent.grid.off(beforeBatchCancel, this.beforeBatchCancel);
14638
+ this.parent.off('resetDoubleClickTarget', this.resetDoubleClickTarget);
14176
14639
  this.parent.grid.off('dblclick', this.gridDblClick);
14177
- this.parent.grid.off('reset-edit-props', this.resetIsOnBatch);
14178
14640
  this.parent.grid.off('get-row-position', this.getRowPosition);
14179
14641
  this.parent.grid.off('last-row-validation', this.lastRowValidation);
14180
14642
  //this.parent.grid.off('click', this.gridSingleClick);
@@ -14301,33 +14763,10 @@ var Edit = /** @__PURE__ @class */ (function () {
14301
14763
  return;
14302
14764
  }
14303
14765
  var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex') - 1);
14304
- if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&
14766
+ if (this.parent.editSettings.mode === 'Cell' && column && !column.isPrimaryKey &&
14305
14767
  this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||
14306
14768
  target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {
14307
- this.isOnBatch = true;
14308
14769
  this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);
14309
- if (this.parent.enableVirtualization) {
14310
- var tr = parentsUntil(args.target, 'e-row');
14311
- this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');
14312
- tr.setAttribute('aria-rowindex', (tr.rowIndex + 1) + '');
14313
- }
14314
- this.updateGridEditMode('Batch');
14315
- }
14316
- else if (this.parent.editSettings.mode === 'Cell' && (!column.allowEditing || column.isPrimaryKey)) {
14317
- this.isOnBatch = true;
14318
- this.updateGridEditMode('Batch');
14319
- }
14320
- };
14321
- Edit.prototype.updateGridEditMode = function (mode) {
14322
- this.parent.grid.setProperties({ editSettings: { mode: mode } }, true);
14323
- var updateMethod = getObject('updateEditObj', this.parent.grid.editModule);
14324
- updateMethod.apply(this.parent.grid.editModule);
14325
- this.parent.grid.isEdit = false;
14326
- };
14327
- Edit.prototype.resetIsOnBatch = function () {
14328
- if (this.parent.enableVirtualization && this.parent.editSettings.mode === 'Cell' && !this.parent['isGantt']) {
14329
- this.isOnBatch = false;
14330
- this.updateGridEditMode('Normal');
14331
14770
  }
14332
14771
  };
14333
14772
  Edit.prototype.keyPressed = function (args) {
@@ -14338,7 +14777,9 @@ var Edit = /** @__PURE__ @class */ (function () {
14338
14777
  this.recordDoubleClick(args);
14339
14778
  }
14340
14779
  if (args.action === 'escape') {
14341
- this.closeEdit();
14780
+ if (this.parent.grid.isEdit) {
14781
+ this.closeEdit();
14782
+ }
14342
14783
  }
14343
14784
  };
14344
14785
  Edit.prototype.deleteUniqueID = function (value) {
@@ -14352,6 +14793,13 @@ var Edit = /** @__PURE__ @class */ (function () {
14352
14793
  var promise = 'promise';
14353
14794
  var prom = args["" + promise];
14354
14795
  delete args["" + promise];
14796
+ if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||
14797
+ this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-summarycell') ||
14798
+ this.doubleClickTarget.closest('.e-hierarchycheckbox'))) {
14799
+ args.cancel = true;
14800
+ this.doubleClickTarget = null;
14801
+ return;
14802
+ }
14355
14803
  if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
14356
14804
  args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
14357
14805
  this.prevAriaRowIndex = undefined;
@@ -14361,21 +14809,11 @@ var Edit = /** @__PURE__ @class */ (function () {
14361
14809
  if (!celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {
14362
14810
  _this.enableToolbarItems('edit');
14363
14811
  }
14364
- else if (celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {
14365
- _this.isOnBatch = false;
14366
- _this.updateGridEditMode('Normal');
14367
- }
14368
14812
  if (!isNullOrUndefined(prom)) {
14369
14813
  prom.resolve(celleditArgs);
14370
14814
  }
14371
14815
  });
14372
14816
  }
14373
- if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||
14374
- this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-summarycell'))) {
14375
- args.cancel = true;
14376
- this.doubleClickTarget = null;
14377
- return;
14378
- }
14379
14817
  if (this.parent.editSettings.mode === 'Cell') {
14380
14818
  if (this.keyPress === 'tab' || this.keyPress === 'shiftTab') {
14381
14819
  this.keyPress = null;
@@ -14404,20 +14842,6 @@ var Edit = /** @__PURE__ @class */ (function () {
14404
14842
  }
14405
14843
  };
14406
14844
  Edit.prototype.batchCancel = function () {
14407
- if (this.parent.editSettings.mode === 'Cell') {
14408
- var cellDetails = getValue('editModule.cellDetails', this.parent.grid.editModule);
14409
- if (!isNullOrUndefined(this.editedRowIndex)) {
14410
- cellDetails.rowIndex = this.editedRowIndex;
14411
- }
14412
- var treeCell = this.parent.getCellFromIndex(cellDetails.rowIndex, this.parent.treeColumnIndex);
14413
- this.parent.renderModule.cellRender({
14414
- data: cellDetails.rowData,
14415
- cell: treeCell,
14416
- column: this.parent.grid.getColumns()[this.parent.treeColumnIndex]
14417
- });
14418
- this.updateGridEditMode('Normal');
14419
- this.isOnBatch = false;
14420
- }
14421
14845
  if (this.parent.editSettings.mode === 'Batch') {
14422
14846
  this.parent.notify('batchCancelAction', {});
14423
14847
  }
@@ -14425,138 +14849,16 @@ var Edit = /** @__PURE__ @class */ (function () {
14425
14849
  Edit.prototype.customCellSave = function (args) {
14426
14850
  if (isCountRequired(this.parent) && this.parent.editSettings.mode === 'Cell' && args.action === 'edit') {
14427
14851
  this.updateCell(args, args.rowIndex);
14428
- this.afterCellSave(args, args.row);
14429
14852
  }
14430
14853
  };
14431
14854
  Edit.prototype.cellSave = function (args) {
14432
- var _this = this;
14433
- if (this.parent.editSettings.mode === 'Cell' && this.parent.element.querySelector('form')) {
14434
- args.cancel = true;
14435
- var editModule = 'editModule';
14436
- setValue('isEditCollapse', true, this.parent);
14437
- args.rowData[args.columnName] = args.value;
14438
- var row_1;
14439
- if (isNullOrUndefined(args.cell)) {
14440
- row_1 = this.parent.grid.editModule["" + editModule].form.parentElement.parentNode;
14441
- }
14442
- else {
14443
- row_1 = args.cell.parentNode;
14444
- }
14445
- var rowIndex_1;
14446
- var primaryKeys_1 = this.parent.getPrimaryKeyFieldNames();
14447
- if (isNullOrUndefined(row_1)) {
14448
- this.parent.grid.getCurrentViewRecords().filter(function (e, i) {
14449
- if (e[primaryKeys_1[0]] === args.rowData[primaryKeys_1[0]]) {
14450
- rowIndex_1 = i;
14451
- return;
14452
- }
14453
- });
14454
- }
14455
- else {
14456
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
14457
- this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
14458
- if (freeze) {
14459
- if (this.parent.getRows().indexOf(row_1) !== -1) {
14460
- rowIndex_1 = this.parent.getRows().indexOf(row_1);
14461
- }
14462
- else {
14463
- rowIndex_1 = this.parent.getRows().indexOf(row_1);
14464
- }
14465
- }
14466
- else {
14467
- rowIndex_1 = (this.parent.getRows().indexOf(row_1) === -1 && (this.parent.getFrozenColumns() > 0)) ?
14468
- this.parent.grid.getRows().indexOf(row_1) : this.parent.getRows().indexOf(row_1);
14469
- }
14470
- }
14471
- var arg = {};
14472
- extend$1(arg, args);
14473
- arg.cancel = false;
14474
- arg.type = 'save';
14475
- row_1 = this.parent.grid.getRows()[row_1.rowIndex];
14476
- this.parent.trigger(actionBegin, arg);
14477
- if (!arg.cancel) {
14478
- if ((row_1.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'tab') {
14479
- this.isTabLastRow = true;
14480
- }
14481
- if (!isRemoteData(this.parent) &&
14482
- !(this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {
14483
- if (isCountRequired(this.parent)) {
14484
- var eventPromise = 'eventPromise';
14485
- var editArgs = { requestType: 'save', data: args.rowData, action: 'edit', row: row_1,
14486
- rowIndex: rowIndex_1, rowData: args.rowData, columnName: args.columnName,
14487
- filterChoiceCount: null, excelSearchOperator: null };
14488
- this.parent.grid.getDataModule()["" + eventPromise](editArgs, this.parent.grid.query);
14489
- }
14490
- else {
14491
- this.updateCell(args, rowIndex_1);
14492
- setValue('isEdit', false, this.parent.grid);
14493
- this.afterCellSave(args, row_1);
14494
- }
14495
- }
14496
- else if (isRemoteData(this.parent) ||
14497
- (this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {
14498
- var query = this.parent.grid.query;
14499
- if (this.parent['isGantt'] && this.parent.loadChildOnDemand) {
14500
- this.updateCell(args, rowIndex_1);
14501
- setValue('isEdit', false, this.parent.grid);
14502
- this.afterCellSave(args, row_1);
14503
- }
14504
- else {
14505
- var crud = null;
14506
- crud = this.parent.grid.dataSource.update(primaryKeys_1[0], args.rowData, query.fromTable, query, args.previousValue);
14507
- crud.then(function (e) {
14508
- if (!isNullOrUndefined(e)) {
14509
- args.rowData[args.columnName] = e[args.columnName];
14510
- }
14511
- _this.updateCell(args, rowIndex_1);
14512
- setValue('isEdit', false, _this.parent.grid);
14513
- _this.afterCellSave(args, row_1);
14514
- });
14515
- }
14516
- }
14517
- }
14518
- else {
14519
- this.parent.grid.isEdit = true;
14520
- }
14521
- }
14522
14855
  if (this.parent.enableVirtualization) {
14523
14856
  this.parent.grid.contentModule['virtualData'] = {};
14524
14857
  }
14525
14858
  };
14526
- Edit.prototype.afterCellSave = function (args, row) {
14527
- if (this.parent.grid.aggregateModule) {
14528
- this.parent.grid.aggregateModule.refresh(args.rowData);
14529
- }
14530
- this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(args.columnName)]);
14531
- this.parent.grid.editModule.formObj.destroy();
14532
- if (this.keyPress !== 'tab' && this.keyPress !== 'shiftTab') {
14533
- this.updateGridEditMode('Normal');
14534
- this.isOnBatch = false;
14535
- }
14536
- this.enableToolbarItems('save');
14537
- removeClass([row], ['e-editedrow', 'e-batchrow']);
14538
- removeClass(row.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);
14539
- if (this.parent['isCellSaveFocus'] !== false) {
14540
- this.parent.grid.focusModule.restoreFocus();
14541
- }
14542
- editAction({ value: args.rowData, action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, args.columnName);
14543
- if ((row.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'enter') {
14544
- this.keyPress = null;
14545
- }
14546
- var saveArgs = {
14547
- type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,
14548
- previousData: args.previousValue, row: row, target: args.cell
14549
- };
14550
- if (this.parent.aggregates.some(function (ag) { return ag.showChildSummary === true; })) {
14551
- this.parent.grid.refresh();
14552
- }
14553
- this.parent.trigger(actionComplete, saveArgs);
14554
- };
14555
14859
  Edit.prototype.lastCellTab = function () {
14556
- if (!this.parent.grid.isEdit && this.isOnBatch && this.keyPress === 'tab' && this.parent.editSettings.mode === 'Cell') {
14860
+ if (!this.parent.grid.isEdit && this.keyPress === 'tab' && this.parent.editSettings.mode === 'Cell') {
14557
14861
  if (!this.parent.editSettings.allowNextRowEdit) {
14558
- this.updateGridEditMode('Normal');
14559
- this.isOnBatch = false;
14560
14862
  this.keyPress = null;
14561
14863
  }
14562
14864
  else {
@@ -14814,12 +15116,13 @@ var Edit = /** @__PURE__ @class */ (function () {
14814
15116
  args.cancel = true;
14815
15117
  return;
14816
15118
  }
14817
- if (this.parent.editSettings.mode === 'Cell' && args.requestType === 'beginEdit') {
15119
+ if (this.parent.editSettings.mode === 'Cell' && args.requestType === 'beginEdit' && args.row.classList.contains('e-summaryrow')) {
14818
15120
  args.cancel = true;
14819
15121
  return;
14820
15122
  }
14821
15123
  if (this.doubleClickTarget && args.requestType !== 'delete' && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||
14822
- this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-frame'))) {
15124
+ this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-frame') ||
15125
+ this.doubleClickTarget.closest('.e-hierarchycheckbox'))) {
14823
15126
  args.cancel = true;
14824
15127
  this.doubleClickTarget = null;
14825
15128
  return;
@@ -14827,10 +15130,10 @@ var Edit = /** @__PURE__ @class */ (function () {
14827
15130
  if (args.requestType === 'delete') {
14828
15131
  var data_1 = args.data;
14829
15132
  if (isNullOrUndefined(args.data[0].uniqueID)) {
14830
- var primaryKeys_2 = this.parent.getPrimaryKeyFieldNames();
15133
+ var primaryKeys_1 = this.parent.getPrimaryKeyFieldNames();
14831
15134
  var _loop_1 = function (i) {
14832
15135
  this_1.parent.flatData.filter(function (e) {
14833
- if (e["" + primaryKeys_2[0]] === args.data[parseInt(i.toString(), 10)][primaryKeys_2[0]]) {
15136
+ if (e["" + primaryKeys_1[0]] === args.data[parseInt(i.toString(), 10)][primaryKeys_1[0]]) {
14834
15137
  data_1[parseInt(i.toString(), 10)] = e;
14835
15138
  }
14836
15139
  });
@@ -15135,6 +15438,7 @@ var Edit = /** @__PURE__ @class */ (function () {
15135
15438
  else {
15136
15439
  this.selectedIndex = this.parent.selectedRowIndex;
15137
15440
  this.addRowIndex = this.parent.selectedRowIndex;
15441
+ index = this.parent.selectedRowIndex;
15138
15442
  }
15139
15443
  if (position) {
15140
15444
  this.parent.setProperties({ editSettings: { newRowPosition: position } }, true);
@@ -15180,10 +15484,6 @@ var Edit = /** @__PURE__ @class */ (function () {
15180
15484
  */
15181
15485
  Edit.prototype.editCell = function (rowIndex, field) {
15182
15486
  if (this.parent.editSettings.mode === 'Cell' || this.parent.editSettings.mode === 'Batch') {
15183
- if (this.parent.editSettings.mode !== 'Batch') {
15184
- this.isOnBatch = true;
15185
- this.updateGridEditMode('Batch');
15186
- }
15187
15487
  this.parent.grid.editModule.editCell(rowIndex, field);
15188
15488
  }
15189
15489
  };
@@ -15375,7 +15675,7 @@ var DetailRow = /** @__PURE__ @class */ (function () {
15375
15675
  return DetailRow;
15376
15676
  }());
15377
15677
 
15378
- var __extends$h = (undefined && undefined.__extends) || (function () {
15678
+ var __extends$j = (undefined && undefined.__extends) || (function () {
15379
15679
  var extendStatics = function (d, b) {
15380
15680
  extendStatics = Object.setPrototypeOf ||
15381
15681
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -15394,7 +15694,7 @@ var __extends$h = (undefined && undefined.__extends) || (function () {
15394
15694
  * @hidden
15395
15695
  */
15396
15696
  var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15397
- __extends$h(VirtualTreeContentRenderer, _super);
15697
+ __extends$j(VirtualTreeContentRenderer, _super);
15398
15698
  function VirtualTreeContentRenderer(parent, locator) {
15399
15699
  var _this = _super.call(this, parent, locator) || this;
15400
15700
  _this.isExpandCollapse = false;
@@ -15884,7 +16184,6 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15884
16184
  VirtualTreeContentRenderer.prototype.resetIseditValue = function () {
15885
16185
  var resetIsEdit = 'resetIsedit';
15886
16186
  var isAdd = 'isAdd';
15887
- this.parent.notify('reset-edit-props', {});
15888
16187
  if ((this.rowPosition === 'Top' || this.rowPosition === 'Bottom') && this["" + isAdd]) {
15889
16188
  _super.prototype["" + resetIsEdit].call(this);
15890
16189
  }
@@ -16207,7 +16506,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
16207
16506
  }
16208
16507
  }
16209
16508
  }
16210
- if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
16509
+ if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top <= (rowHeight * this.totalRecords)))
16211
16510
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
16212
16511
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
16213
16512
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== ''))) {
@@ -16425,7 +16724,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
16425
16724
  return VirtualTreeContentRenderer;
16426
16725
  }(VirtualContentRenderer));
16427
16726
  var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16428
- __extends$h(TreeInterSectionObserver, _super);
16727
+ __extends$j(TreeInterSectionObserver, _super);
16429
16728
  function TreeInterSectionObserver() {
16430
16729
  var _this = _super !== null && _super.apply(this, arguments) || this;
16431
16730
  _this.isWheeling = false;
@@ -16577,7 +16876,7 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16577
16876
  return TreeInterSectionObserver;
16578
16877
  }(InterSectionObserver));
16579
16878
 
16580
- var __extends$i = (undefined && undefined.__extends) || (function () {
16879
+ var __extends$k = (undefined && undefined.__extends) || (function () {
16581
16880
  var extendStatics = function (d, b) {
16582
16881
  extendStatics = Object.setPrototypeOf ||
16583
16882
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -16860,7 +17159,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
16860
17159
  return VirtualScroll;
16861
17160
  }());
16862
17161
  var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
16863
- __extends$i(TreeVirtual, _super);
17162
+ __extends$k(TreeVirtual, _super);
16864
17163
  function TreeVirtual(parent, locator) {
16865
17164
  var _this = _super.call(this, parent, locator) || this;
16866
17165
  getValue('parent', _this).off('initial-load', getValue('instantiateRenderer', _this), _this);
@@ -17441,5 +17740,247 @@ var InfiniteScroll = /** @__PURE__ @class */ (function () {
17441
17740
  return InfiniteScroll;
17442
17741
  }());
17443
17742
 
17444
- export { Aggregate, AggregateColumn, AggregateRow, Column, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, ContextMenuItems, DataManipulation, DetailRow, Edit, EditSettings, ExcelExport, Filter, FilterSettings, Freeze, InfiniteScroll, InfiniteScrollSettings, LoadingIndicator, Logger, Page, PageSettings, PdfExport, Predicate, Render, Reorder, Resize, RowDD, RowDropSettings, SearchSettings, Selection, SelectionSettings, Sort, SortDescriptor, SortSettings, StackedColumn, Toolbar, ToolbarItem, TreeClipboard, TreeGrid, TreeGridColumn, TreeVirtual, TreeVirtualRowModelGenerator, VirtualScroll, actionBegin, actionComplete, actionFailure, ariaColIndex, ariaRowIndex, autoCol, batchAdd, batchCancel, batchDelete, batchEditFormRendered, batchSave, beforeBatchAdd, beforeBatchCancel, beforeBatchDelete, beforeBatchSave, beforeCopy, beforeDataBound, beforeExcelExport, beforePaste, beforePdfExport, beforeStartEdit, beginAdd, beginEdit, cellEdit, cellSave, cellSaved, checkboxChange, collapseActionComplete, collapsed, collapsing, content, contextMenuClick, contextMenuOpen, crudAction, dataBound, dataListener, dataStateChange, destroy, detailDataBound, doubleTap, expanded, expanding, extendArray, findChildrenRecords, findParentRecords, frozenContent, frozenHeader, frozenLeft, frozenRight, getExpandStatus, getParentData, getPlainData, headerContent, indexModifier, isCheckboxcolumn, isCountRequired, isFilterChildHierarchy, isHidden, isOffline, isRemoteData, keyPressed, leftRight, load, localPagedExpandCollapse, movableContent, movableHeader, pagingActions, printGridInit, queryCellInfo, recordDoubleClick, remoteExpand, resizeStop, rowDataBound, rowDeselected, rowDeselecting, rowDrag, rowDragStart, rowDragStartHelper, rowDrop, rowDropped, rowSelected, rowSelecting, rowdraging, rowsAdd, rowsRemove, savePreviousRowPosition, table, toolbarClick, treeGridDetails, updateData, virtualActionArgs, virtualColumnIndex };
17743
+ var __extends$l = (undefined && undefined.__extends) || (function () {
17744
+ var extendStatics = function (d, b) {
17745
+ extendStatics = Object.setPrototypeOf ||
17746
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
17747
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
17748
+ return extendStatics(d, b);
17749
+ };
17750
+ return function (d, b) {
17751
+ extendStatics(d, b);
17752
+ function __() { this.constructor = d; }
17753
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17754
+ };
17755
+ })();
17756
+ /**
17757
+ * TreeGrid DOM Virtualization module handles high-performance rendering of large hierarchical datasets.
17758
+ *
17759
+ * @hidden
17760
+ */
17761
+ var DomVirtualization = /** @__PURE__ @class */ (function () {
17762
+ /**
17763
+ * Constructor for DomVirtualization module
17764
+ *
17765
+ * @param {TreeGrid} parent - TreeGrid instance
17766
+ * @param {ServiceLocator} locator - Service locator for dependency injection
17767
+ */
17768
+ function DomVirtualization(parent, locator) {
17769
+ /** @hidden */
17770
+ this.startIndex = -1;
17771
+ /** @hidden */
17772
+ this.endIndex = -1;
17773
+ initializeTelemetryFeature('DomVirtualization', 'TreeGrid');
17774
+ this.parent = parent;
17775
+ this.locator = locator;
17776
+ Grid.Inject(DomVirtualTreeExtension);
17777
+ this.addEventListener();
17778
+ }
17779
+ DomVirtualization.prototype.getModuleName = function () {
17780
+ return 'domVirtualization';
17781
+ };
17782
+ /**
17783
+ * @hidden
17784
+ * @returns {void}
17785
+ */
17786
+ DomVirtualization.prototype.addEventListener = function () {
17787
+ if (this.parent.isDestroyed) {
17788
+ return;
17789
+ }
17790
+ this.parent.on(destroy$1, this.destroy, this);
17791
+ this.parent.on(virtualExpandCollapse, this.collapseExpandVirtualchilds, this);
17792
+ this.parent.on(pagingActions, this.virtualPageAction, this);
17793
+ this.parent.grid.on(beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords, this);
17794
+ };
17795
+ /**
17796
+ * @hidden
17797
+ * @returns {void}
17798
+ */
17799
+ DomVirtualization.prototype.removeEventListener = function () {
17800
+ if (this.parent.isDestroyed) {
17801
+ return;
17802
+ }
17803
+ this.parent.off(destroy$1, this.destroy);
17804
+ this.parent.off(virtualExpandCollapse, this.collapseExpandVirtualchilds);
17805
+ this.parent.off(pagingActions, this.virtualPageAction);
17806
+ this.parent.grid.off(beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords);
17807
+ };
17808
+ /**
17809
+ * Handles the action related to virtual scrolling with paging details.
17810
+ *
17811
+ * @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
17812
+ * @param {ITreeData[]} pageingDetails.result - The result data to be handled.
17813
+ * @param {number} pageingDetails.count - The count of results.
17814
+ * @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
17815
+ * @returns {void}
17816
+ */
17817
+ DomVirtualization.prototype.virtualPageAction = function (pageingDetails) {
17818
+ var _this = this;
17819
+ var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
17820
+ var action = getValue('action', pageingDetails.actionArgs);
17821
+ var isFiltering = (pageingDetails.actionArgs.requestType === 'filtering' && (pageingDetails.actionArgs.action !== 'clear-filter' && pageingDetails.actionArgs.action !== 'clearFilter')) ||
17822
+ (!isNullOrUndefined(this.parent['filterModule']) && (this.parent['filterModule'].filteredResult && this.parent['filterModule'].filteredResult.length > 0));
17823
+ var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
17824
+ this.parent.filterSettings.hierarchyMode === 'None';
17825
+ var parents = pageingDetails.result;
17826
+ parents = isFiltering && isFlatHierarchy ? parents.filter(function (e) {
17827
+ if (isNullOrUndefined(e.parentItem)) {
17828
+ return true;
17829
+ }
17830
+ var hasParentInFilteredList = parents.some(function (p) { return p.uniqueID === e.parentItem.uniqueID; });
17831
+ return hasParentInFilteredList ? getExpandStatus(_this.parent, e) : true;
17832
+ }) : parents.filter(function (e) { return getExpandStatus(_this.parent, e); });
17833
+ this.parent.virtualDomScrollData = parents;
17834
+ var dm = new DataManager(parents);
17835
+ this.visualData = parents;
17836
+ var query = new Query();
17837
+ if (this.parent.allowPaging || this.parent.enableVirtualization) {
17838
+ var take = isNullOrUndefined(actionArgs.requestType) || actionArgs.requestType === 'dom-virtualscroll' ?
17839
+ pageingDetails.actionArgs.result.length : pageingDetails.result.length;
17840
+ if (action === 'collapse') {
17841
+ take = this.parent.grid.currentViewData.length;
17842
+ }
17843
+ var skip = this.parent.grid.pageSettings.currentPage <= 1 ? 0 :
17844
+ (this.parent.grid.pageSettings.currentPage - 1) * this.parent.grid.pageSettings.pageSize;
17845
+ if (actionArgs.requestType === 'dom-virtualscroll') {
17846
+ var pagingQueries = (pageingDetails.actionArgs && pageingDetails.actionArgs.query
17847
+ && pageingDetails.actionArgs.query.queries) || [];
17848
+ var takeQuery = pagingQueries.filter(function (q) { return q.fn === 'onTake'; });
17849
+ var explicitTake = takeQuery.length > 0
17850
+ ? takeQuery[parseInt((takeQuery.length - 1).toString(), 10)] : undefined;
17851
+ if (!isNullOrUndefined(explicitTake) && typeof explicitTake.e.nos === 'number') {
17852
+ take = explicitTake.e.nos;
17853
+ }
17854
+ }
17855
+ else if ((actionArgs.requestType === 'filtering' || actionArgs.requestType === 'searching') && skip > 0) {
17856
+ skip = 0;
17857
+ this.parent.grid.setProperties({ pageSettings: { currentPage: 1 } }, true);
17858
+ }
17859
+ query = query.skip(skip).take(take);
17860
+ }
17861
+ dm.dataSource.json = this.visualData;
17862
+ pageingDetails.result = dm.executeLocal(query);
17863
+ pageingDetails.count = this.visualData.length;
17864
+ this.parent.notify('updateAction', pageingDetails);
17865
+ };
17866
+ DomVirtualization.prototype.calculateChildCount = function (startIndex, level, records) {
17867
+ var count = 0;
17868
+ for (var i = startIndex; i < records.length; i++) {
17869
+ if (records[i + 1] && (level === records[i + 1].level || level === records[i + 1].level + 1)) {
17870
+ break;
17871
+ }
17872
+ count++;
17873
+ }
17874
+ return count;
17875
+ };
17876
+ /**
17877
+ * Handles the virtual child collapse or expand action in a tree grid.
17878
+ *
17879
+ * @param {object} row - Object containing information about the collapse/expand action.
17880
+ * @param {string} row.action - The type of action, either "collapse" or "expand".
17881
+ * @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
17882
+ * @param {ITreeData} row.record - The tree data record associated with the row.
17883
+ * @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
17884
+ *
17885
+ * @returns {void} No return value as the function executes a procedure.
17886
+ */
17887
+ DomVirtualization.prototype.collapseExpandVirtualchilds = function (row) {
17888
+ var contentModule = this.parent.grid.contentModule;
17889
+ var isRemote = isRemoteData(this.parent) && !isOffline(this.parent);
17890
+ var flatData = isRemote ? this.parent.getCurrentViewRecords() : this.parent.enableVirtualization ?
17891
+ this.parent.virtualDomScrollData.slice() : this.parent.grid.currentViewData.slice();
17892
+ var totalflatData = this.parent.infiniteScrollData;
17893
+ var uniqueIDCollpaseCollection = this.parent.uniqueIDCollpaseCollection;
17894
+ var startIndex = contentModule.currentStartIndex;
17895
+ if (getValue('isCollapseAll', this.parent) || getValue('isExpandAll', this.parent)) {
17896
+ if (row.action === 'collapse') {
17897
+ flatData.filter(function (e) {
17898
+ if (e.hasChildRecords) {
17899
+ e.expanded = row.action === 'collapse' ? false : true;
17900
+ }
17901
+ });
17902
+ flatData.splice.apply(flatData, [0, flatData.length].concat(this.parent.parentData));
17903
+ // this.parent.pageSettings.totalRecordsCount = this.parent.parentData.length;
17904
+ }
17905
+ else {
17906
+ totalflatData.filter(function (e) {
17907
+ if (e.hasChildRecords) {
17908
+ e.expanded = row.action === 'collapse' ? false : true;
17909
+ }
17910
+ });
17911
+ flatData.splice.apply(flatData, [0, flatData.length].concat(totalflatData));
17912
+ // this.parent.pageSettings.totalRecordsCount = totalflatData.length;
17913
+ }
17914
+ }
17915
+ else {
17916
+ row.record.expanded = row.action === 'collapse' ? false : true;
17917
+ for (var i = startIndex; i < flatData.length; i++) {
17918
+ if (row.record.uniqueID === flatData[parseInt(i.toString(), 10)].uniqueID &&
17919
+ row.record.childRecords.length > 0) {
17920
+ if (row.action === 'collapse') {
17921
+ var level = flatData[parseInt(i.toString(), 10)].level;
17922
+ var count = this.calculateChildCount(i, level, flatData);
17923
+ // this.parent.pageSettings.totalRecordsCount -= count;
17924
+ uniqueIDCollpaseCollection[row.record.uniqueID] = flatData.splice(i + 1, count);
17925
+ }
17926
+ else {
17927
+ if (uniqueIDCollpaseCollection[row.record.uniqueID] && uniqueIDCollpaseCollection[row.record.uniqueID].length) {
17928
+ flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
17929
+ // this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
17930
+ }
17931
+ else {
17932
+ uniqueIDCollpaseCollection[row.record.uniqueID] = row.record.childRecords;
17933
+ flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
17934
+ // this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
17935
+ }
17936
+ }
17937
+ break;
17938
+ }
17939
+ }
17940
+ }
17941
+ var actionDetails = {
17942
+ result: flatData,
17943
+ row: row.row,
17944
+ action: row.action,
17945
+ record: row.record,
17946
+ count: flatData.length
17947
+ };
17948
+ getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: 'refresh' });
17949
+ };
17950
+ DomVirtualization.prototype.updateCurrentDomVirtualRecords = function (args) {
17951
+ this.startIndex = args.startIndex;
17952
+ this.endIndex = args.endIndex;
17953
+ this.parent.currentDomVirtualRecords = this.parent.virtualDomScrollData.slice(this.startIndex, this.endIndex);
17954
+ };
17955
+ DomVirtualization.prototype.destroy = function () {
17956
+ this.removeEventListener();
17957
+ };
17958
+ return DomVirtualization;
17959
+ }());
17960
+ var DomVirtualTreeExtension = /** @__PURE__ @class */ (function (_super) {
17961
+ __extends$l(DomVirtualTreeExtension, _super);
17962
+ /**
17963
+ * Constructor for DomVirtualTreeExtension
17964
+ *
17965
+ * @param {IGrid} parent - Grid instance (actually TreeGrid)
17966
+ * @param {ServiceLocator} locator - Service locator for dependency injection
17967
+ */
17968
+ function DomVirtualTreeExtension(parent, locator) {
17969
+ var _this = _super.call(this, parent, locator) || this;
17970
+ getValue('parent', _this).off(initialLoad, getValue('instantiateRenderer', _this), _this);
17971
+ getValue('parent', _this).on(initialLoad, _this.instantiateRenderers, _this);
17972
+ return _this;
17973
+ }
17974
+ DomVirtualTreeExtension.prototype.getModuleName = function () {
17975
+ return 'treeDomVirtualization';
17976
+ };
17977
+ DomVirtualTreeExtension.prototype.instantiateRenderers = function () {
17978
+ var rendererFactory = getValue('locator', this).getService('rendererFactory');
17979
+ getValue('addRenderer', rendererFactory)
17980
+ .apply(rendererFactory, [RenderType.Content, new DomVirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
17981
+ };
17982
+ return DomVirtualTreeExtension;
17983
+ }(DomVirtualization$1));
17984
+
17985
+ export { Aggregate, AggregateColumn, AggregateRow, Column, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, ContextMenuItems, DataManipulation, DetailRow, DomVirtualTreeContentRenderer, DomVirtualTreeExtension, DomVirtualization, DomVirtualizationSettings, Edit, EditSettings, ExcelExport, Filter, FilterSettings, Freeze, InfiniteScroll, InfiniteScrollSettings, LoadingIndicator, Logger, Page, PageSettings, PdfExport, Predicate, Render, Reorder, Resize, RowDD, RowDropSettings, SearchSettings, Selection, SelectionSettings, Sort, SortDescriptor, SortSettings, StackedColumn, Toolbar, ToolbarItem, TreeClipboard, TreeGrid, TreeGridColumn, TreeVirtual, TreeVirtualRowModelGenerator, VirtualScroll, actionBegin, actionComplete, actionFailure, ariaColIndex, ariaRowIndex, autoCol, batchAdd, batchCancel, batchDelete, batchEditFormRendered, batchSave, beforeBatchAdd, beforeBatchCancel, beforeBatchDelete, beforeBatchSave, beforeCopy, beforeDataBound, beforeDomVirtualRenderRows, beforeExcelExport, beforePaste, beforePdfExport, beforeStartEdit, beginAdd, beginEdit, cellEdit, cellSave, cellSaved, checkboxChange, collapseActionComplete, collapsed, collapsing, content, contextMenuClick, contextMenuOpen, crudAction, dataBound, dataListener, dataStateChange, destroy, detailDataBound, doubleTap, expanded, expanding, extendArray, findChildrenRecords, findParentRecords, frozenContent, frozenHeader, frozenLeft, frozenRight, getExpandStatus, getParentData, getPlainData, headerContent, hierarchyCheckstateUpdate, indexModifier, isCheckboxcolumn, isCountRequired, isFilterChildHierarchy, isHidden, isOffline, isRemoteData, keyPressed, leftRight, load, localPagedExpandCollapse, movableContent, movableHeader, pagingActions, printGridInit, queryCellInfo, recordDoubleClick, remoteExpand, resizeStop, rowDataBound, rowDeselected, rowDeselecting, rowDrag, rowDragStart, rowDragStartHelper, rowDrop, rowDropped, rowSelected, rowSelecting, rowdraging, rowsAdd, rowsRemove, savePreviousRowPosition, table, toolbarClick, treeGridDetails, updateData, virtualActionArgs, virtualColumnIndex, virtualExpandCollapse };
17445
17986
  //# sourceMappingURL=ej2-treegrid.es5.js.map