@syncfusion/ej2-treegrid 28.2.6 → 29.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +2 -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 +1281 -519
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +1283 -519
  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 +10 -10
  13. package/src/treegrid/actions/batch-edit.js +12 -5
  14. package/src/treegrid/actions/edit.js +12 -12
  15. package/src/treegrid/actions/page.js +1 -1
  16. package/src/treegrid/actions/rowdragdrop.d.ts +21 -1
  17. package/src/treegrid/actions/rowdragdrop.js +252 -48
  18. package/src/treegrid/actions/summary.js +1 -1
  19. package/src/treegrid/actions/virtual-scroll.d.ts +34 -1
  20. package/src/treegrid/actions/virtual-scroll.js +58 -11
  21. package/src/treegrid/base/constant.d.ts +0 -4
  22. package/src/treegrid/base/constant.js +0 -4
  23. package/src/treegrid/base/data.js +47 -46
  24. package/src/treegrid/base/treegrid-model.d.ts +195 -208
  25. package/src/treegrid/base/treegrid.d.ts +598 -411
  26. package/src/treegrid/base/treegrid.js +526 -307
  27. package/src/treegrid/enum.d.ts +77 -80
  28. package/src/treegrid/enum.js +2 -2
  29. package/src/treegrid/models/column.d.ts +122 -177
  30. package/src/treegrid/models/column.js +14 -26
  31. package/src/treegrid/models/edit-settings-model.d.ts +24 -25
  32. package/src/treegrid/models/edit-settings.d.ts +25 -26
  33. package/src/treegrid/models/edit-settings.js +1 -1
  34. package/src/treegrid/models/filter-settings-model.d.ts +41 -49
  35. package/src/treegrid/models/filter-settings.d.ts +43 -51
  36. package/src/treegrid/models/filter-settings.js +2 -2
  37. package/src/treegrid/models/infinite-scroll-settings-model.d.ts +4 -4
  38. package/src/treegrid/models/infinite-scroll-settings.d.ts +4 -4
  39. package/src/treegrid/models/infinite-scroll-settings.js +1 -1
  40. package/src/treegrid/models/loading-indicator-model.d.ts +3 -4
  41. package/src/treegrid/models/loading-indicator.d.ts +4 -4
  42. package/src/treegrid/models/loading-indicator.js +1 -1
  43. package/src/treegrid/models/page-settings-model.d.ts +10 -13
  44. package/src/treegrid/models/page-settings.d.ts +11 -14
  45. package/src/treegrid/models/page-settings.js +1 -1
  46. package/src/treegrid/models/rowdrop-settings-model.d.ts +1 -1
  47. package/src/treegrid/models/rowdrop-settings.d.ts +13 -6
  48. package/src/treegrid/models/rowdrop-settings.js +1 -1
  49. package/src/treegrid/models/search-settings-model.d.ts +13 -11
  50. package/src/treegrid/models/search-settings.d.ts +14 -12
  51. package/src/treegrid/models/search-settings.js +1 -1
  52. package/src/treegrid/models/selection-settings-model.d.ts +18 -29
  53. package/src/treegrid/models/selection-settings.d.ts +18 -29
  54. package/src/treegrid/models/sort-settings-model.d.ts +8 -5
  55. package/src/treegrid/models/sort-settings.d.ts +10 -7
  56. package/src/treegrid/models/sort-settings.js +2 -2
  57. package/src/treegrid/models/summary-model.d.ts +28 -29
  58. package/src/treegrid/models/summary.d.ts +32 -30
  59. package/src/treegrid/models/summary.js +4 -1
  60. package/src/treegrid/models/textwrap-settings-model.d.ts +7 -4
  61. package/src/treegrid/models/textwrap-settings.d.ts +8 -5
  62. package/src/treegrid/models/textwrap-settings.js +1 -1
  63. package/src/treegrid/renderer/render.js +11 -5
  64. package/src/treegrid/renderer/virtual-row-model-generator.js +5 -4
  65. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +277 -0
  66. package/src/treegrid/renderer/virtual-tree-content-render.js +328 -35
  67. package/src/treegrid/utils.d.ts +1 -1
  68. package/styles/bootstrap-lite.css +0 -12
  69. package/styles/bootstrap.css +0 -12
  70. package/styles/bootstrap5-dark-lite.css +1 -1
  71. package/styles/bootstrap5-dark.css +1 -1
  72. package/styles/treegrid/_layout.scss +0 -1
  73. package/styles/treegrid/_material-dark-definition.scss +2 -2
  74. package/styles/treegrid/_material-definition.scss +2 -2
  75. package/styles/treegrid/bootstrap.css +0 -12
  76. package/styles/treegrid/bootstrap5-dark.css +1 -1
  77. package/styles/treegrid/icons/_bootstrap.scss +0 -17
  78. package/styles/treegrid/icons/_bootstrap5.scss +1 -1
  79. package/styles/treegrid/icons/_fabric-dark.scss +1 -1
  80. package/styles/treegrid/icons/_fabric.scss +1 -1
  81. package/styles/treegrid/icons/_fluent2.scss +1 -1
  82. package/styles/treegrid/icons/_fusionnew.scss +1 -0
  83. package/styles/treegrid/icons/_highcontrast-light.scss +1 -1
  84. package/styles/treegrid/icons/_tailwind-dark.scss +2 -2
@@ -11,90 +11,78 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
11
11
  return c > 3 && r && Object.defineProperty(target, key, r), r;
12
12
  };
13
13
  /**
14
- * Represents TreeGrid `Column` model class.
14
+ * Represents the "Column" model class for TreeGrid, defining essential properties and functionalities of a column.
15
15
  */
16
16
  class Column {
17
17
  constructor(options) {
18
18
  /**
19
- * If `allowEditing` set to false, then it disables editing of a particular column.
20
- * By default all columns are editable.
19
+ * Allows or disallows editing of the column. Set to `false` to make a column non-editable.
20
+ * By default, all columns are editable.
21
21
  *
22
22
  * @default true
23
23
  */
24
24
  this.allowEditing = true;
25
25
  /**
26
- * Defines the `IEditCell` object to customize default edit cell.
26
+ * Customization options for the edit cell.
27
27
  *
28
28
  * @default {}
29
29
  */
30
30
  this.edit = {};
31
31
  /**
32
- * If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.
32
+ * When set to `true`, encodes HTML content in headers and cells to prevent HTML injection.
33
33
  *
34
34
  * @default true
35
35
  */
36
36
  this.disableHtmlEncode = true;
37
37
  /**
38
- * If `allowReordering` set to false, then it disables reorder of a particular column.
39
- * By default all columns can be reorder.
38
+ * Disables column reordering if set to `false`. By default, columns can be reordered.
40
39
  *
41
40
  * @default true
42
41
  */
43
42
  this.allowReordering = true;
44
43
  /**
45
- * If `showColumnMenu` set to false, then it disable the column menu of a particular column.
46
- * By default column menu will show for all columns
44
+ * Disables column menu for the column if set to `false`. By default, column menus are enabled for all columns.
47
45
  *
48
46
  * @default true
49
47
  */
50
48
  this.showColumnMenu = true;
51
49
  /**
52
- * If `allowFiltering` set to false, then it disables filtering option and filter bar element of a particular column.
53
- * By default all columns are filterable.
50
+ * Disables filtering for the column if set to `false`. By default, columns are filterable.
54
51
  *
55
52
  * @default true
56
53
  */
57
54
  this.allowFiltering = true;
58
55
  /**
59
- * If `allowSorting` set to false, then it disables sorting option of a particular column.
60
- * By default all columns are sortable.
56
+ * Disables sorting for the column if set to `false`. By default, columns are sortable.
61
57
  *
62
58
  * @default true
63
59
  */
64
60
  this.allowSorting = true;
65
61
  /**
66
- * If `allowResizing` is set to false, it disables resize option of a particular column.
67
- * By default all the columns can be resized.
62
+ * Disables resizing for the column if set to `false`. By default, columns can be resized.
68
63
  *
69
64
  * @default true
70
65
  */
71
66
  this.allowResizing = true;
72
67
  /**
73
- * It is used to customize the default filter options for a specific columns.
74
- * * type - Specifies the filter type as menu.
75
- * * ui - to render custom component for specific column it has following functions.
76
- * * ui.create – It is used for creating custom components.
77
- * * ui.read - It is used for read the value from the component.
78
- * * ui.write - It is used to apply component model as dynamically.
68
+ * Customize default filter options for a specific column, providing types and UI definitions for custom components.
79
69
  *
80
- * @default null
70
+ * @default null
81
71
  */
82
72
  this.filter = {};
83
73
  merge(this, options);
84
74
  }
85
75
  /**
86
- * Update the State changes reflected for TreeGrid columndirective in react platform.
76
+ * Reflects state changes for TreeGrid column directives, particularly in React.
87
77
  *
88
- * @param {Column} column - specifies the column
78
+ * @param {Column} column - The column to update.
89
79
  * @returns {void}
90
80
  * @hidden
91
81
  */
92
82
  setProperties(column) {
93
- //Angular two way binding
94
83
  const keys = Object.keys(column);
95
84
  for (let i = 0; i < keys.length; i++) {
96
85
  this[keys[parseInt(i.toString(), 10)]] = column[keys[parseInt(i.toString(), 10)]];
97
- //Refresh the react columnTemplates on state change
98
86
  if (this.parent && this.parent['isReact'] && keys[parseInt(i.toString(), 10)] === 'template') {
99
87
  const refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
100
88
  this.parent.clipboardModule['treeGridParent'].renderModule[`${refreshReactColumnTemplateByUid}`](this.uid);
@@ -123,7 +111,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
123
111
  return c > 3 && r && Object.defineProperty(target, key, r), r;
124
112
  };
125
113
  /**
126
- * Configures the Loading Indicator of the Tree Grid.
114
+ * Configures the loading indicator for the Tree Grid, allowing you to display a visual indicator during data loading operations to enhance user experience.
127
115
  */
128
116
  class LoadingIndicator extends ChildProperty {
129
117
  }
@@ -138,7 +126,7 @@ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators,
138
126
  return c > 3 && r && Object.defineProperty(target, key, r), r;
139
127
  };
140
128
  /**
141
- * Represents the Tree Grid predicate for the filter column.
129
+ * Represents the filter configuration for a column in the TreeGrid.
142
130
  */
143
131
  class Predicate extends ChildProperty {
144
132
  }
@@ -179,7 +167,7 @@ __decorate$2([
179
167
  Property()
180
168
  ], Predicate.prototype, "isForeignKey", void 0);
181
169
  /**
182
- * Configures the filtering behavior of the TreeGrid.
170
+ * Configures the filtering behavior of the TreeGrid, enabling complex data filtering capabilities.
183
171
  */
184
172
  class FilterSettings extends ChildProperty {
185
173
  }
@@ -215,7 +203,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
215
203
  return c > 3 && r && Object.defineProperty(target, key, r), r;
216
204
  };
217
205
  /**
218
- * Configures the textwrap behavior of the TreeGrid.
206
+ * Configures the text wrapping behavior of the TreeGrid.
219
207
  */
220
208
  class TextWrapSettings extends ChildProperty {
221
209
  }
@@ -495,12 +483,8 @@ const frozenRight = 'frozen-right';
495
483
  /** @hidden */
496
484
  const frozenLeft = 'frozen-left';
497
485
  /** @hidden */
498
- const dataColIndex = 'data-colindex';
499
- /** @hidden */
500
486
  const ariaColIndex = 'aria-colindex';
501
487
  /** @hidden */
502
- const dataRowIndex = 'data-rowindex';
503
- /** @hidden */
504
488
  const ariaRowIndex = 'aria-rowindex';
505
489
  /** @hidden */
506
490
  const actionFailure = 'actionFailure';
@@ -1446,7 +1430,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
1446
1430
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1447
1431
  };
1448
1432
  /**
1449
- * Configures the filtering behavior of the TreeGrid.
1433
+ * Configures the searching behavior of the TreeGrid.
1450
1434
  */
1451
1435
  class SearchSettings extends ChildProperty {
1452
1436
  }
@@ -1630,10 +1614,9 @@ class Render {
1630
1614
  if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
1631
1615
  === 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {
1632
1616
  const container = createElement('div', { className: 'e-treecolumn-container' });
1633
- const emptyExpandIcon = createElement('span', {
1634
- className: 'e-icons e-none',
1635
- styles: 'width: 10px; display: inline-block'
1636
- });
1617
+ const emptyExpandIcon = createElement('span', { className: 'e-icons e-none' });
1618
+ emptyExpandIcon.style.width = '10px';
1619
+ emptyExpandIcon.style.display = 'inline-block';
1637
1620
  for (let n = 0; n < pad; n++) {
1638
1621
  totalIconsWidth += 10;
1639
1622
  container.appendChild(emptyExpandIcon.cloneNode());
@@ -1660,6 +1643,13 @@ class Render {
1660
1643
  }
1661
1644
  else {
1662
1645
  expand = !(!data.expanded || !getExpandStatus(this.parent, data, this.parent.grid.getCurrentViewRecords()));
1646
+ // TicketsID 43483: While Modify Data Expand and Collapse Icon Behavior Changed
1647
+ if (this.parent.editSettings.mode === 'Cell' && !isRemoteData(this.parent)) {
1648
+ const selectedRow = this.parent.flatData.find((item) => item.uniqueID === data.uniqueID);
1649
+ if (!isNullOrUndefined(selectedRow)) {
1650
+ expand = data.expanded !== selectedRow.expanded ? selectedRow.expanded : data.expanded;
1651
+ }
1652
+ }
1663
1653
  }
1664
1654
  addClass([expandIcon], (expand) ? 'e-treegridexpand' : 'e-treegridcollapse');
1665
1655
  totalIconsWidth += 18;
@@ -1777,7 +1767,7 @@ class Render {
1777
1767
  const templateFn = 'templateFn';
1778
1768
  const colindex = args.column.index;
1779
1769
  if (isNullOrUndefined(treeColumn.field)) {
1780
- args.cell.setAttribute('data-colindex', colindex + '');
1770
+ args.cell.setAttribute('aria-colindex', (colindex + 1) + '');
1781
1771
  }
1782
1772
  if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {
1783
1773
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
@@ -2307,115 +2297,116 @@ class DataManipulation {
2307
2297
  rowDetails.record.childRecords = result;
2308
2298
  }
2309
2299
  for (let r = 0; r < result.length; r++) {
2310
- if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'remoteExpand') {
2300
+ const record = result[parseInt(r.toString(), 10)];
2301
+ if (this.parent.enableVirtualization && record[`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'remoteExpand') {
2311
2302
  this.parent[`${remoteExpandedData}`].push(rowDetails.record);
2312
2303
  }
2313
- else if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'collapse') {
2304
+ else if (this.parent.enableVirtualization && record[`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'collapse') {
2314
2305
  for (let i = 0; i < this.parent[`${remoteExpandedData}`].length; i++) {
2315
2306
  if (rowDetails.record[`${this.parent.idMapping}`] === this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2316
2307
  this.parent[`${remoteExpandedData}`].splice(i, 1);
2317
2308
  }
2318
2309
  }
2319
2310
  }
2320
- result[parseInt(r.toString(), 10)].taskData = extend$1({}, result[parseInt(r.toString(), 10)]);
2321
- if (result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`] && this.parent.enableVirtualization && this.parent[`${remoteExpandedData}`].length) {
2311
+ record.taskData = extend$1({}, record);
2312
+ if (record[`${this.parent.parentIdMapping}`] && this.parent.enableVirtualization && this.parent[`${remoteExpandedData}`].length) {
2322
2313
  for (let i = 0; i < this.parent[`${remoteExpandedData}`].length; i++) {
2323
- if (result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`] === this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2324
- result[parseInt(r.toString(), 10)].level = this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${level}`] + 1;
2314
+ if (record[`${this.parent.parentIdMapping}`] === this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2315
+ record.level = this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${level}`] + 1;
2325
2316
  const parentData = this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)];
2326
2317
  delete parentData.childRecords;
2327
- result[parseInt(r.toString(), 10)].parentItem = parentData;
2328
- result[parseInt(r.toString(), 10)].parentUniqueID = parentData.uniqueID;
2318
+ record.parentItem = parentData;
2319
+ record.parentUniqueID = parentData.uniqueID;
2329
2320
  }
2330
2321
  }
2331
2322
  }
2332
2323
  else if (this.parent.enableVirtualization) {
2333
- if ((result[parseInt(r.toString(), 10)][`${this.parent.hasChildMapping}`] ||
2334
- this.parentItems.indexOf(result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`]) !== -1)
2324
+ if ((record[`${this.parent.hasChildMapping}`] ||
2325
+ this.parentItems.indexOf(record[`${this.parent.idMapping}`]) !== -1)
2335
2326
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
2336
- if (isNullOrUndefined(result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`])) {
2337
- result[parseInt(r.toString(), 10)].level = 0;
2327
+ if (isNullOrUndefined(record[`${this.parent.parentIdMapping}`])) {
2328
+ record.level = 0;
2338
2329
  if (rowDetails.action === 'remoteExpand') {
2339
- result[parseInt(r.toString(), 10)].childRecords = [];
2340
- result[parseInt(r.toString(), 10)].childRecords = rowDetails.record.childRecords;
2330
+ record.childRecords = [];
2331
+ record.childRecords = rowDetails.record.childRecords;
2341
2332
  }
2342
2333
  }
2343
2334
  else {
2344
- result[parseInt(r.toString(), 10)].level = rowDetails.record.level;
2335
+ record.level = rowDetails.record.level;
2345
2336
  }
2346
2337
  }
2347
2338
  else {
2348
2339
  const parentData = extend$1({}, rowDetails.record);
2349
2340
  delete parentData.childRecords;
2350
- result[parseInt(r.toString(), 10)].parentItem = parentData;
2351
- result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
2341
+ record.parentItem = parentData;
2342
+ record.parentUniqueID = rowDetails.record.uniqueID;
2352
2343
  }
2353
2344
  }
2354
2345
  else {
2355
- result[parseInt(r.toString(), 10)].level = rowDetails.record.level + 1;
2346
+ record.level = rowDetails.record.level + 1;
2356
2347
  const parentData = extend$1({}, rowDetails.record);
2357
2348
  delete parentData.childRecords;
2358
- result[parseInt(r.toString(), 10)].parentItem = parentData;
2359
- result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
2349
+ record.parentItem = parentData;
2350
+ record.parentUniqueID = rowDetails.record.uniqueID;
2360
2351
  }
2361
- result[parseInt(r.toString(), 10)].index = Math.ceil(Math.random() * 1000);
2362
- result[parseInt(r.toString(), 10)].uniqueID = getUid(this.parent.element.id + '_data_');
2363
- if (rowDetails.record[`${this.parent.idMapping}`] === result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`]) {
2364
- rowDetails.record.uniqueID = result[parseInt(r.toString(), 10)].uniqueID;
2352
+ record.index = Math.ceil(Math.random() * 1000);
2353
+ record.uniqueID = getUid(this.parent.element.id + '_data_');
2354
+ if (rowDetails.record[`${this.parent.idMapping}`] === record[`${this.parent.idMapping}`]) {
2355
+ rowDetails.record.uniqueID = record.uniqueID;
2365
2356
  }
2366
- result[parseInt(r.toString(), 10)].checkboxState = 'uncheck';
2367
- if (this.parent.enableVirtualization && isNullOrUndefined(result[parseInt(r.toString(), 10)].level)) {
2357
+ record.checkboxState = 'uncheck';
2358
+ if (this.parent.enableVirtualization && isNullOrUndefined(record.level)) {
2368
2359
  for (let p = 0; p < this.parent.grid.currentViewData.length; p++) {
2369
- if (this.parent.grid.currentViewData[parseInt(p.toString(), 10)][`${this.parent.idMapping}`] === result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`]) {
2370
- result[parseInt(r.toString(), 10)].level = this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
2360
+ if (this.parent.grid.currentViewData[parseInt(p.toString(), 10)][`${this.parent.idMapping}`] === record[`${this.parent.parentIdMapping}`]) {
2361
+ record.level = this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
2371
2362
  }
2372
2363
  }
2373
2364
  }
2374
- setValue('uniqueIDCollection.' + result[parseInt(r.toString(), 10)].uniqueID, result[parseInt(r.toString(), 10)], this.parent);
2365
+ setValue('uniqueIDCollection.' + record.uniqueID, record, this.parent);
2375
2366
  // delete result[r].parentItem.childRecords;
2376
- if ((result[parseInt(r.toString(), 10)][`${this.parent.hasChildMapping}`] ||
2377
- this.parentItems.indexOf(result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`]) !== -1)
2367
+ if ((record[`${this.parent.hasChildMapping}`] ||
2368
+ this.parentItems.indexOf(record[`${this.parent.idMapping}`]) !== -1)
2378
2369
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
2379
- result[parseInt(r.toString(), 10)].hasChildRecords = true;
2370
+ record.hasChildRecords = true;
2380
2371
  if (this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {
2381
2372
  for (let i = 0; i < this.parent[`${remoteCollapsedData}`].length; i++) {
2382
- if (result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2383
- result[parseInt(r.toString(), 10)].expanded = this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)]['expanded'];
2373
+ if (record[`${this.parent.idMapping}`] === this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2374
+ record.expanded = this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)]['expanded'];
2384
2375
  }
2385
2376
  }
2386
- if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] !== rowDetails.record[`${this.parent.idMapping}`] && result[parseInt(r.toString(), 10)].expanded !== false) {
2387
- result[parseInt(r.toString(), 10)].expanded = true;
2377
+ if (rowDetails.action === 'collapse' && record[`${this.parent.idMapping}`] !== rowDetails.record[`${this.parent.idMapping}`] && record.expanded !== false) {
2378
+ record.expanded = true;
2388
2379
  }
2389
- else if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`]) {
2390
- result[parseInt(r.toString(), 10)].expanded = false;
2380
+ else if (rowDetails.action === 'collapse' && record[`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`]) {
2381
+ record.expanded = false;
2391
2382
  this.parent[`${remoteCollapsedData}`].push(rowDetails.record);
2392
2383
  }
2393
2384
  else if (rowDetails.action === 'remoteExpand') {
2394
2385
  for (let i = 0; i < this.parent.grid.currentViewData.length; i++) {
2395
- if (this.parent.grid.currentViewData[parseInt(i.toString(), 10)][`${this.parent.idMapping}`] === result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`]) {
2386
+ if (this.parent.grid.currentViewData[parseInt(i.toString(), 10)][`${this.parent.idMapping}`] === record[`${this.parent.idMapping}`]) {
2396
2387
  result.splice(r, 1, this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
2397
2388
  }
2398
2389
  }
2399
- if (result[parseInt(r.toString(), 10)][this.parent.idMapping] === rowDetails.record[`${this.parent.idMapping}`]) {
2390
+ if (record[this.parent.idMapping] === rowDetails.record[`${this.parent.idMapping}`]) {
2400
2391
  for (let i = 0; i < this.parent[`${remoteCollapsedData}`].length; i++) {
2401
2392
  if (rowDetails.record[`${this.parent.idMapping}`] === this.parent[`${remoteCollapsedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2402
2393
  this.parent[`${remoteCollapsedData}`].splice(i, 1);
2403
2394
  }
2404
2395
  }
2405
2396
  }
2406
- if (result[parseInt(r.toString(), 10)].expanded !== false) {
2407
- result[parseInt(r.toString(), 10)].expanded = true;
2397
+ if (record.expanded !== false) {
2398
+ record.expanded = true;
2408
2399
  }
2409
2400
  }
2410
2401
  }
2411
- else if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action !== 'collapse') {
2412
- result[parseInt(r.toString(), 10)].expanded = true;
2402
+ else if (this.parent.enableVirtualization && record[`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action !== 'collapse') {
2403
+ record.expanded = true;
2413
2404
  }
2414
2405
  else if (!(this.parent.enableVirtualization && !this.parent.loadChildOnDemand)) {
2415
- result[parseInt(r.toString(), 10)].expanded = false;
2406
+ record.expanded = false;
2416
2407
  }
2417
2408
  }
2418
- datas.splice(inx + r + 1, 0, result[parseInt(r.toString(), 10)]);
2409
+ datas.splice(inx + r + 1, 0, record);
2419
2410
  }
2420
2411
  setValue('result', datas, e);
2421
2412
  setValue('action', 'beforecontentrender', e);
@@ -2756,7 +2747,7 @@ class DataManipulation {
2756
2747
  }
2757
2748
 
2758
2749
  /**
2759
- * Defines Predefined toolbar items.
2750
+ * Defines enumerable toolbar items for programmatic access.
2760
2751
  *
2761
2752
  * @hidden
2762
2753
  */
@@ -2778,7 +2769,7 @@ var ToolbarItem;
2778
2769
  ToolbarItem[ToolbarItem["RowOutdent"] = 13] = "RowOutdent";
2779
2770
  })(ToolbarItem || (ToolbarItem = {}));
2780
2771
  /**
2781
- * Defines predefined contextmenu items.
2772
+ * Enumerates detailed context menu items used for menu configurations.
2782
2773
  *
2783
2774
  * @hidden
2784
2775
  */
@@ -2811,7 +2802,7 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
2811
2802
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2812
2803
  };
2813
2804
  /**
2814
- * Configures the paging behavior of the TreeGrid.
2805
+ * Configures the paging behavior of the TreeGrid, enabling you to manage and display data efficiently across multiple pages.
2815
2806
  */
2816
2807
  class PageSettings extends ChildProperty {
2817
2808
  }
@@ -2847,7 +2838,7 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
2847
2838
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2848
2839
  };
2849
2840
  /**
2850
- * Configures the TreeGrid's aggregate column.
2841
+ * Configures the aggregate column for the TreeGrid.
2851
2842
  */
2852
2843
  class AggregateColumn extends ChildProperty {
2853
2844
  constructor() {
@@ -2934,6 +2925,9 @@ __decorate$7([
2934
2925
  __decorate$7([
2935
2926
  Property()
2936
2927
  ], AggregateColumn.prototype, "customAggregate", void 0);
2928
+ /**
2929
+ * Configures the aggregate rows in the TreeGrid.
2930
+ */
2937
2931
  class AggregateRow extends ChildProperty {
2938
2932
  }
2939
2933
  __decorate$7([
@@ -2950,7 +2944,7 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
2950
2944
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2951
2945
  };
2952
2946
  /**
2953
- * Configures the edit behavior of the TreeGrid.
2947
+ * Configures the edit behavior of the TreeGrid, defining how records can be added, modified, or deleted.
2954
2948
  */
2955
2949
  class EditSettings extends ChildProperty {
2956
2950
  }
@@ -2995,7 +2989,7 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
2995
2989
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2996
2990
  };
2997
2991
  /**
2998
- * Represents the field name and direction of sort column.
2992
+ * Represents the field name and direction of a sort column in the TreeGrid.
2999
2993
  */
3000
2994
  class SortDescriptor extends ChildProperty {
3001
2995
  }
@@ -3006,7 +3000,7 @@ __decorate$9([
3006
3000
  Property()
3007
3001
  ], SortDescriptor.prototype, "direction", void 0);
3008
3002
  /**
3009
- * Configures the sorting behavior of TreeGrid.
3003
+ * Configures the sorting behavior of the TreeGrid.
3010
3004
  */
3011
3005
  class SortSettings extends ChildProperty {
3012
3006
  }
@@ -3424,7 +3418,7 @@ var __decorate$a = (undefined && undefined.__decorate) || function (decorators,
3424
3418
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3425
3419
  };
3426
3420
  /**
3427
- * Configures the infinite scroll behavior of Tree Grid.
3421
+ * Configures the infinite scroll behavior of the Tree Grid.
3428
3422
  */
3429
3423
  class InfiniteScrollSettings extends ChildProperty {
3430
3424
  }
@@ -3505,13 +3499,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3505
3499
  this.grid = new Grid();
3506
3500
  }
3507
3501
  /**
3508
- * Export TreeGrid data to Excel file(.xlsx).
3502
+ * Exports the TreeGrid data to an Excel file (.xlsx).
3509
3503
  *
3510
- * @param {ExcelExportProperties | TreeGridExcelExportProperties} excelExportProperties - Defines the export properties of the Tree Grid.
3511
- * @param {boolean} isMultipleExport - Define to enable multiple export.
3512
- * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.
3513
- * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.
3514
- * @returns {Promise<any>} - Returns promise object of export action
3504
+ * @param {ExcelExportProperties | TreeGridExcelExportProperties} excelExportProperties - The properties used to configure the Excel export.
3505
+ * @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
3506
+ * @param {workbook} workbook - The workbook instance used for multiple exports.
3507
+ * @param {boolean} isBlob - If set to true, the result will be returned as blob data.
3508
+ * @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
3515
3509
  */
3516
3510
  /* eslint-disable */
3517
3511
  excelExport(excelExportProperties, isMultipleExport, workbook, isBlob) {
@@ -3519,13 +3513,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3519
3513
  return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false);
3520
3514
  }
3521
3515
  /**
3522
- * Export TreeGrid data to CSV file.
3516
+ * Exports the TreeGrid data to a CSV file.
3523
3517
  *
3524
- * @param {ExcelExportProperties} excelExportProperties - Defines the export properties of the TreeGrid.
3525
- * @param {boolean} isMultipleExport - Define to enable multiple export.
3526
- * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.
3527
- * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.
3528
- * @returns {Promise<any>} - Returns promise object of export action
3518
+ * @param {ExcelExportProperties} excelExportProperties - The properties used to configure the CSV export.
3519
+ * @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
3520
+ * @param {workbook} workbook - The workbook instance used for multiple exports.
3521
+ * @param {boolean} isBlob - If set to true, the result will be returned as blob data.
3522
+ * @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
3529
3523
  */
3530
3524
  /* eslint-disable */
3531
3525
  csvExport(excelExportProperties, isMultipleExport, workbook, isBlob) {
@@ -3533,21 +3527,21 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3533
3527
  return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true);
3534
3528
  }
3535
3529
  /**
3536
- * Export TreeGrid data to PDF document.
3530
+ * Exports the TreeGrid data to a PDF document.
3537
3531
  *
3538
- * @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties - Defines the export properties of the Tree Grid.
3539
- * @param {boolean} isMultipleExport - Define to enable multiple export.
3540
- * @param {Object} pdfDoc - Defined the Pdf Document if multiple export is enabled.
3541
- * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.
3542
- * @returns {Promise<any>} - Returns promise object of export action
3532
+ * @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties - The properties used to configure the PDF export.
3533
+ * @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
3534
+ * @param {Object} pdfDoc - The PDF document instance used for multiple exports.
3535
+ * @param {boolean} isBlob - If set to true, the result will be returned as blob data.
3536
+ * @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
3543
3537
  */
3544
3538
  pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
3545
3539
  return this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
3546
3540
  }
3547
3541
  /**
3548
- * Sends a post request to export tree grid to excel file in server side.
3542
+ * Sends a POST request to export the TreeGrid to an Excel file on the server side.
3549
3543
  *
3550
- * @param {string} url - Pass URL for server side excel export action.
3544
+ * @param {string} url - The URL for the server-side Excel export action.
3551
3545
  * @returns {void}
3552
3546
  */
3553
3547
  serverExcelExport(url) {
@@ -3555,9 +3549,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3555
3549
  this.exportTreeGrid(url);
3556
3550
  }
3557
3551
  /**
3558
- * Sends a post request to export tree grid to pdf file in server side.
3552
+ * Sends a POST request to export the TreeGrid to a PDF document on the server side.
3559
3553
  *
3560
- * @param {string} url - Pass URL for server-side pdf export action.
3554
+ * @param {string} url - The URL for the server-side PDF export action.
3561
3555
  * @returns {void}
3562
3556
  */
3563
3557
  serverPdfExport(url) {
@@ -3565,9 +3559,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3565
3559
  this.exportTreeGrid(url);
3566
3560
  }
3567
3561
  /**
3568
- * Sends a Post request to export Tree Grid to CSV file in server side.
3562
+ * Sends a POST request to export the TreeGrid to a CSV file on the server side.
3569
3563
  *
3570
- * @param {string} url - Pass URL for server-side csv export action.
3564
+ * @param {string} url - The URL for the server-side CSV export action.
3571
3565
  * @returns {void}
3572
3566
  */
3573
3567
  serverCsvExport(url) {
@@ -3595,7 +3589,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3595
3589
  treeGridModel.searchSettings.fields = queries.search && queries.search[0]['fields'] || [];
3596
3590
  treeGridModel.sortSettings.columns = queries.sorted;
3597
3591
  treeGridModel.columns = this.setHeaderText(treeGridModel.columns, include);
3598
- const form = this.createElement('form', { id: 'ExportForm', styles: 'display:none;' });
3592
+ const form = this.createElement('form', { id: 'ExportForm' });
3593
+ form.style.display = 'none';
3599
3594
  const treeGridInput = this.createElement('input', { id: 'treeGridInput', attrs: { name: 'treeGridModel' } });
3600
3595
  treeGridInput.value = JSON.stringify(treeGridModel);
3601
3596
  form.method = 'POST';
@@ -3686,11 +3681,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3686
3681
  }
3687
3682
  }
3688
3683
  /**
3689
- * Sorts a column with the given options.
3684
+ * Sorts a column with the specified options.
3690
3685
  *
3691
- * @param {string} columnName - Defines the column name to be sorted.
3692
- * @param {SortDirection} direction - Defines the direction of sorting field.
3693
- * @param {boolean} isMultiSort - Specifies whether the previous sorted columns are to be maintained.
3686
+ * @param {string} columnName - The name of the column to be sorted.
3687
+ * @param {SortDirection} direction - The direction of the sorting operation.
3688
+ * @param {boolean} isMultiSort - Specifies whether previous sorted columns should be maintained during sorting.
3694
3689
  * @returns {void}
3695
3690
  */
3696
3691
  sortByColumn(columnName, direction, isMultiSort) {
@@ -3699,7 +3694,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3699
3694
  }
3700
3695
  }
3701
3696
  /**
3702
- * Clears all the sorted columns of the TreeGrid.
3697
+ * Clears all the sorted columns in the TreeGrid.
3703
3698
  *
3704
3699
  * @returns {void}
3705
3700
  */
@@ -3709,9 +3704,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3709
3704
  }
3710
3705
  }
3711
3706
  /**
3712
- * Remove sorted column by field name.
3707
+ * Removes the sorted state from a column specified by the field name.
3713
3708
  *
3714
- * @param {string} field - Defines the column field name to remove sort.
3709
+ * @param {string} field - The field name of the column from which the sort state should be removed.
3715
3710
  * @returns {void}
3716
3711
  * @hidden
3717
3712
  */
@@ -3721,36 +3716,32 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3721
3716
  }
3722
3717
  }
3723
3718
  /**
3724
- * Searches TreeGrid records using the given key.
3725
- * You can customize the default search option by using the
3726
- * [`searchSettings`](./#searchsettings/).
3719
+ * Searches for TreeGrid records using a specified search string.
3720
+ * Customize the search behavior through the [searchSettings](./#searchsettings/).
3727
3721
  *
3728
- * @param {string} searchString - Defines the key.
3722
+ * @param {string} searchString - The string used as the search key.
3729
3723
  * @returns {void}
3730
3724
  */
3731
3725
  search(searchString) {
3732
3726
  this.grid.search(searchString);
3733
3727
  }
3734
3728
  /**
3735
- * Changes the column width to automatically fit its content to ensure that the width shows the content without wrapping/hiding.
3736
- * > * This method ignores the hidden columns.
3737
- * > * Uses the `autoFitColumns` method in the `dataBound` event to resize at initial rendering.
3729
+ * Adjusts column widths to fit their content, ensuring content is displayed without wrapping or truncation.
3730
+ * - Hidden columns are ignored by this method.
3731
+ * - Use the `autoFitColumns` method during the `dataBound` event for initial rendering.
3738
3732
  *
3739
- * @param {string |string[]} fieldNames - Defines the column names.
3733
+ * @param {string | string[]} fieldNames - The name(s) of the column(s) to be auto-fitted.
3740
3734
  * @returns {void}
3741
- *
3742
- *
3743
- *
3744
3735
  */
3745
3736
  autoFitColumns(fieldNames) {
3746
3737
  this.resizeModule.autoFitColumns(fieldNames);
3747
3738
  this.updateColumnModel();
3748
3739
  }
3749
3740
  /**
3750
- * Changes the TreeGrid column positions by field names.
3741
+ * Reorders TreeGrid columns by specifying their field names.
3751
3742
  *
3752
- * @param {string} fromFName - Defines the origin field name.
3753
- * @param {string} toFName - Defines the destination field name.
3743
+ * @param {string | string[]} fromFName - The field name(s) of the column(s) to be moved.
3744
+ * @param {string} toFName - The destination field name to place the moved columns.
3754
3745
  * @returns {void}
3755
3746
  */
3756
3747
  reorderColumns(fromFName, toFName) {
@@ -3773,9 +3764,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3773
3764
  }
3774
3765
  }
3775
3766
  /**
3776
- * By default, prints all the pages of the TreeGrid and hides the pager.
3777
- * > You can customize print options using the
3778
- * [`printMode`](./#printmode).
3767
+ * Prints all the pages of the TreeGrid and hides the pager by default.
3768
+ * Customize print options using the [printMode](./#printmode).
3779
3769
  *
3780
3770
  * @returns {void}
3781
3771
  */
@@ -3919,7 +3909,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3919
3909
  this.isSelfReference = !isNullOrUndefined(this.parentIdMapping);
3920
3910
  }
3921
3911
  /**
3922
- * Binding events to the element while component creation.
3912
+ * Attaches event handlers to the necessary elements during the component's initialization.
3923
3913
  *
3924
3914
  * @hidden
3925
3915
  * @returns {void}
@@ -3937,9 +3927,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3937
3927
  }
3938
3928
  }
3939
3929
  /**
3940
- * To provide the array of modules needed for component rendering
3930
+ * Provides a list of the modules that are required for rendering the TreeGrid component.
3941
3931
  *
3942
- * @returns {ModuleDeclaration[]} - Returns TreeGrid modules collection
3932
+ * This method is essential for ensuring that all dependent modules are loaded and available
3933
+ * during the component's lifecycle, enabling full functionality.
3934
+ *
3935
+ * @returns {ModuleDeclaration[]} - Returns an array of the required TreeGrid module declarations.
3943
3936
  * @hidden
3944
3937
  */
3945
3938
  requiredModules() {
@@ -4253,7 +4246,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4253
4246
  if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
4254
4247
  failureCases.push('Virtual scrolling is not compatible with the detail template');
4255
4248
  }
4256
- if ((this.frozenColumns > 0 || this.columnModel.filter((col) => col.isFrozen) || this.frozenRows > 0)
4249
+ if ((this.frozenColumns > 0 || this.frozenRows > 0 || this.columnModel.filter((col) => col.isFrozen))
4257
4250
  && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
4258
4251
  failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
4259
4252
  }
@@ -4263,9 +4256,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4263
4256
  if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
4264
4257
  failureCases.push('Selection is not supported in RowTemplate');
4265
4258
  }
4266
- if (this.treeColumnIndex < 0) {
4267
- failureCases.push('For showing tree structure it is must to set the TreeColumnIndex value.');
4268
- }
4269
4259
  if (this.treeColumnIndex >= this.columns.length) {
4270
4260
  failureCases.push('TreeColumnIndex value should not exceed the total column count.');
4271
4261
  }
@@ -4291,9 +4281,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4291
4281
  failureCases.push('Only one column can have the ShowCheckbox option enabled.');
4292
4282
  }
4293
4283
  }
4294
- const alignColumn = this.columnModel.filter((col) => col.textAlign === 'Right' && col.field === this.columnModel[this.treeColumnIndex].field);
4295
- if (alignColumn.length !== 0) {
4296
- failureCases.push('TextAlign right for the tree column is not applicable.');
4284
+ let alignColumn;
4285
+ if (this.treeColumnIndex !== null && this.treeColumnIndex !== -1) {
4286
+ alignColumn = this.columnModel.filter((col) => col.textAlign === 'Right' && col.field === this.columnModel[this.treeColumnIndex].field);
4287
+ if (alignColumn.length !== 0) {
4288
+ failureCases.push('TextAlign right for the tree column is not applicable.');
4289
+ }
4297
4290
  }
4298
4291
  if (failureCases.length > 0) {
4299
4292
  const failureEventArgs = {
@@ -4328,7 +4321,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4328
4321
  this.flatData = data;
4329
4322
  this.flatData.filter((e) => {
4330
4323
  setValue('uniqueIDCollection.' + e.uniqueID, e, this);
4331
- if (e.level === 0) {
4324
+ if (e.level === 0 && !this.parentData.some((record) => record.uniqueID === e.uniqueID)) {
4332
4325
  this.parentData.push(e);
4333
4326
  }
4334
4327
  });
@@ -4461,14 +4454,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4461
4454
  this.trigger(rowDeselecting, args);
4462
4455
  };
4463
4456
  this.grid.rowSelected = (args) => {
4464
- if (this.enableVirtualization && args.isHeaderCheckboxClicked &&
4465
- this.grid.currentViewData.length !== this.grid.selectionModule.selectedRowIndexes.length) {
4466
- const updateRowSelection = 'updateRowSelection';
4467
- for (let i = 0; i < this.getRows().length; i++) {
4468
- if (this.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
4469
- this.grid.selectionModule[`${updateRowSelection}`](this.getRows()[parseInt(i.toString(), 10)], this.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
4470
- }
4471
- }
4457
+ if (this.enableVirtualization) {
4458
+ this.virtualScrollModule.updateSelection(args);
4472
4459
  }
4473
4460
  this.selectedRowIndex = this.grid.selectedRowIndex;
4474
4461
  this.notify(rowSelected, args);
@@ -5200,6 +5187,14 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5200
5187
  }
5201
5188
  return gridColumnCollection;
5202
5189
  }
5190
+ lastRowCellBorderUpdated() {
5191
+ const rows = this.getContentTable().querySelectorAll('tr.e-row');
5192
+ const visibleRows = Array.from(rows).filter((row) => !row.classList.contains('e-childrow-hidden'));
5193
+ if (visibleRows.length > 0) {
5194
+ const lastVisibleRow = visibleRows[visibleRows.length - 1];
5195
+ this.lastRowBorder(lastVisibleRow, true);
5196
+ }
5197
+ }
5203
5198
  /**
5204
5199
  * Called internally if any of the property value changed.
5205
5200
  *
@@ -5424,7 +5419,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5424
5419
  this.grid.refreshColumns();
5425
5420
  }
5426
5421
  /**
5427
- * Destroys the component (detaches/removes all event handlers, attributes, classes, and empties the component element).
5422
+ * Destroys the TreeGrid component by detaching event handlers,
5423
+ * removing attributes and classes, and clearing the component's DOM elements.
5424
+ *
5425
+ * This method ensures that all resources used by the TreeGrid are properly released
5426
+ * and the component is cleaned up from the DOM to prevent memory leaks.
5428
5427
  *
5429
5428
  * @method destroy
5430
5429
  * @returns {void}
@@ -5462,7 +5461,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5462
5461
  this.grid = null;
5463
5462
  }
5464
5463
  /**
5465
- * Update the TreeGrid model
5464
+ * Updates the TreeGrid model and ensures that the underlying Grid's data model is in sync with TreeGrid.
5465
+ * This method binds current data and settings to the TreeGrid.
5466
5466
  *
5467
5467
  * @method dataBind
5468
5468
  * @returns {void}
@@ -5481,7 +5481,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5481
5481
  this.grid.dataBind();
5482
5482
  }
5483
5483
  /**
5484
- * Get the properties to be maintained in the persisted state.
5484
+ * Retrieves the properties of the TreeGrid that should be retained and persisted between sessions.
5485
+ *
5486
+ * The method ensures that user preferences and important settings like paging, sorting, filtering,
5487
+ * column configurations, etc., are preserved and can be restored when the component is re-initialized.
5485
5488
  *
5486
5489
  * @returns {string} - Returns persist properties details
5487
5490
  * @hidden
@@ -5572,7 +5575,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5572
5575
  }
5573
5576
  }
5574
5577
  /**
5575
- * Returns TreeGrid rows
5578
+ * Retrieves all the TreeGrid row elements.
5579
+ *
5580
+ * This method is useful for accessing the HTML representation of the rows for further manipulation or inspection.
5576
5581
  *
5577
5582
  * @returns {HTMLTableRowElement[]} - Returns row elements collection
5578
5583
  */
@@ -5580,7 +5585,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5580
5585
  return this.grid.getRows();
5581
5586
  }
5582
5587
  /**
5583
- * Gets the pager of the TreeGrid.
5588
+ * Obtains the pager element of the TreeGrid.
5589
+ *
5590
+ * The pager enables navigation between pages when the TreeGrid displays paginated data.
5584
5591
  *
5585
5592
  * @returns {Element} - Returns pager element
5586
5593
  */
@@ -5588,12 +5595,14 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5588
5595
  return this.grid.getPager(); //get element from pager
5589
5596
  }
5590
5597
  /**
5591
- * Adds a new record to the TreeGrid. Without passing parameters, it adds empty rows.
5592
- * > `editSettings.allowEditing` should be true.
5598
+ * Adds a new record to the TreeGrid at the specified position or default location.
5599
+ *
5600
+ * @param {Object} data - Object containing the data for the new record. If omitted, an empty row is added.
5601
+ * @param {number} index - The index at which the new row should be added.
5602
+ * @param {RowPosition} position - Specifies the position of the new row (e.g., before, after or child).
5603
+ *
5604
+ * > Requires `editSettings.allowAdding` to be true.
5593
5605
  *
5594
- * @param {Object} data - Defines the new add record data.
5595
- * @param {number} index - Defines the row index to be added.
5596
- * @param {RowPosition} position - Defines the new row position to be added.
5597
5606
  * @returns {void}
5598
5607
  */
5599
5608
  addRecord(data, index, position) {
@@ -5604,7 +5613,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5604
5613
  }
5605
5614
  }
5606
5615
  /**
5607
- * Cancels edited state.
5616
+ * Cancels the current edit operation on the TreeGrid.
5617
+ *
5618
+ * This method discards changes made to the row and exits the edit mode without saving.
5608
5619
  *
5609
5620
  * @returns {void}
5610
5621
  */
@@ -5614,7 +5625,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5614
5625
  }
5615
5626
  }
5616
5627
  /**
5617
- * Saves the cell that is currently edited. It does not save the value to the DataSource.
5628
+ * Saves the current cell value changes without committing to the data source.
5629
+ *
5630
+ * This operation persists the changes in the UI but not in the underlying data model.
5618
5631
  *
5619
5632
  * @returns {void}
5620
5633
  */
@@ -5624,7 +5637,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5624
5637
  }
5625
5638
  }
5626
5639
  /**
5627
- * To update the specified cell by given value without changing into edited state.
5640
+ * Updates the value of a specific cell directly, bypassing the edit mode.
5641
+ *
5642
+ * This method provides a quick way to update the UI and data without user interaction.
5628
5643
  *
5629
5644
  * @param {number} rowIndex Defines the row index.
5630
5645
  * @param {string} field Defines the column field.
@@ -5637,10 +5652,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5637
5652
  }
5638
5653
  }
5639
5654
  /**
5640
- * To update the specified row by given values without changing into edited state.
5655
+ * Updates a specific row with given values directly, skipping the edit state.
5641
5656
  *
5642
- * @param {number} index Defines the row index.
5643
- * @param {Object} data Defines the data object to be updated.
5657
+ * This method allows for bulk updates of row data programmatically.
5658
+ *
5659
+ * @param {number} index - The index of the row to update.
5660
+ * @param {Object} data - The data object containing updated field values.
5644
5661
  * @returns {void}
5645
5662
  */
5646
5663
  updateRow(index, data) {
@@ -5656,12 +5673,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5656
5673
  }
5657
5674
  }
5658
5675
  /**
5659
- * Delete a record with Given options. If fieldName and data is not given then TreeGrid will delete the selected record.
5660
- * > `editSettings.allowDeleting` should be true.
5676
+ * Deletes a record based on specified criteria or the selected record if none specified.
5661
5677
  *
5662
- * @param {string} fieldName - Defines the primary key field, 'Name of the column'.
5663
- * @param {Object} data - Defines the JSON data of the record to be deleted.
5678
+ * @param {string} fieldName - The name of the primary key field.
5679
+ * @param {Object} data - The data object representing the record to delete.
5664
5680
  * @returns {void}
5681
+ *
5682
+ * > Requires `editSettings.allowDeleting` to be true.
5665
5683
  */
5666
5684
  deleteRecord(fieldName, data) {
5667
5685
  if ((isNullOrUndefined(fieldName) && (isNullOrUndefined(data)) || (this.getSelectedRecords().length <= 0))) {
@@ -5673,9 +5691,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5673
5691
  }
5674
5692
  }
5675
5693
  /**
5676
- * To edit any particular row by TR element.
5694
+ * Initiates editing for a specific row using its HTML element.
5677
5695
  *
5678
- * @param {HTMLTableRowElement} row - Defines the table row to be edited.
5696
+ * This allows for manual control of which row enters edit mode through the UI.
5697
+ *
5698
+ * @param {HTMLTableRowElement} row - The table row element to enter into edit mode.
5679
5699
  * @returns {void}
5680
5700
  */
5681
5701
  startEdit(row) {
@@ -5684,10 +5704,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5684
5704
  }
5685
5705
  }
5686
5706
  /**
5687
- * To edit any particular cell using row index and cell index.
5707
+ * Begins editing of a specific cell using row and field indices.
5708
+ *
5709
+ * Customers can programmatically specify which cell to edit without user input.
5688
5710
  *
5689
- * @param {number} rowIndex - Defines row index to edit a particular cell.
5690
- * @param {string} field - Defines the field name of the column to perform cell edit.
5711
+ * @param {number} rowIndex - The index of the row containing the cell.
5712
+ * @param {string} field - The field name of the cell to edit.
5691
5713
  * @returns {void}
5692
5714
  */
5693
5715
  editCell(rowIndex, field) {
@@ -5696,10 +5718,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5696
5718
  }
5697
5719
  }
5698
5720
  /**
5699
- * Enables or disables ToolBar items.
5721
+ * Enables or disables specified ToolBar items within the TreeGrid.
5700
5722
  *
5701
- * @param {string[]} items - Defines the collection of itemID of ToolBar items.
5702
- * @param {boolean} isEnable - Defines the items to be enabled or disabled.
5723
+ * This facilitates dynamic control of toolbar actions based on application logic.
5724
+ *
5725
+ * @param {string[]} items - Array of ToolBar item IDs to enable or disable.
5726
+ * @param {boolean} isEnable - Boolean flag to determine whether to enable (true) or disable (false) items.
5703
5727
  * @returns {void}
5704
5728
  */
5705
5729
  enableToolbarItems(items, isEnable) {
@@ -5708,7 +5732,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5708
5732
  }
5709
5733
  }
5710
5734
  /**
5711
- * If TreeGrid is in editable state, you can save a record by invoking endEdit.
5735
+ * Commits the edits made to a record in edit mode, updating the data source.
5736
+ *
5737
+ * Use this method to finalize changes for rows in edit mode, ensuring persistence.
5712
5738
  *
5713
5739
  * @returns {void}
5714
5740
  */
@@ -5718,10 +5744,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5718
5744
  }
5719
5745
  }
5720
5746
  /**
5721
- * Column chooser can be displayed on screen by given position(X and Y axis).
5747
+ * Displays the column chooser at a specified screen position.
5722
5748
  *
5723
- * @param {number} x - Defines the X axis.
5724
- * @param {number} y - Defines the Y axis.
5749
+ * Useful for customizing the visibility of columns interactively via the UI.
5750
+ *
5751
+ * @param {number} x - The X-axis position of the column chooser.
5752
+ * @param {number} y - The Y-axis position of the column chooser.
5725
5753
  * @returns {void}
5726
5754
  */
5727
5755
  openColumnChooser(x, y) {
@@ -5730,9 +5758,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5730
5758
  }
5731
5759
  }
5732
5760
  /**
5733
- * Delete any visible row by TR element.
5761
+ * Deletes a visible row from the TreeGrid using its HTML element.
5762
+ *
5763
+ * Apply this method when handling row deletions through DOM manipulations.
5734
5764
  *
5735
- * @param {HTMLTableRowElement} tr - Defines the table row element.
5765
+ * @param {HTMLTableRowElement} tr - The table row element to remove.
5736
5766
  * @returns {void}
5737
5767
  */
5738
5768
  deleteRow(tr) {
@@ -5741,20 +5771,23 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5741
5771
  }
5742
5772
  }
5743
5773
  /**
5744
- * Get the names of the primary key columns of the TreeGrid.
5774
+ * Retrieves the primary key field names used in the TreeGrid.
5775
+ *
5776
+ * This information is crucial for identifying and manipulating unique rows.
5745
5777
  *
5746
- * @returns {string[]} - Returns primary key collection
5778
+ * @returns {string[]} - Returns an array of primary key field names.
5747
5779
  */
5748
5780
  getPrimaryKeyFieldNames() {
5749
5781
  return this.grid.getPrimaryKeyFieldNames();
5750
5782
  }
5751
5783
  /**
5752
- * Updates particular cell value based on the given primary key value.
5753
- * > Primary key column must be specified using `columns.isPrimaryKey` property.
5784
+ * Updates the value of a specific cell using its primary key for identification.
5754
5785
  *
5755
- * @param {string| number} key - Specifies the PrimaryKey value of dataSource.
5756
- * @param {string } field - Specifies the field name which you want to update.
5757
- * @param {string | number | boolean | Date} value - To update new value for the particular cell.
5786
+ * Useful for targeted updates that leverage unique identifiers to ensure accuracy.
5787
+ *
5788
+ * @param {string| number} key - The primary key value of the row containing the cell.
5789
+ * @param {string} field - The field name of the cell to update.
5790
+ * @param {string | number | boolean | Date} value - The new value to assign to the specified cell.
5758
5791
  * @returns {void}
5759
5792
  */
5760
5793
  setCellValue(key, field, value) {
@@ -5764,11 +5797,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5764
5797
  editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
5765
5798
  }
5766
5799
  /**
5767
- * Updates and refresh the particular row values based on the given primary key value.
5768
- * > Primary key column must be specified using `columns.isPrimaryKey` property.
5800
+ * Updates the data for a specific row identified by its primary key and refreshes the display.
5801
+ *
5802
+ * Important for keeping the displayed data consistent with the source database or dataset.
5769
5803
  *
5770
- * @param {string| number} key - Specifies the PrimaryKey value of dataSource.
5771
- * @param {Object} rowData - To update new data for the particular row.
5804
+ * @param {string| number} key - The primary key value of the row to update.
5805
+ * @param {Object} rowData - The new data to apply to the row.
5772
5806
  * @returns {void}
5773
5807
  */
5774
5808
  setRowData(key, rowData) {
@@ -5806,9 +5840,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5806
5840
  }
5807
5841
  }
5808
5842
  /**
5809
- * Navigates to the specified target page.
5843
+ * Navigates to a specified page number within the TreeGrid pagination.
5810
5844
  *
5811
- * @param {number} pageNo - Defines the page number to navigate.
5845
+ * This can be used to programmatically change the page being viewed,
5846
+ * allowing for scripted navigation through data.
5847
+ *
5848
+ * @param {number} pageNo - The page number to navigate to. Must be within valid page range.
5812
5849
  * @returns {void}
5813
5850
  */
5814
5851
  goToPage(pageNo) {
@@ -5817,9 +5854,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5817
5854
  }
5818
5855
  }
5819
5856
  /**
5820
- * Defines the text of external message.
5857
+ * Updates the external message displayed within the pager component.
5821
5858
  *
5822
- * @param {string} message - Defines the message to update.
5859
+ * This is useful for showing custom messages or additional information
5860
+ * related to the data set or pagination status.
5861
+ *
5862
+ * @param {string} message - The custom message to display in the pager.
5823
5863
  * @returns {void}
5824
5864
  */
5825
5865
  updateExternalMessage(message) {
@@ -5828,20 +5868,26 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5828
5868
  }
5829
5869
  }
5830
5870
  /**
5831
- * Gets a cell by row and column index.
5871
+ * Retrieves a cell element based on its row and column indices in the TreeGrid.
5832
5872
  *
5833
- * @param {number} rowIndex - Specifies the row index.
5834
- * @param {number} columnIndex - Specifies the column index.
5835
- * @returns {Element} - Returns cell element in grid content
5873
+ * This method is helpful for accessing cell-level elements for custom
5874
+ * operations or styling.
5875
+ *
5876
+ * @param {number} rowIndex - The index of the row containing the cell.
5877
+ * @param {number} columnIndex - The index of the column containing the cell.
5878
+ * @returns {Element} - Returns the HTML element of the specified cell.
5836
5879
  */
5837
5880
  getCellFromIndex(rowIndex, columnIndex) {
5838
5881
  return this.grid.getCellFromIndex(rowIndex, columnIndex);
5839
5882
  }
5840
5883
  /**
5841
- * Gets a Column by column name.
5884
+ * Retrieves a column object by the column's field name.
5885
+ *
5886
+ * This is typically used for obtaining the details of a column for
5887
+ * configuration or data manipulation purposes.
5842
5888
  *
5843
- * @param {string} field - Specifies the column name.
5844
- * @returns {Column} - Returns tree grid column
5889
+ * @param {string} field - The field name of the column.
5890
+ * @returns {Column} - Returns the column object corresponding to the field.
5845
5891
  */
5846
5892
  getColumnByField(field) {
5847
5893
  return iterateArrayOrObject(this.columnModel, (item) => {
@@ -5852,10 +5898,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5852
5898
  })[0];
5853
5899
  }
5854
5900
  /**
5855
- * Gets a column by UID.
5901
+ * Fetches a column object using the column's unique identifier (UID).
5856
5902
  *
5857
- * @param {string} uid - Specifies the column UID.
5858
- * @returns {Column} - Returns tree grid column
5903
+ * Useful in scenarios where columns do not have unique field names but
5904
+ * are uniquely identifiable via UID.
5905
+ *
5906
+ * @param {string} uid - The unique identifier for the column.
5907
+ * @returns {Column} - Returns the column object for the given UID.
5859
5908
  */
5860
5909
  getColumnByUid(uid) {
5861
5910
  let Columns = this.initialRender ? this.grid.columns : this.columns;
@@ -5871,34 +5920,45 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5871
5920
  })[0];
5872
5921
  }
5873
5922
  /**
5874
- * Gets the collection of column fields.
5923
+ * Retrieves the names of all column fields in the TreeGrid.
5924
+ *
5925
+ * This method provides a list of field names useful for dynamic operations
5926
+ * or configuration where fields need to be enumerated or manipulated.
5875
5927
  *
5876
- * @returns {string[]} - Returns column field name as collection
5928
+ * @returns {string[]} - Returns an array of column field names.
5877
5929
  */
5878
5930
  getColumnFieldNames() {
5879
5931
  return this.grid.getColumnFieldNames();
5880
5932
  }
5881
5933
  /**
5882
- * Gets the footer div of the TreeGrid.
5934
+ * Retrieves the footer content element of the TreeGrid, usually for styling or custom manipulation.
5883
5935
  *
5884
- * @returns {Element} - Returns footer content div element
5936
+ * This can be used to access the footer for adding custom functionality
5937
+ * or styling purposes to enhance user interaction at the bottom of the grid.
5938
+ *
5939
+ * @returns {Element} - Returns the footer content HTML element.
5885
5940
  */
5886
5941
  getFooterContent() {
5887
5942
  return this.grid.getFooterContent();
5888
5943
  }
5889
5944
  /**
5890
- * Gets the footer table element of the TreeGrid.
5945
+ * Acquires the footer table element of the TreeGrid for layout management.
5946
+ *
5947
+ * Useful for manipulating the table's structure or style beneath the grid content.
5891
5948
  *
5892
- * @returns {Element} - Returns footer content table element
5949
+ * @returns {Element} - Returns the footer table HTML element.
5893
5950
  */
5894
5951
  getFooterContentTable() {
5895
5952
  return this.grid.getFooterContentTable();
5896
5953
  }
5897
5954
  /**
5898
- * Shows a column by its column name.
5955
+ * Shows one or more columns based on the specified column names.
5956
+ *
5957
+ * This is useful for dynamically adjusting the visibility of columns
5958
+ * based on user actions or application logic.
5899
5959
  *
5900
- * @param {string|string[]} keys - Defines a single or collection of column names.
5901
- * @param {string} showBy - Defines the column key either as field name or header text.
5960
+ * @param {string|string[]} keys - A single column name or an array of column names to show.
5961
+ * @param {string} showBy - Key to determine visibility either as field name or header text.
5902
5962
  * @returns {void}
5903
5963
  */
5904
5964
  showColumns(keys, showBy) {
@@ -5906,10 +5966,13 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5906
5966
  this.updateColumnModel();
5907
5967
  }
5908
5968
  /**
5909
- * Hides a column by column name.
5969
+ * Hides one or more columns based on the specified column names.
5910
5970
  *
5911
- * @param {string|string[]} keys - Defines a single or collection of column names.
5912
- * @param {string} hideBy - Defines the column key either as field name or header text.
5971
+ * Utilized to dynamically reduce the visibility of columns based on
5972
+ * user roles or preferences.
5973
+ *
5974
+ * @param {string|string[]} keys - A single column name or an array of column names to hide.
5975
+ * @param {string} hideBy - Key to evaluate columns either as field name or header text.
5913
5976
  * @returns {void}
5914
5977
  */
5915
5978
  hideColumns(keys, hideBy) {
@@ -5917,37 +5980,48 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5917
5980
  this.updateColumnModel();
5918
5981
  }
5919
5982
  /**
5920
- * Gets a column header by column name.
5983
+ * Retrieves a column header element based on the field name of the column.
5984
+ *
5985
+ * This method helps to directly manipulate headers, such as applying custom styles.
5921
5986
  *
5922
- * @param {string} field - Specifies the column name.
5923
- * @returns {Element} - Returns column header element
5987
+ * @param {string} field - The field name of the desired column.
5988
+ * @returns {Element} - Returns the HTML element of the column header.
5924
5989
  */
5925
5990
  getColumnHeaderByField(field) {
5926
5991
  return this.grid.getColumnHeaderByField(field);
5927
5992
  }
5928
5993
  /**
5929
- * Gets a column header by column index.
5994
+ * Acquires the column header element using the column's index.
5930
5995
  *
5931
- * @param {number} index - Specifies the column index.
5932
- * @returns {Element} - Returns column header element
5996
+ * Suitable for situations where direct column index is available
5997
+ * and header access is needed for operations.
5998
+ *
5999
+ * @param {number} index - The index of the column.
6000
+ * @returns {Element} - Returns the HTML element of the specified column header.
5933
6001
  */
5934
6002
  getColumnHeaderByIndex(index) {
5935
6003
  return this.grid.getColumnHeaderByIndex(index);
5936
6004
  }
5937
6005
  /**
5938
- * Gets a column header by UID.
6006
+ * Retrieves a column header element utilizing the column's UID.
5939
6007
  *
5940
- * @param {string} uid - Specifies the column uid.
5941
- * @returns {Element} - Returns column header element
6008
+ * Useful for precision access to header elements when UIDs are used
6009
+ * uniquely to manage column identities.
6010
+ *
6011
+ * @param {string} uid - The UID of the column.
6012
+ * @returns {Element} - Returns the HTML element of the column header.
5942
6013
  */
5943
6014
  getColumnHeaderByUid(uid) {
5944
6015
  return this.grid.getColumnHeaderByUid(uid);
5945
6016
  }
5946
6017
  /**
5947
- * Gets a column index by column name.
6018
+ * Determines the column index by the specified field name.
6019
+ *
6020
+ * Helpful in converting field names to indices for operations that require
6021
+ * numeric input for array or collection indexing.
5948
6022
  *
5949
- * @param {string} field - Specifies the column name.
5950
- * @returns {number} - Returns column index
6023
+ * @param {string} field - The field name of the column.
6024
+ * @returns {number} - Returns the index of the column.
5951
6025
  */
5952
6026
  getColumnIndexByField(field) {
5953
6027
  return this.grid.getColumnIndexByField(field);
@@ -5963,19 +6037,25 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5963
6037
  return !isNullOrUndefined(index) ? index : -1;
5964
6038
  }
5965
6039
  /**
5966
- * Gets a column index by UID.
6040
+ * Determines the column index based on the unique identifier (UID).
5967
6041
  *
5968
- * @param {string} uid - Specifies the column UID.
5969
- * @returns {number} - Returns column index
6042
+ * This can be crucial in scenarios that involve dynamic column management
6043
+ * where UID provides an accurate reference.
6044
+ *
6045
+ * @param {string} uid - The UID of the column.
6046
+ * @returns {number} - Returns the column index.
5970
6047
  */
5971
6048
  getColumnIndexByUid(uid) {
5972
6049
  return this.grid.getColumnIndexByUid(uid);
5973
6050
  }
5974
6051
  /**
5975
- * Gets the columns from the TreeGrid.
6052
+ * Fetches a collection of columns from the TreeGrid optionally refreshing the column model.
6053
+ *
6054
+ * Use this method to retrieve and optionally refresh the list of columns
6055
+ * to ensure up-to-date configurations and settings.
5976
6056
  *
5977
- * @param {boolean} isRefresh - Defined whether to update DOM
5978
- * @returns {Column[]} - Returns treegrid columns collection
6057
+ * @param {boolean} isRefresh - Determines whether to refresh the grid's column model.
6058
+ * @returns {Column[]} - Returns an array of TreeGrid column objects.
5979
6059
  */
5980
6060
  getColumns(isRefresh) {
5981
6061
  this.updateColumnModel(this.grid.getColumns(isRefresh));
@@ -6036,9 +6116,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6036
6116
  });
6037
6117
  }
6038
6118
  /**
6039
- * Gets the content div of the TreeGrid.
6119
+ * Retrieves the main content area of the TreeGrid.
6040
6120
  *
6041
- * @returns {Element} - Return tree grid content element
6121
+ * This method allows access to the main content DIV, which can
6122
+ * be used for layout adjustments or adding custom elements.
6123
+ *
6124
+ * @returns {Element} - Returns the TreeGrid content HTML element.
6042
6125
  */
6043
6126
  getContent() {
6044
6127
  return this.grid.getContent();
@@ -6049,7 +6132,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6049
6132
  }
6050
6133
  mergeColumns(storedColumn, columns) {
6051
6134
  const persist2 = 'mergeColumns';
6135
+ const mergedColumns = 'mergedColumns';
6052
6136
  this.grid[`${persist2}`].apply(this, [storedColumn, columns]);
6137
+ this.grid[`${mergedColumns}`] = true;
6053
6138
  }
6054
6139
  setFrozenCount() {
6055
6140
  const persist3 = 'setFrozenCount';
@@ -6060,7 +6145,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6060
6145
  this.grid[`${persist4}`].apply(this.grid, [columns]);
6061
6146
  }
6062
6147
  isFrozenGrid() {
6063
- return this.grid.isFrozenGrid();
6148
+ return this.grid.isFrozenGrid.apply(this);
6064
6149
  }
6065
6150
  updateTreeGridModel() {
6066
6151
  this.setProperties({ filterSettings: getObject('properties', this.grid.filterSettings) }, true);
@@ -6069,17 +6154,23 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6069
6154
  this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);
6070
6155
  }
6071
6156
  /**
6072
- * Gets the content table of the TreeGrid.
6157
+ * Retrieves the content table element of the TreeGrid.
6158
+ *
6159
+ * This table contains the main data display area, allowing for
6160
+ * interaction and data manipulation directly within the TreeGrid.
6073
6161
  *
6074
- * @returns {Element} - Returns content table element
6162
+ * @returns {Element} - Returns the HTML element representing the content table.
6075
6163
  */
6076
6164
  getContentTable() {
6077
6165
  return this.grid.getContentTable();
6078
6166
  }
6079
6167
  /**
6080
- * Gets all the TreeGrid's data rows.
6168
+ * Obtains all data row elements from the TreeGrid, excluding summary rows.
6081
6169
  *
6082
- * @returns {Element[]} - Returns row elements
6170
+ * Provides a way to access the visual representation of data for purposes
6171
+ * like custom formatting or event binding.
6172
+ *
6173
+ * @returns {Element[]} - Returns an array of data row elements.
6083
6174
  */
6084
6175
  getDataRows() {
6085
6176
  const dRows = [];
@@ -6092,9 +6183,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6092
6183
  return dRows;
6093
6184
  }
6094
6185
  /**
6095
- * Get current visible data of TreeGrid.
6186
+ * Retrieves the current set of records that are visible in the TreeGrid view.
6187
+ *
6188
+ * This method excludes any summary rows to focus on the main data set
6189
+ * currently being viewed by the user.
6096
6190
  *
6097
- * @returns {Object[]} - Returns current view records
6191
+ * @returns {Object[]} - Returns an array of the current view records.
6098
6192
  * @isGenericType true
6099
6193
  */
6100
6194
  getCurrentViewRecords() {
@@ -6102,60 +6196,78 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6102
6196
  return this.grid.currentViewData.filter((e) => isNullOrUndefined(e[`${isSummaryRow}`]));
6103
6197
  }
6104
6198
  /**
6105
- * Gets the added, edited,and deleted data before bulk save to the DataSource in batch mode.
6199
+ * Collects data changes (added, edited, and deleted) that have not been saved in batch mode.
6106
6200
  *
6107
- * @returns {Object} - Returns batch changes
6201
+ * This allows you to view pending changes awaiting a commit to the data source.
6202
+ *
6203
+ * @returns {Object} - Returns an object detailing batch changes.
6108
6204
  */
6109
6205
  getBatchChanges() {
6110
6206
  return this.grid.editModule.getBatchChanges();
6111
6207
  }
6112
6208
  /**
6113
- * Gets the header div of the TreeGrid.
6209
+ * Retrieves the header content element of the TreeGrid.
6210
+ *
6211
+ * Mainly used for interacting with the header section, which includes
6212
+ * column headers and any applied header styling or events.
6114
6213
  *
6115
- * @returns {Element} - Returns Header content element
6214
+ * @returns {Element} - Returns the HTML element for header content.
6116
6215
  */
6117
6216
  getHeaderContent() {
6118
6217
  return this.grid.getHeaderContent();
6119
6218
  }
6120
6219
  /**
6121
- * Gets the header table element of the TreeGrid.
6220
+ * Retrieves the header table element of the TreeGrid.
6221
+ *
6222
+ * This method is useful for direct access to the table structure
6223
+ * where column headers are defined.
6122
6224
  *
6123
- * @returns {Element} - Return header table element
6225
+ * @returns {Element} - Returns the HTML element for the header table.
6124
6226
  */
6125
6227
  getHeaderTable() {
6126
6228
  return this.grid.getHeaderTable();
6127
6229
  }
6128
6230
  /**
6129
- * Gets a row by index.
6231
+ * Fetches a specific row element based on its index in the TreeGrid.
6130
6232
  *
6131
- * @param {number} index - Specifies the row index.
6132
- * @returns {Element} - Returns row element
6233
+ * This provides a way to directly access and manipulate a row using its index.
6234
+ *
6235
+ * @param {number} index - The index of the desired row.
6236
+ * @returns {Element} - Returns the HTML element of the specified row.
6133
6237
  */
6134
6238
  getRowByIndex(index) {
6135
6239
  return this.grid.getRowByIndex(index);
6136
6240
  }
6137
6241
  /**
6138
- * Get a row information based on cell
6242
+ * Provides detailed information about a row based on a specified target element.
6139
6243
  *
6140
- * @param {Element | EventTarget} target - Target row element
6141
- * @returns {RowInfo} - Returns row information in a JSON object
6244
+ * Integral for retrieving metadata such as row index or data object
6245
+ * when working with events or complex tree structures.
6246
+ *
6247
+ * @param {Element | EventTarget} target - The target element or event triggering the request.
6248
+ * @returns {RowInfo} - Returns an object containing row information.
6142
6249
  */
6143
6250
  getRowInfo(target) {
6144
6251
  return this.grid.getRowInfo(target);
6145
6252
  }
6146
6253
  /**
6147
- * Gets UID by column name.
6254
+ * Finds the unique identifier (UID) for a column based on its field name.
6255
+ *
6256
+ * UIDs are essential for precise identification and manipulation within complex grids.
6148
6257
  *
6149
- * @param {string} field - Specifies the column name.
6150
- * @returns {string} - Returns unique id based on column field name given
6258
+ * @param {string} field - The field name of the column.
6259
+ * @returns {string} - Returns the unique identifier for the specified column.
6151
6260
  */
6152
6261
  getUidByColumnField(field) {
6153
6262
  return this.grid.getUidByColumnField(field);
6154
6263
  }
6155
6264
  /**
6156
- * Gets the visible columns from the TreeGrid.
6265
+ * Retrieves all the columns that are currently set to be visible within the TreeGrid.
6157
6266
  *
6158
- * @returns {Column[]} - Returns visible columns collection
6267
+ * Helps in understanding the user's current view and can be used to dynamically
6268
+ * adjust the visible columns.
6269
+ *
6270
+ * @returns {Column[]} - Returns an array of visible column objects.
6159
6271
  */
6160
6272
  getVisibleColumns() {
6161
6273
  const cols = [];
@@ -6167,7 +6279,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6167
6279
  return cols;
6168
6280
  }
6169
6281
  /**
6170
- * By default, TreeGrid shows the spinner for all its actions. You can use this method to show spinner at your needed time.
6282
+ * Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
6283
+ *
6284
+ * This can be manually invoked to indicate processing, enhancing user experience by providing feedback.
6171
6285
  *
6172
6286
  * @returns {void}
6173
6287
  */
@@ -6175,7 +6289,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6175
6289
  showSpinner(this.element);
6176
6290
  }
6177
6291
  /**
6178
- * Manually shown spinner needs to hide by `hideSpinnner`.
6292
+ * Hides a manually shown loading spinner overlay from the TreeGrid.
6293
+ *
6294
+ * Ensures that any long-running process indication is removed after completion
6295
+ * to manage user interface aesthetics.
6179
6296
  *
6180
6297
  * @returns {void}
6181
6298
  */
@@ -6183,7 +6300,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6183
6300
  hideSpinner(this.element);
6184
6301
  }
6185
6302
  /**
6186
- * Refreshes the TreeGrid header and content.
6303
+ * Refreshes the visual appearance and data of the TreeGrid, updating header and content.
6304
+ *
6305
+ * This is crucial for synchronizing the displayed data with the underlying data source,
6306
+ * ensuring the view reflects current data.
6187
6307
  *
6188
6308
  * @returns {void}
6189
6309
  */
@@ -6203,18 +6323,24 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6203
6323
  this.grid.refresh();
6204
6324
  }
6205
6325
  /**
6206
- * Get the records of checked rows.
6326
+ * Retrieves the records associated with rows that have their checkboxes checked.
6207
6327
  *
6208
- * @returns {Object[]} - Returns records that has been checked
6328
+ * Facilitates operations that require information about specifically selected or
6329
+ * interacted rows within the grid.
6330
+ *
6331
+ * @returns {Object[]} - Returns an array of checked row data objects.
6209
6332
  * @isGenericType true
6210
6333
  */
6211
6334
  getCheckedRecords() {
6212
6335
  return this.selectionModule.getCheckedrecords();
6213
6336
  }
6214
6337
  /**
6215
- * Get the visible records corresponding to rows visually displayed.
6338
+ * Retrieves currently visible records according to the TreeGrid's visual state.
6339
+ *
6340
+ * It considers row expansion and collapse states to return only those records
6341
+ * that a user can currently interact with.
6216
6342
  *
6217
- * @returns {Object[]} - Returns visible records based on collapse state of rows
6343
+ * @returns {Object[]} - Returns visible records reflecting the TreeGrid's current view.
6218
6344
  * @isGenericType true
6219
6345
  */
6220
6346
  getVisibleRecords() {
@@ -6234,26 +6360,35 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6234
6360
  return visibleRecords;
6235
6361
  }
6236
6362
  /**
6237
- * Get the indexes of checked rows.
6363
+ * Retrieves the indices of rows that have their checkboxes checked.
6238
6364
  *
6239
- * @returns {number[]} - Returns checked row indexes
6365
+ * This can assist in programatically assessing which rows have been selected
6366
+ * by checkbox interaction for further processing.
6367
+ *
6368
+ * @returns {number[]} - Returns an array of indices corresponding to checked rows.
6240
6369
  */
6241
6370
  getCheckedRowIndexes() {
6242
6371
  return this.selectionModule.getCheckedRowIndexes();
6243
6372
  }
6244
6373
  /**
6245
- * Checked the checkboxes using rowIndexes.
6374
+ * Selects rows in the TreeGrid using row indices, checking their associated checkboxes.
6375
+ *
6376
+ * This method provides automation for selecting or highlighting specific rows,
6377
+ * useful in scenarios needing pre-selection or default selections.
6246
6378
  *
6247
- * @param {number[]} indexes - row indexes
6379
+ * @param {number[]} indexes - An array of row indices to be marked as selected.
6248
6380
  * @returns {void}
6249
6381
  */
6250
6382
  selectCheckboxes(indexes) {
6251
6383
  this.selectionModule.selectCheckboxes(indexes);
6252
6384
  }
6253
6385
  /**
6254
- * Refreshes the TreeGrid column changes.
6386
+ * Updates and refreshes the TreeGrid's column definitions and layout.
6255
6387
  *
6256
- * @param {boolean} refreshUI - Defined whether to refresh the DOM
6388
+ * Ensures that the latest column settings are displayed, either refreshing the UI
6389
+ * or adjusting internal configurations to match current data or configuration updates.
6390
+ *
6391
+ * @param {boolean} refreshUI - A flag indicating whether the DOM should be updated.
6257
6392
  * @returns {void}
6258
6393
  */
6259
6394
  refreshColumns(refreshUI) {
@@ -6282,7 +6417,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6282
6417
  this.setProperties({ treeColumnIndex: treeIndex }, true);
6283
6418
  }
6284
6419
  /**
6285
- * Refreshes the TreeGrid header.
6420
+ * Refreshes the header section of the TreeGrid to reflect any structural or data changes.
6421
+ *
6422
+ * This method is useful when there are dynamic updates or layout adjustments
6423
+ * needed in the header portion to ensure it aligns with current grid data or settings.
6286
6424
  *
6287
6425
  * @returns {void}
6288
6426
  */
@@ -6337,12 +6475,15 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6337
6475
  }
6338
6476
  }
6339
6477
  /**
6340
- * Expands child rows
6478
+ * Expands the specified parent row within the TreeGrid to reveal its nested data.
6479
+ *
6480
+ * This method is useful for programmatically expanding rows to display their
6481
+ * hierarchical children, providing detailed views for nested data structures.
6341
6482
  *
6342
- * @param {HTMLTableRowElement} row - Expands the given row
6343
- * @param {Object} record - Expands the given record
6344
- * @param {Object} key - Primary key value
6345
- * @param {number} level - Specifies the hierarchical level of the record
6483
+ * @param {HTMLTableRowElement} row - The table row element that should be expanded.
6484
+ * @param {Object} record - Optional. Represents the data record associated with the row to be expanded.
6485
+ * @param {Object} key - Optional. The primary key value that uniquely identifies the record.
6486
+ * @param {number} level - Optional. Indicates the hierarchical level of the record within the TreeGrid.
6346
6487
  * @returns {void}
6347
6488
  */
6348
6489
  expandRow(row, record, key, level) {
@@ -6357,7 +6498,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6357
6498
  if (isNullOrUndefined(row) && isNullOrUndefined(record)) {
6358
6499
  return;
6359
6500
  }
6360
- if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
6501
+ if (!isNullOrUndefined(row) && row.cells && row.cells[0].classList.contains('e-lastrowcell')) {
6361
6502
  this.lastRowBorder(row, false);
6362
6503
  }
6363
6504
  if (this.isExpandAll && !isRemoteData(this)) {
@@ -6397,7 +6538,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6397
6538
  }
6398
6539
  // Internal method to handle the rows expand
6399
6540
  expandRows(row, record, parentRec) {
6400
- const initialTotalRecordsCount = this.grid.totalDataRecordsCount;
6401
6541
  this.expandCollapse('expand', row, record);
6402
6542
  const children = 'Children';
6403
6543
  if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[`${children}`]))) {
@@ -6441,12 +6581,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6441
6581
  }
6442
6582
  else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
6443
6583
  if (this.detailTemplate) {
6444
- record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
6584
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
6445
6585
  }
6446
6586
  else {
6447
6587
  if (this.enableVirtualization && (this.isCollapseAll || this.isExpandAll)) {
6448
6588
  if (row.rowIndex === -1) {
6449
- record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
6589
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
6450
6590
  }
6451
6591
  else {
6452
6592
  record = this.grid.getCurrentViewRecords()[row.rowIndex];
@@ -6456,18 +6596,27 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6456
6596
  record = this.grid.getCurrentViewRecords()[row.rowIndex];
6457
6597
  }
6458
6598
  else {
6459
- record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
6599
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
6460
6600
  }
6461
6601
  }
6462
6602
  }
6463
6603
  return record;
6464
6604
  }
6465
6605
  /**
6466
- * Collapses child rows
6606
+ * Collapses the specified parent row in the TreeGrid.
6467
6607
  *
6468
- * @param {HTMLTableRowElement} row - Collapse the given row
6469
- * @param {Object} record - Collapse the given record
6470
- * @param {Object} key - Primary key value
6608
+ * This method collapses the row associated with the provided HTMLTableRowElement,
6609
+ * hiding any of its displayed child rows. It is typically used to manage the
6610
+ * visibility of hierarchical data within a tree structure.
6611
+ *
6612
+ * @param {HTMLTableRowElement} row - The HTMLTableRowElement representing the parent row
6613
+ * whose child rows are to be collapsed.
6614
+ * @param {Object} record - (Optional) The data record associated with the row being collapsed.
6615
+ * This can be used to access or manipulate the underlying data
6616
+ * when collapsing the row.
6617
+ * @param {Object} key - (Optional) The primary key value of the record. It can be used to identify
6618
+ * the target record uniquely when collapsing the row, especially in cases
6619
+ * where the row or record data needs to be referenced or logged.
6471
6620
  * @returns {void}
6472
6621
  */
6473
6622
  collapseRow(row, record, key) {
@@ -6548,9 +6697,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6548
6697
  }
6549
6698
  }
6550
6699
  /**
6551
- * Expands the records at specific hierarchical level
6700
+ * Expands all the records at the specified hierarchical level within the TreeGrid.
6701
+ *
6702
+ * This method is useful for visually expanding data at a certain depth, making
6703
+ * all parent rows visible at the given level and their child rows accessible.
6552
6704
  *
6553
- * @param {number} level - Expands the parent rows at given level
6705
+ * @param {number} level - The hierarchical level at which parent rows should be expanded.
6554
6706
  * @returns {void}
6555
6707
  */
6556
6708
  expandAtLevel(level) {
@@ -6570,9 +6722,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6570
6722
  }
6571
6723
  }
6572
6724
  /**
6573
- * Expands the records by given primary key value
6725
+ * Expands a specific record identified by the provided primary key value.
6574
6726
  *
6575
- * @param {Object} key - Expands the parent rows with given primary key value
6727
+ * This method is useful for expanding particular node in the TreeGrid when
6728
+ * the parent rows need to be targeted individually by their unique key.
6729
+ *
6730
+ * @param {Object} key - The primary key value of the record to be expanded.
6576
6731
  * @returns {void}
6577
6732
  */
6578
6733
  expandByKey(key) {
@@ -6622,9 +6777,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6622
6777
  return obj;
6623
6778
  }
6624
6779
  /**
6625
- * Collapses the records at specific hierarchical level
6780
+ * Collapses all the records at the specified hierarchical level within the TreeGrid.
6781
+ *
6782
+ * This function helps in hiding child rows for all parent nodes at a given level,
6783
+ * effectively reducing the visible depth of the hierarchical structure.
6626
6784
  *
6627
- * @param {number} level - Define the parent row level which needs to be collapsed
6785
+ * @param {number} level - The hierarchical level at which parent rows should be collapsed.
6628
6786
  * @returns {void}
6629
6787
  */
6630
6788
  collapseAtLevel(level) {
@@ -6644,9 +6802,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6644
6802
  }
6645
6803
  }
6646
6804
  /**
6647
- * Collapses the records by given primary key value
6805
+ * Collapses a specific record identified by the provided primary key value.
6648
6806
  *
6649
- * @param {Object} key - Collapses the parent rows with given primary key value
6807
+ * This method is useful for collapsing particular node in the TreeGrid when
6808
+ * the parent rows need to be targeted individually by their unique key.
6809
+ *
6810
+ * @param {Object} key - The primary key value of the record to be collapsed.
6650
6811
  * @returns {void}
6651
6812
  */
6652
6813
  collapseByKey(key) {
@@ -6684,7 +6845,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6684
6845
  }
6685
6846
  }
6686
6847
  /**
6687
- * Expands All the rows
6848
+ * Expands all rows in the TreeGrid, making the full hierarchy visible.
6849
+ *
6850
+ * This method should be used with caution on large datasets, as it makes
6851
+ * all nodes and their child rows visible, which might affect performance.
6688
6852
  *
6689
6853
  * @returns {void}
6690
6854
  */
@@ -6695,10 +6859,23 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6695
6859
  }
6696
6860
  this.isExpandedEventTriggered = false;
6697
6861
  this.isExpandingEventTriggered = false;
6862
+ if (this.editSettings.mode === 'Batch') {
6863
+ const obj = 'dialogObj';
6864
+ const showDialog = 'showDialog';
6865
+ if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
6866
+ this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
6867
+ const dialogObj = this.grid.editModule[`${obj}`];
6868
+ this.grid.editModule[`${showDialog}`]('CancelEdit', dialogObj);
6869
+ return;
6870
+ }
6871
+ }
6698
6872
  this.expandCollapseAll('expand');
6699
6873
  }
6700
6874
  /**
6701
- * Collapses All the rows
6875
+ * Collapses all rows in the TreeGrid, hiding all child rows and leaving only parent nodes visible.
6876
+ *
6877
+ * This method can be used to quickly minimize the view to only top-level data,
6878
+ * which is helpful for summarizing or performing broad overviews of the dataset.
6702
6879
  *
6703
6880
  * @returns {void}
6704
6881
  */
@@ -6709,6 +6886,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6709
6886
  }
6710
6887
  this.isCollapsedEventTriggered = false;
6711
6888
  this.isCollapsingEventTriggered = false;
6889
+ if (this.editSettings.mode === 'Batch') {
6890
+ const obj = 'dialogObj';
6891
+ const showDialog = 'showDialog';
6892
+ if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
6893
+ this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
6894
+ const dialogObj = this.grid.editModule[`${obj}`];
6895
+ this.grid.editModule[`${showDialog}`]('CancelEdit', dialogObj);
6896
+ return;
6897
+ }
6898
+ }
6712
6899
  this.expandCollapseAll('collapse');
6713
6900
  }
6714
6901
  expandCollapseAll(action) {
@@ -6728,7 +6915,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6728
6915
  }
6729
6916
  this.isExpandAll = true;
6730
6917
  this.isCollapseAll = true;
6731
- if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
6918
+ if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
6732
6919
  this.flatData.filter((e) => {
6733
6920
  if (e.hasChildRecords) {
6734
6921
  e.expanded = action === 'collapse' ? false : true;
@@ -6791,12 +6978,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6791
6978
  row = gridRows[parseInt(rowIndex.toString(), 10)];
6792
6979
  }
6793
6980
  else {
6794
- rowIndex = +row.getAttribute('data-rowindex');
6981
+ rowIndex = +row.getAttribute('aria-rowindex') - 1;
6795
6982
  }
6796
6983
  if (!isNullOrUndefined(row)) {
6797
6984
  row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
6798
6985
  }
6799
- if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)
6986
+ if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization) && !isRemoteData(this)
6800
6987
  && !isCountRequired(this)) {
6801
6988
  this.notify(localPagedExpandCollapse, { action: action, row: row, record: record });
6802
6989
  }
@@ -6806,6 +6993,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6806
6993
  displayAction = 'e-childrow-visible';
6807
6994
  if (!isChild) {
6808
6995
  record.expanded = true;
6996
+ this.flatData.forEach(function (e) {
6997
+ e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
6998
+ });
6809
6999
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
6810
7000
  }
6811
7001
  if (!isNullOrUndefined(row)) {
@@ -6827,6 +7017,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6827
7017
  displayAction = 'e-childrow-hidden';
6828
7018
  if (!isChild || isCountRequired(this)) {
6829
7019
  record.expanded = false;
7020
+ this.flatData.forEach(function (e) {
7021
+ e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
7022
+ });
6830
7023
  this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
6831
7024
  }
6832
7025
  if (!isNullOrUndefined(row)) {
@@ -7056,7 +7249,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7056
7249
  }
7057
7250
  if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization
7058
7251
  || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
7059
- gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'e-childrow-hidden' ? true : false;
7252
+ if (!isNullOrUndefined(gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex])) {
7253
+ gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'e-childrow-hidden' ? true : false;
7254
+ }
7060
7255
  const parentRecord = currentViewData.filter((e) => {
7061
7256
  return e.uniqueID === currentRecord[0].parentUniqueID;
7062
7257
  });
@@ -7198,28 +7393,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7198
7393
  }
7199
7394
  return value;
7200
7395
  }
7201
- /**
7202
- * Updates the rows and cells
7203
- *
7204
- * @param {Object[]} records - Updates the given records
7205
- * @param {HTMLTableRowElement[]} rows - Updates the given rows
7206
- * @param {number} index - Updates the given cell index
7207
- * @returns {void}
7208
- */
7209
- updateRowAndCellElements(records, rows, index) {
7210
- for (let i = 0; i < records.length; i++) {
7211
- this.renderModule.cellRender({
7212
- data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
7213
- column: this.grid.getColumns()[this.treeColumnIndex],
7214
- requestType: 'rowDragAndDrop'
7215
- });
7216
- if (this['action'] === 'indenting' || this['action'] === 'outdenting') {
7217
- this.renderModule.RowModifier({
7218
- data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
7219
- });
7220
- }
7221
- }
7222
- }
7223
7396
  /**
7224
7397
  * @hidden
7225
7398
  * @returns {void}
@@ -7227,6 +7400,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7227
7400
  addListener() {
7228
7401
  this.on('updateResults', this.updateResultModel, this);
7229
7402
  this.grid.on('initial-end', this.afterGridRender, this);
7403
+ this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
7230
7404
  }
7231
7405
  updateResultModel(returnResult) {
7232
7406
  this.dataResults = returnResult;
@@ -7241,27 +7415,31 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7241
7415
  }
7242
7416
  this.off('updateResults', this.updateResultModel);
7243
7417
  this.grid.off('initial-end', this.afterGridRender);
7418
+ this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
7244
7419
  }
7245
7420
  /**
7246
- * Filters TreeGrid row by column name with the given options.
7421
+ * Filters the TreeGrid rows based on a specified column and filter criteria.
7422
+ *
7423
+ * This method allows for dynamic filtering against column data using various
7424
+ * operators and values, supporting case-sensitive filtering and accent sensitivity.
7247
7425
  *
7248
- * @param {string} fieldName - Defines the field name of the column.
7249
- * @param {string} filterOperator - Defines the operator to filter records.
7250
- * @param {string | number | Date | boolean} filterValue - Defines the value used to filter records.
7251
- * @param {string} predicate - Defines the relationship between one filter query and another by using AND or OR predicate.
7252
- * @param {boolean} matchCase - If match case is set to true, the TreeGrid filters the records with exact match. if false, it filters
7253
- * case insensitive records (uppercase and lowercase letters are treated the same).
7254
- * @param {boolean} ignoreAccent - If ignoreAccent is set to true,
7255
- * then filter ignores diacritic characters or accents while filtering.
7256
- * @param {string} actualFilterValue - Defines the actual filter value for filter column.
7257
- * @param {string} actualOperator - Defines the actual filter operator for filter column.
7426
+ * @param {string} fieldName - The name of the column to apply the filter on.
7427
+ * @param {string} filterOperator - The operator used to perform the filter (e.g., 'equals', 'startswith').
7428
+ * @param {string | number | Date | boolean } filterValue - The value to filter against.
7429
+ * @param {string} predicate - The logical operator ('AND'/'OR') to combine this filter with others.
7430
+ * @param {boolean} matchCase - If true, the filter performs a case-sensitive match.
7431
+ * @param {boolean} ignoreAccent - If true, the filter ignores diacritical marks.
7432
+ * @param {string} actualFilterValue - The original value used for filtering, useful for distinguishing displayed and actual values.
7433
+ * @param {string} actualOperator - The actual operator that is applied when different from the displayed operator.
7258
7434
  * @returns {void}
7259
7435
  */
7260
7436
  filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
7261
7437
  this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
7262
7438
  }
7263
7439
  /**
7264
- * Clears all the filtered rows of the TreeGrid.
7440
+ * Clears all filters applied to the TreeGrid, restoring the view to show all records.
7441
+ *
7442
+ * This method is useful for resetting the grid to its unfiltered state.
7265
7443
  *
7266
7444
  * @returns {void}
7267
7445
  */
@@ -7280,26 +7458,32 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7280
7458
  this.grid.removeFilteredColsByField(field, isClearFilterBar);
7281
7459
  }
7282
7460
  /**
7283
- * Selects a row by given index.
7461
+ * Selects a row in the TreeGrid by its index.
7462
+ *
7463
+ * Use this method to highlight a specific row; useful for programmatically navigating data.
7284
7464
  *
7285
- * @param {number} index - Defines the row index.
7286
- * @param {boolean} isToggle - If set to true, then it toggles the selection.
7465
+ * @param {number} index - Index of the row to select.
7466
+ * @param {boolean} isToggle - If true, toggles the selection state of the row.
7287
7467
  * @returns {void}
7288
7468
  */
7289
7469
  selectRow(index, isToggle) {
7290
7470
  this.grid.selectRow(index, isToggle);
7291
7471
  }
7292
7472
  /**
7293
- * Selects a collection of rows by indexes.
7473
+ * Selects multiple rows in the TreeGrid given an array of row indexes.
7294
7474
  *
7295
- * @param {number[]} rowIndexes - Specifies the row indexes.
7475
+ * Useful for batch operations where multiple row selections are necessary.
7476
+ *
7477
+ * @param {number[]} rowIndexes - Array of row index numbers to select.
7296
7478
  * @returns {void}
7297
7479
  */
7298
7480
  selectRows(rowIndexes) {
7299
7481
  this.grid.selectRows(rowIndexes);
7300
7482
  }
7301
7483
  /**
7302
- * Deselects the current selected rows and cells.
7484
+ * Deselects all selected rows and cells within the TreeGrid.
7485
+ *
7486
+ * Resets the selection state of the grid, which is useful after bulk operations.
7303
7487
  *
7304
7488
  * @returns {void}
7305
7489
  */
@@ -7310,39 +7494,47 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7310
7494
  this.grid.clearSelection();
7311
7495
  }
7312
7496
  /**
7313
- * Copy the selected rows or cells data into clipboard.
7497
+ * Copies the data of selected rows or cells to the clipboard.
7314
7498
  *
7315
- * @param {boolean} withHeader - Specifies whether the column header text needs to be copied along with rows or cells.
7499
+ * This method supports including headers for better context when pasting elsewhere.
7500
+ *
7501
+ * @param {boolean} withHeader - (Optional) If true, includes column headers in the copied data.
7316
7502
  * @returns {void}
7317
7503
  */
7318
7504
  copy(withHeader) {
7319
7505
  this.clipboardModule.copy(withHeader);
7320
7506
  }
7321
7507
  /**
7322
- * Paste data from clipboard to selected cells.
7508
+ * Pastes data into the selected cells from the clipboard.
7509
+ *
7510
+ * Automatically places the pasted data starting from the specified indices.
7323
7511
  *
7324
- * @param {boolean} data - Specifies the date for paste.
7325
- * @param {boolean} rowIndex - Specifies the row index.
7326
- * @param {boolean} colIndex - Specifies the column index.
7512
+ * @param {string} data - The clipboard data to paste.
7513
+ * @param {number} rowIndex - The starting row index for pasting.
7514
+ * @param {number} colIndex - The starting column index for pasting.
7327
7515
  * @returns {void}
7328
7516
  */
7329
7517
  paste(data, rowIndex, colIndex) {
7330
7518
  this.clipboardModule.paste(data, rowIndex, colIndex);
7331
7519
  }
7332
7520
  /**
7333
- * Selects a cell by the given index.
7521
+ * Selects a cell by its index position in the TreeGrid.
7334
7522
  *
7335
- * @param {IIndex} cellIndex - Defines the row and column indexes.
7336
- * @param {boolean} isToggle - If set to true, then it toggles the selection.
7523
+ * Useful for navigating or highlighting specific data cells within the grid.
7524
+ *
7525
+ * @param {IIndex} cellIndex - An object specifying the row and column indexes.
7526
+ * @param {boolean} isToggle - (Optional) If true, toggles the selection state of the cell.
7337
7527
  * @returns {void}
7338
7528
  */
7339
7529
  selectCell(cellIndex, isToggle) {
7340
7530
  this.grid.selectCell(cellIndex, isToggle);
7341
7531
  }
7342
7532
  /**
7343
- * Gets the collection of selected rows.
7533
+ * Retrieves the currently selected rows.
7534
+ *
7535
+ * Useful for obtaining the selected data elements for downstream processing.
7344
7536
  *
7345
- * @returns {Element[]} - Returns selected row elements collection
7537
+ * @returns {Element[]} - An array of Element objects representing the selected rows.
7346
7538
  */
7347
7539
  getSelectedRows() {
7348
7540
  return this.grid.getSelectedRows();
@@ -7554,44 +7746,59 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7554
7746
  return cnt;
7555
7747
  }
7556
7748
  /**
7557
- * Gets the collection of selected row indexes.
7749
+ * Retrieves the indexes of the currently selected rows in the TreeGrid.
7558
7750
  *
7559
- * @returns {number[]} - Returns selected rows index collection
7751
+ * This method is useful when you need to perform actions based on the selected rows,
7752
+ * such as retrieving data or changing the selection.
7753
+ *
7754
+ * @returns {number[]} - An array of numbers representing the indexes of selected rows.
7560
7755
  */
7561
7756
  getSelectedRowIndexes() {
7562
7757
  return this.grid.getSelectedRowIndexes();
7563
7758
  }
7564
7759
  /**
7565
- * Gets the collection of selected row and cell indexes.
7760
+ * Retrieves the indexes of the selected cells within the selected rows.
7761
+ *
7762
+ * This can be useful for handling cell-specific operations, such as
7763
+ * applying styles or editing values programmatically.
7566
7764
  *
7567
- * @returns {ISelectedCell[]} - Returns selected cell's index details
7765
+ * @returns {ISelectedCell[]} - An array of objects representing the selected cells' indexes.
7568
7766
  */
7569
7767
  getSelectedRowCellIndexes() {
7570
7768
  return this.grid.getSelectedRowCellIndexes();
7571
7769
  }
7572
7770
  /**
7573
- * Gets the collection of selected records.
7771
+ * Retrieves the data records corresponding to the currently selected rows.
7772
+ *
7773
+ * This method provides the full record data for the selected rows,
7774
+ * which is useful for data manipulation or extraction operations.
7574
7775
  *
7575
7776
  * @isGenericType true
7576
- * @returns {Object[]} - Returns selected records collection
7777
+ * @returns {Object[]} - An array of data objects representing the selected records.
7577
7778
  */
7578
7779
  getSelectedRecords() {
7579
7780
  return this.grid.getSelectedRecords();
7580
7781
  }
7581
7782
  /**
7582
- * Gets the data module.
7783
+ * Obtains the data handling modules used by the TreeGrid.
7583
7784
  *
7584
- * @returns {{baseModule: Data, treeModule: DataManipulation}}: Returns grid and treegrid data module
7785
+ * This includes both the base data module for standard grid operations and the tree module
7786
+ * for handling hierarchical data, giving complete access to data management capabilities.
7787
+ *
7788
+ * @returns {{baseModule: Data, treeModule: DataManipulation}} - An object containing both grid and tree data modules.
7585
7789
  */
7586
7790
  getDataModule() {
7587
7791
  return { baseModule: this.grid.getDataModule(), treeModule: this.dataModule };
7588
7792
  }
7589
7793
  /**
7590
- * Reorder the rows based on given indexes and position
7794
+ * Reorders rows in the TreeGrid based on specified source indexes and a target position.
7591
7795
  *
7592
- * @param {number[]} fromIndexes - Source indexes of rows
7593
- * @param {number} toIndex - Destination index of row
7594
- * @param {string} position - Defines drop position as above or below or child
7796
+ * This functionality allows for dynamic rearrangement of rows, such as moving selected
7797
+ * rows to a new position as siblings or children.
7798
+ *
7799
+ * @param {number[]} fromIndexes - An array indicating the source indexes of the rows to be moved.
7800
+ * @param {number} toIndex - The target index where the rows should be moved.
7801
+ * @param {string} position - The position relative to the target index ('above', 'below', 'child').
7595
7802
  * @returns {void}
7596
7803
  */
7597
7804
  reorderRows(fromIndexes, toIndex, position) {
@@ -7600,9 +7807,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7600
7807
  }
7601
7808
  }
7602
7809
  /**
7603
- * Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.
7810
+ * Indents a specified record, promoting it to one level deeper in the hierarchy.
7811
+ *
7812
+ * This function moves the selected row to become the last child of its preceding row,
7813
+ * altering the visual and hierarchical data structure.
7604
7814
  *
7605
- * @param {Object} record specifies the record to do indented
7815
+ * @param {Object} record - (Optional) The record to be indented. If omitted, the currently selected row is used.
7606
7816
  * @returns {void}
7607
7817
  */
7608
7818
  indent(record) {
@@ -7612,9 +7822,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7612
7822
  }
7613
7823
  }
7614
7824
  /**
7615
- * Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.
7825
+ * Outdents a specified record, moving it one level up in the hierarchy.
7616
7826
  *
7617
- * @param {Object} record specifies the record to do outdented
7827
+ * This method repositions the selected row to be a sibling of its parent, impacting
7828
+ * its display and the hierarchical relationships within the TreeGrid.
7829
+ *
7830
+ * @param {Object} record - (Optional) The record to be outdented. If omitted, the currently selected row is used.
7618
7831
  * @returns {void}
7619
7832
  */
7620
7833
  outdent(record) {
@@ -7810,6 +8023,21 @@ __decorate$b([
7810
8023
  __decorate$b([
7811
8024
  Property('All')
7812
8025
  ], TreeGrid.prototype, "columnQueryMode", void 0);
8026
+ __decorate$b([
8027
+ Property(true)
8028
+ ], TreeGrid.prototype, "allowSelection", void 0);
8029
+ __decorate$b([
8030
+ Property(-1)
8031
+ ], TreeGrid.prototype, "selectedRowIndex", void 0);
8032
+ __decorate$b([
8033
+ Complex({}, SelectionSettings)
8034
+ ], TreeGrid.prototype, "selectionSettings", void 0);
8035
+ __decorate$b([
8036
+ Property(false)
8037
+ ], TreeGrid.prototype, "allowExcelExport", void 0);
8038
+ __decorate$b([
8039
+ Property(false)
8040
+ ], TreeGrid.prototype, "allowPdfExport", void 0);
7813
8041
  __decorate$b([
7814
8042
  Event()
7815
8043
  ], TreeGrid.prototype, "created", void 0);
@@ -7888,9 +8116,6 @@ __decorate$b([
7888
8116
  __decorate$b([
7889
8117
  Event()
7890
8118
  ], TreeGrid.prototype, "queryCellInfo", void 0);
7891
- __decorate$b([
7892
- Property(true)
7893
- ], TreeGrid.prototype, "allowSelection", void 0);
7894
8119
  __decorate$b([
7895
8120
  Event()
7896
8121
  ], TreeGrid.prototype, "rowSelecting", void 0);
@@ -7981,18 +8206,6 @@ __decorate$b([
7981
8206
  __decorate$b([
7982
8207
  Event()
7983
8208
  ], TreeGrid.prototype, "rowDrop", void 0);
7984
- __decorate$b([
7985
- Property(-1)
7986
- ], TreeGrid.prototype, "selectedRowIndex", void 0);
7987
- __decorate$b([
7988
- Complex({}, SelectionSettings)
7989
- ], TreeGrid.prototype, "selectionSettings", void 0);
7990
- __decorate$b([
7991
- Property(false)
7992
- ], TreeGrid.prototype, "allowExcelExport", void 0);
7993
- __decorate$b([
7994
- Property(false)
7995
- ], TreeGrid.prototype, "allowPdfExport", void 0);
7996
8209
  __decorate$b([
7997
8210
  Event()
7998
8211
  ], TreeGrid.prototype, "pdfQueryCellInfo", void 0);
@@ -8208,7 +8421,6 @@ class RowDD {
8208
8421
  }
8209
8422
  const action = 'action';
8210
8423
  const dropPosition = 'dropPosition';
8211
- const updateRowAndCellElements = 'updateRowAndCellElements';
8212
8424
  if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
8213
8425
  if (position === 'above') {
8214
8426
  this.dropPosition = 'topSegment';
@@ -8258,7 +8470,7 @@ class RowDD {
8258
8470
  const parentrow = this.parent.getRows()[parseInt(toIndex.toString(), 10)];
8259
8471
  totalRecord.push(parentData);
8260
8472
  rows.push(parentrow);
8261
- this.parent[`${updateRowAndCellElements}`](totalRecord, rows, index);
8473
+ this.updateRowAndCellElements(totalRecord, rows, index);
8262
8474
  }
8263
8475
  if (this.parent.enableImmutableMode && this.parent[`${action}`] === 'outdenting') {
8264
8476
  const index = this.parent.allowRowDragAndDrop
@@ -8270,7 +8482,29 @@ class RowDD {
8270
8482
  const rows = [];
8271
8483
  totalRecord.push(record);
8272
8484
  rows.push(row);
8273
- this.parent[`${updateRowAndCellElements}`](totalRecord, rows, index);
8485
+ this.updateRowAndCellElements(totalRecord, rows, index);
8486
+ }
8487
+ }
8488
+ }
8489
+ /**
8490
+ * Updates the rows and cells
8491
+ *
8492
+ * @param {Object[]} records - Updates the given records
8493
+ * @param {HTMLTableRowElement[]} rows - Updates the given rows
8494
+ * @param {number} index - Updates the given cell index
8495
+ * @returns {void}
8496
+ */
8497
+ updateRowAndCellElements(records, rows, index) {
8498
+ for (let i = 0; i < records.length; i++) {
8499
+ this.parent.renderModule.cellRender({
8500
+ data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
8501
+ column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
8502
+ requestType: 'rowDragAndDrop'
8503
+ });
8504
+ if (this.parent['action'] === 'indenting' || this.parent['action'] === 'outdenting') {
8505
+ this.parent.renderModule.RowModifier({
8506
+ data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
8507
+ });
8274
8508
  }
8275
8509
  }
8276
8510
  }
@@ -8319,7 +8553,7 @@ class RowDD {
8319
8553
  record.parentItem.taskData) {
8320
8554
  dropIndex = i;
8321
8555
  if (tObj.enableVirtualization) {
8322
- dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('data-rowindex'), 10);
8556
+ dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('aria-rowindex'), 10) - 1;
8323
8557
  }
8324
8558
  }
8325
8559
  }
@@ -8328,26 +8562,27 @@ class RowDD {
8328
8562
  dropIndex = this.selectedRow.rowIndex - 1;
8329
8563
  }
8330
8564
  if (this.parent.enableVirtualization && this.selectedRecord && !(record.level > this.selectedRecord.level)) {
8331
- dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
8565
+ dropIndex = parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 2;
8332
8566
  }
8333
8567
  tObj[`${action}`] = 'indenting';
8334
8568
  tObj[`${droppedIndex}`] = dropIndex;
8335
8569
  this.eventTrigger('indenting', dropIndex);
8336
8570
  }
8337
8571
  else if (request === 'outdent') {
8338
- if (this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0 ||
8339
- tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0) {
8572
+ const isInvalidSelection = this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0;
8573
+ const isRootLevel = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0;
8574
+ if (isInvalidSelection || isRootLevel) {
8340
8575
  return;
8341
8576
  }
8342
- let dropIndex;
8343
8577
  const parentItem = this.selectedRecord.parentItem;
8344
- for (let i = 0; i < tObj.getCurrentViewRecords().length; i++) {
8345
- if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].uniqueID === parentItem.uniqueID) {
8346
- dropIndex = i;
8347
- }
8578
+ const records = tObj.getCurrentViewRecords();
8579
+ let dropIndex = records.findIndex((record) => record.uniqueID === parentItem.uniqueID);
8580
+ if (dropIndex === -1) {
8581
+ return;
8348
8582
  }
8349
8583
  if (this.parent.enableVirtualization && this.selectedRecord) {
8350
- dropIndex = parseInt(this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('data-rowindex'), 10);
8584
+ const ariaRowIndex = this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('aria-rowindex');
8585
+ dropIndex = parseInt(ariaRowIndex, 10) - 1;
8351
8586
  }
8352
8587
  tObj[`${action}`] = 'outdenting';
8353
8588
  tObj[`${droppedIndex}`] = dropIndex;
@@ -8373,7 +8608,7 @@ class RowDD {
8373
8608
  if (!actionArgs.cancel) {
8374
8609
  if (actionArgs.action === 'indenting') {
8375
8610
  if (this.parent.enableVirtualization) {
8376
- this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
8611
+ this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 1], dropIndex, 'child');
8377
8612
  }
8378
8613
  else {
8379
8614
  this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'child');
@@ -8381,7 +8616,7 @@ class RowDD {
8381
8616
  }
8382
8617
  else if (actionArgs.action === 'outdenting') {
8383
8618
  if (this.parent.enableVirtualization) {
8384
- this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
8619
+ this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 1], dropIndex, 'below');
8385
8620
  }
8386
8621
  else {
8387
8622
  this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'below');
@@ -8684,7 +8919,8 @@ class RowDD {
8684
8919
  else {
8685
8920
  rowTop = rowPositionHeight + contentHeight + roundOff;
8686
8921
  }
8687
- const rowBottom = rowTop + row[0].offsetHeight;
8922
+ const rowBottom = row[0].offsetHeight !== 0 && isNullOrUndefined(rowEle) ?
8923
+ rowTop + row[0].offsetHeight : rowTop + rowEle.offsetHeight;
8688
8924
  const difference = rowBottom - rowTop;
8689
8925
  const divide = difference / 3;
8690
8926
  const topRowSegment = rowTop + divide;
@@ -8701,6 +8937,7 @@ class RowDD {
8701
8937
  const isTopSegment = posy <= topRowSegment;
8702
8938
  const isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
8703
8939
  const isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
8940
+ let isBorderNeed = true;
8704
8941
  if (isTopSegment || isMiddleRowSegment || isBottomRowSegment) {
8705
8942
  if (isTopSegment && this.dropPosition !== 'Invalid') {
8706
8943
  this.removeChildBorder();
@@ -8709,19 +8946,12 @@ class RowDD {
8709
8946
  this.addFirstrowBorder(rowEle);
8710
8947
  this.removeErrorElem();
8711
8948
  this.removeLastrowBorder(rowEle);
8712
- this.topOrBottomBorder(args.target);
8713
8949
  }
8714
8950
  if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {
8715
8951
  this.removetopOrBottomBorder();
8716
- let rowElement = [];
8717
- const element = closest(args.target, 'tr');
8718
- rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));
8719
- if (rowElement.length > 0) {
8720
- this.addRemoveClasses(rowElement, true, 'e-childborder');
8721
- }
8952
+ this.dropPosition = 'middleSegment';
8722
8953
  this.addLastRowborder(rowEle);
8723
8954
  this.addFirstrowBorder(rowEle);
8724
- this.dropPosition = 'middleSegment';
8725
8955
  }
8726
8956
  if (isBottomRowSegment && this.dropPosition !== 'Invalid') {
8727
8957
  this.removeErrorElem();
@@ -8730,11 +8960,164 @@ class RowDD {
8730
8960
  this.dropPosition = 'bottomSegment';
8731
8961
  this.addLastRowborder(rowEle);
8732
8962
  this.removeFirstrowBorder(rowEle);
8733
- this.topOrBottomBorder(args.target);
8963
+ }
8964
+ if ((isTopSegment || isBottomRowSegment) && this.dropPosition !== 'Invalid') {
8965
+ isBorderNeed = this.updateBorderStatus(row, index);
8966
+ this.topOrBottomBorder(args.target, isBorderNeed);
8967
+ }
8968
+ else if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {
8969
+ let rowElement = [];
8970
+ const element = closest(args.target, 'tr');
8971
+ rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));
8972
+ isBorderNeed = this.updateBorderStatus(row, index);
8973
+ if (rowElement.length > 0 && isBorderNeed) {
8974
+ this.addRemoveClasses(rowElement, true, 'e-childborder');
8975
+ }
8734
8976
  }
8735
8977
  }
8736
8978
  return this.dropPosition;
8737
8979
  }
8980
+ /**
8981
+ * Updates the border status for a specified row and index.
8982
+ *
8983
+ * @private
8984
+ * @param {Element[]} row - The array of row elements to be updated.
8985
+ * @param {number} index - The index of the row element for which the border status is to be updated.
8986
+ * @returns {boolean} - Returns true if the border status was successfully updated, otherwise false.
8987
+ */
8988
+ updateBorderStatus(row, index) {
8989
+ let isBorderNeed = true;
8990
+ let rows = this.parent.grid.getRows();
8991
+ const childRows = [];
8992
+ let hasDetailTemplate = false;
8993
+ if (!isNullOrUndefined(this.parent.detailTemplate)) {
8994
+ rows = this.parent.getDataRows();
8995
+ hasDetailTemplate = true;
8996
+ }
8997
+ const treegridColumnIndex = this.parent.treeColumnIndex;
8998
+ let treeColIndex = this.parent.allowRowDragAndDrop ?
8999
+ (hasDetailTemplate ? treegridColumnIndex + 2 : treegridColumnIndex + 1) :
9000
+ (hasDetailTemplate ? treegridColumnIndex + 1 : treegridColumnIndex);
9001
+ if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
9002
+ treeColIndex = treegridColumnIndex;
9003
+ }
9004
+ const dragRows = row;
9005
+ const targetRow = [rows[`${index}`]];
9006
+ if (this.dropPosition === 'topSegment') {
9007
+ row.filter((e) => {
9008
+ if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(targetRow[0]) ||
9009
+ isNullOrUndefined(targetRow[0].cells)) {
9010
+ return true;
9011
+ }
9012
+ const regex = /index(\d+)|level(\d+)/g;
9013
+ const parentIndexLevel = e === null || e === undefined ? undefined : e.cells[`${treeColIndex}`].className.match(regex);
9014
+ const dropIndexLevel = targetRow[0].cells[`${treeColIndex}`].className.match(regex);
9015
+ if (isNullOrUndefined(dropIndexLevel) || isNullOrUndefined(dropIndexLevel) || isNullOrUndefined(parentIndexLevel)) {
9016
+ return true;
9017
+ }
9018
+ const parentLevel = +parentIndexLevel[1].match(/\d+/)[0];
9019
+ const dropParentLevel = +dropIndexLevel[1].match(/\d+/)[0];
9020
+ let InDraggedRowIndex = false;
9021
+ if (parentLevel !== 0 && parentLevel !== dropParentLevel) {
9022
+ return true;
9023
+ }
9024
+ for (let i = 0; i < rows.length; i++) {
9025
+ if (rows[parseInt(i.toString(), 10)] === dragRows[0]) {
9026
+ InDraggedRowIndex = true;
9027
+ }
9028
+ if (InDraggedRowIndex && rows[parseInt(i.toString(), 10)] !== dragRows[0]) {
9029
+ const parentIndexLevelInRow = rows[parseInt(i.toString(), 10)].cells[`${treeColIndex}`].className.match(regex);
9030
+ const parentLevelInRow = +parentIndexLevelInRow[1].match(/\d+/)[0];
9031
+ if (parentLevelInRow !== parentLevel && parentLevelInRow > parentLevel) {
9032
+ childRows.push(rows[parseInt(i.toString(), 10)]);
9033
+ }
9034
+ else {
9035
+ break;
9036
+ }
9037
+ }
9038
+ }
9039
+ if (parentLevel === dropParentLevel && ((childRows.length > 0 && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index - (childRows.length + 1)) || (childRows.length === 0 && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index - 1))) {
9040
+ isBorderNeed = false;
9041
+ }
9042
+ return true;
9043
+ });
9044
+ isBorderNeed = (!isNullOrUndefined(row) && childRows.length === 0 && !isNullOrUndefined(row[0].getAttribute('aria-rowindex')) && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index - 1) && isNullOrUndefined(row[0]) ? false : isBorderNeed;
9045
+ }
9046
+ if (this.dropPosition === 'bottomSegment') {
9047
+ targetRow.filter((e) => {
9048
+ if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(dragRows[0]) ||
9049
+ isNullOrUndefined(dragRows[0].cells)) {
9050
+ return true;
9051
+ }
9052
+ const regex = /index(\d+)|level(\d+)/g;
9053
+ const parentIndexLevel = e === null || e === undefined ? undefined : e.cells[`${treeColIndex}`].className.match(regex);
9054
+ const dragIndexLevel = dragRows[0].cells[`${treeColIndex}`].className.match(regex);
9055
+ if (isNullOrUndefined(dragIndexLevel) || isNullOrUndefined(parentIndexLevel)) {
9056
+ return true;
9057
+ }
9058
+ const parentLevel = +parentIndexLevel[1].match(/\d+/)[0];
9059
+ const dragParentLevel = +dragIndexLevel[1].match(/\d+/)[0];
9060
+ let InDraggedRowIndex = false;
9061
+ if (parentLevel !== 0 && parentLevel !== dragParentLevel) {
9062
+ return true;
9063
+ }
9064
+ for (let i = 0; i < rows.length; i++) {
9065
+ if (rows[parseInt(i.toString(), 10)] === targetRow[0]) {
9066
+ InDraggedRowIndex = true;
9067
+ }
9068
+ if (InDraggedRowIndex && rows[parseInt(i.toString(), 10)] !== targetRow[0]) {
9069
+ const parentIndexLevelInRow = rows[parseInt(i.toString(), 10)].cells[`${treeColIndex}`].className.match(regex);
9070
+ const parentLevelInRow = +parentIndexLevelInRow[1].match(/\d+/)[0];
9071
+ if (parentLevelInRow !== parentLevel && parentLevelInRow > parentLevel) {
9072
+ childRows.push(rows[parseInt(i.toString(), 10)]);
9073
+ }
9074
+ else {
9075
+ break;
9076
+ }
9077
+ }
9078
+ }
9079
+ if (!isNullOrUndefined(row) && parentLevel === dragParentLevel && ((childRows.length > 0 && !isNullOrUndefined(row[0].getAttribute('aria-rowindex')) && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index + (childRows.length + 1)) || (childRows.length === 0 && !isNullOrUndefined(row[0].getAttribute('aria-rowindex')) && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index + 1))) {
9080
+ isBorderNeed = false;
9081
+ }
9082
+ return true;
9083
+ });
9084
+ isBorderNeed = (!isNullOrUndefined(row) && childRows.length === 0 && !isNullOrUndefined(row[0].getAttribute('aria-rowindex')) && parseInt(row[0].getAttribute('aria-rowindex'), 10) - 1 === index + 1) && isNullOrUndefined(row[0]) ? false : isBorderNeed;
9085
+ }
9086
+ if (this.dropPosition === 'middleSegment') {
9087
+ targetRow.filter((e) => {
9088
+ if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(dragRows[0]) ||
9089
+ isNullOrUndefined(dragRows[0].cells)) {
9090
+ return true;
9091
+ }
9092
+ for (let i = 0; i < dragRows.length; i++) {
9093
+ const regex = /index(\d+)|level(\d+)/g;
9094
+ let dropActualIndex = targetRow[0].rowIndex;
9095
+ const dragIndexLevel = dragRows[parseInt(i.toString(), 10)].cells[`${treeColIndex}`].className.match(regex);
9096
+ if (!dragIndexLevel) {
9097
+ return true;
9098
+ }
9099
+ const dragIndex = parseInt(dragIndexLevel.find((item) => item.includes('index')).match(/\d+/)[0] || '0', 10);
9100
+ if (hasDetailTemplate) {
9101
+ dropActualIndex = dropActualIndex / 2;
9102
+ }
9103
+ if (dragIndex === dropActualIndex && !this.parent.rowDropSettings.targetID) {
9104
+ isBorderNeed = false;
9105
+ }
9106
+ else {
9107
+ isBorderNeed = true;
9108
+ break;
9109
+ }
9110
+ }
9111
+ if (!isBorderNeed) {
9112
+ this.dropPosition = 'Invalid';
9113
+ this.addErrorElem();
9114
+ }
9115
+ return isBorderNeed;
9116
+ });
9117
+ }
9118
+ this.canDrop = isBorderNeed;
9119
+ return isBorderNeed;
9120
+ }
8738
9121
  /**
8739
9122
  * Removes the visual border from all child rows within the TreeGrid.
8740
9123
  *
@@ -8875,23 +9258,27 @@ class RowDD {
8875
9258
  * Applies drop border styles to row elements based on the current drop position ('topSegment' or 'bottomSegment').
8876
9259
  *
8877
9260
  * @param {Element} target - The target element where the drop action is taking place.
9261
+ * @param {boolean} [isBorderNeed=true] - Indicates whether a border is needed during the drop action. Defaults to `true`.
8878
9262
  * @returns {void} No return value.
8879
9263
  */
8880
- topOrBottomBorder(target) {
8881
- let rowElement = [];
9264
+ topOrBottomBorder(target, isBorderNeed = true) {
8882
9265
  const element = closest(target, 'tr');
8883
- rowElement = element ? [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse')) : [];
8884
- if (rowElement.length) {
8885
- if (this.dropPosition === 'topSegment') {
8886
- this.addRemoveClasses(rowElement, true, 'e-droptop');
8887
- if (this.parent.element.getElementsByClassName('e-lastrow-dragborder').length > 0) {
8888
- this.parent.element.getElementsByClassName('e-lastrow-dragborder')[0].remove();
8889
- }
8890
- }
8891
- if (this.dropPosition === 'bottomSegment') {
8892
- this.addRemoveClasses(rowElement, true, 'e-dropbottom');
9266
+ const rowElements = element ?
9267
+ Array.from(element.querySelectorAll('.e-rowcell, .e-rowdragdrop, .e-detailrowcollapse')) : [];
9268
+ if (!rowElements.length) {
9269
+ return;
9270
+ }
9271
+ const classAction = isBorderNeed ? this.addRemoveClasses.bind(this, rowElements, true) : this.addRemoveClasses.bind(this, rowElements, false, 'e-dragborder');
9272
+ if (this.dropPosition === 'topSegment') {
9273
+ classAction('e-droptop');
9274
+ const lastRowDragBorder = this.parent.element.querySelector('.e-lastrow-dragborder');
9275
+ if (lastRowDragBorder) {
9276
+ lastRowDragBorder.remove();
8893
9277
  }
8894
9278
  }
9279
+ if (this.dropPosition === 'bottomSegment') {
9280
+ classAction('e-dropbottom');
9281
+ }
8895
9282
  }
8896
9283
  /**
8897
9284
  * Removes the drop border classes ('e-dropbottom' and 'e-droptop') from the parent element if present.
@@ -8901,6 +9288,9 @@ class RowDD {
8901
9288
  removetopOrBottomBorder() {
8902
9289
  let border = [];
8903
9290
  border = [].slice.call(this.parent.element.querySelectorAll('.e-dropbottom, .e-droptop'));
9291
+ if (this.parent.rowDropSettings.targetID) {
9292
+ border = [].slice.call(document.querySelectorAll('.e-dropbottom, .e-droptop'));
9293
+ }
8904
9294
  if (border.length) {
8905
9295
  this.addRemoveClasses(border, false, 'e-dropbottom');
8906
9296
  this.addRemoveClasses(border, false, 'e-droptop');
@@ -8956,18 +9346,29 @@ class RowDD {
8956
9346
  }
8957
9347
  cloneElement.style.cursor = '';
8958
9348
  const rowEle = args.target ? closest(args.target, 'tr') : null;
8959
- const rowIdx = rowEle ? rowEle.rowIndex : -1;
9349
+ let rowIdx = -1;
9350
+ if (!isNullOrUndefined(this.parent.detailTemplate)) {
9351
+ rowIdx = rowEle ? this.parent.getDataRows().indexOf(rowEle) : -1;
9352
+ }
9353
+ else {
9354
+ rowIdx = rowEle ? rowEle.rowIndex : -1;
9355
+ }
8960
9356
  if (rowIdx === -1) {
8961
9357
  this.canDrop = false;
8962
9358
  this.addErrorElem();
8963
- if (isNullOrUndefined(tObj.rowDropSettings.targetID)) {
8964
- this.removetopOrBottomBorder();
8965
- this.removeChildBorder();
8966
- }
9359
+ this.removetopOrBottomBorder();
9360
+ this.removeChildBorder();
8967
9361
  return;
8968
9362
  }
8969
9363
  const dragRecords = Array.isArray(args.data) ? args.data : [args.data];
8970
- const droppedRecord = tObj.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
9364
+ let droppedRecord = tObj.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
9365
+ if (tObj.rowDropSettings.targetID) {
9366
+ const dropElement = parentsUntil(args.target, 'e-treegrid');
9367
+ if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID) {
9368
+ const srcControl = dropElement.ej2_instances[0];
9369
+ droppedRecord = srcControl.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
9370
+ }
9371
+ }
8971
9372
  this.removeErrorElem();
8972
9373
  this.canDrop = true;
8973
9374
  this.ensuredropPosition(dragRecords, droppedRecord);
@@ -8979,6 +9380,7 @@ class RowDD {
8979
9380
  if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID) {
8980
9381
  const srcControl = dropElement.ej2_instances[0];
8981
9382
  srcControl.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);
9383
+ this.dropPosition = srcControl.rowDragAndDropModule.dropPosition;
8982
9384
  }
8983
9385
  }
8984
9386
  if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID)) {
@@ -8999,13 +9401,13 @@ class RowDD {
8999
9401
  const parentItem = 'parentItem';
9000
9402
  if (!tObj.rowDropSettings.targetID) {
9001
9403
  if (parentsUntil(args.target, 'e-content') || (this.dropPosition === 'Invalid' || !this.canDrop)) {
9002
- if (this.parent.element.querySelector('.e-errorelem')) {
9404
+ if (this.parent.element.querySelector('.e-errorelem') || !this.canDrop) {
9003
9405
  this.dropPosition = 'Invalid';
9004
9406
  }
9005
9407
  setValue('dropPosition', this.dropPosition, args);
9006
9408
  tObj.trigger(rowDrop, args);
9007
9409
  if (!args.cancel) {
9008
- if (!isCountRequired(this.parent) && this.dropPosition === 'Invalid') {
9410
+ if (!isCountRequired(this.parent) && (this.dropPosition === 'Invalid' && !this.canDrop)) {
9009
9411
  return;
9010
9412
  }
9011
9413
  if (!isCountRequired(this.parent)) {
@@ -9022,9 +9424,15 @@ class RowDD {
9022
9424
  else {
9023
9425
  if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
9024
9426
  parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
9427
+ if (this.parent.element.querySelector('.e-errorelem') || !this.canDrop) {
9428
+ this.dropPosition = 'Invalid';
9429
+ }
9025
9430
  setValue('dropPosition', this.dropPosition, args);
9026
9431
  tObj.trigger(rowDrop, args);
9027
9432
  if (!args.cancel && tObj.rowDropSettings.targetID) {
9433
+ if (this.dropPosition === 'Invalid' && !this.canDrop) {
9434
+ return;
9435
+ }
9028
9436
  this.dragDropGrid(args);
9029
9437
  if (tObj.isLocalData) {
9030
9438
  tObj.flatData = this.orderToIndex(tObj.flatData);
@@ -9156,13 +9564,13 @@ class RowDD {
9156
9564
  }
9157
9565
  }
9158
9566
  /**
9159
- * Retrieves the index of the target row based on its 'data-rowindex' attribute.
9567
+ * Retrieves the index of the target row based on its 'aria-rowindex' attribute.
9160
9568
  *
9161
9569
  * @param {Element} targetRow - The target row element from which to retrieve the index.
9162
9570
  * @returns {number} - The index of the target row, or 0 if the targetRow is null or undefined.
9163
9571
  */
9164
9572
  getTargetIdx(targetRow) {
9165
- return targetRow ? parseInt(targetRow.getAttribute('data-rowindex'), 10) : 0;
9573
+ return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) - 1 : 0;
9166
9574
  }
9167
9575
  /**
9168
9576
  * Retrieves the parent data of a given record during a row drag-and-drop operation.
@@ -9225,7 +9633,13 @@ class RowDD {
9225
9633
  this.droppedRecord = tObj.getCurrentViewRecords()[parseInt(index.toString(), 10)];
9226
9634
  }
9227
9635
  else {
9228
- this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
9636
+ if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
9637
+ const rowsObject = this.parent.grid.getRowsObject();
9638
+ this.droppedRecord = rowsObject.length > 0 ? rowsObject[args.dropIndex].data : undefined;
9639
+ }
9640
+ else {
9641
+ this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
9642
+ }
9229
9643
  }
9230
9644
  }
9231
9645
  let dragRecords = [];
@@ -9756,6 +10170,7 @@ class RowDD {
9756
10170
  }
9757
10171
  /**
9758
10172
  * Cleans up resources, event listeners, and DOM elements when the TreeGrid component is destroyed.
10173
+ *
9759
10174
  * @returns {void}
9760
10175
  */
9761
10176
  destroy() {
@@ -9795,7 +10210,7 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
9795
10210
  return c > 3 && r && Object.defineProperty(target, key, r), r;
9796
10211
  };
9797
10212
  /**
9798
- * Configures the row drop settings of the TreeGrid.
10213
+ * Configures the settings for row dragging and dropping within the TreeGrid, allowing for enhanced user interaction and data manipulation capabilities.
9799
10214
  */
9800
10215
  class RowDropSettings extends ChildProperty {
9801
10216
  }
@@ -9835,7 +10250,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9835
10250
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
9836
10251
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
9837
10252
  if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9838
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent))) {
10253
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
10254
+ || notifyArgs.virtualInfo.blockIndexes.length === 1) {
9839
10255
  notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
9840
10256
  }
9841
10257
  }
@@ -9844,7 +10260,7 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9844
10260
  }
9845
10261
  }
9846
10262
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9847
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
10263
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
9848
10264
  return super.generateRows(data, notifyArgs);
9849
10265
  }
9850
10266
  else {
@@ -9865,7 +10281,7 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9865
10281
  const clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',
9866
10282
  'save', 'delete'].some((value) => action === value);
9867
10283
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9868
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
10284
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
9869
10285
  const model = 'model';
9870
10286
  const currentPage = this[`${model}`].currentPage;
9871
10287
  if (clear) {
@@ -10644,7 +11060,7 @@ class Page {
10644
11060
  return newResults;
10645
11061
  }
10646
11062
  updatePageSize(pageingDetails) {
10647
- const updateSize = pageingDetails.result.length;
11063
+ const updateSize = pageingDetails.count;
10648
11064
  const gridPagerModule = this.parent.grid.pagerModule;
10649
11065
  if (this.parent.pageSettings.pageSizes === true) {
10650
11066
  if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {
@@ -11047,7 +11463,7 @@ class Aggregate {
11047
11463
  const cellElement = createElement('td', {
11048
11464
  className: 'e-summary'
11049
11465
  });
11050
- if (this.parent.isReact) {
11466
+ if (this.parent.isReact && typeof (summaryColumn.footerTemplate) !== 'string') {
11051
11467
  const renderReactTemplates = 'renderReactTemplates';
11052
11468
  tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);
11053
11469
  this.parent[`${renderReactTemplates}`]();
@@ -11663,7 +12079,7 @@ class BatchEdit {
11663
12079
  focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
11664
12080
  if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
11665
12081
  const newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];
11666
- const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('data-rowindex'), 10);
12082
+ const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('aria-rowindex'), 10) - 1;
11667
12083
  this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);
11668
12084
  }
11669
12085
  }
@@ -11692,7 +12108,7 @@ class BatchEdit {
11692
12108
  childs = findChildrenRecords(data);
11693
12109
  uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
11694
12110
  }
11695
- const parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('data-rowindex'), 10);
12111
+ const parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10) - 1;
11696
12112
  if (childs.length) {
11697
12113
  const totalCount = parentRowIndex + childs.length;
11698
12114
  const firstChildIndex = parentRowIndex + 1;
@@ -11729,7 +12145,7 @@ class BatchEdit {
11729
12145
  updateRowIndex() {
11730
12146
  const rows = this.parent.grid.getDataRows();
11731
12147
  for (let i = 0; i < rows.length; i++) {
11732
- rows[parseInt(i.toString(), 10)].setAttribute('data-rowindex', i.toString());
12148
+ rows[parseInt(i.toString(), 10)].setAttribute('aria-rowindex', (i + 1).toString());
11733
12149
  }
11734
12150
  }
11735
12151
  updateChildCount(records) {
@@ -11858,7 +12274,7 @@ class BatchEdit {
11858
12274
  if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
11859
12275
  addRecords.reverse();
11860
12276
  for (let i = 0; i < addRecords.length; i++) {
11861
- const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i.toString(), 10)].getAttribute('data-rowindex'), 10);
12277
+ const index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i.toString(), 10)].getAttribute('aria-rowindex'), 10) - 1;
11862
12278
  data.splice(index, 0, addRecords[parseInt(i.toString(), 10)]);
11863
12279
  }
11864
12280
  }
@@ -11998,8 +12414,15 @@ class BatchEdit {
11998
12414
  nextCellIndex(args) {
11999
12415
  const index = 'index';
12000
12416
  const rowIndex = 'rowIndex';
12417
+ const batchChanges = this.parent.getBatchChanges();
12418
+ const deletedRecords = batchChanges.deletedRecords;
12001
12419
  if (this.parent.getSelectedRows().length) {
12002
- args[`${index}`] = this.parent.getSelectedRows()[0][`${rowIndex}`];
12420
+ if (this.isAdd && deletedRecords.length > 0) {
12421
+ args[`${index}`] = this.parent.getSelectedRecords()[0][`${index}`];
12422
+ }
12423
+ else {
12424
+ args[`${index}`] = this.parent.getSelectedRows()[0][`${rowIndex}`];
12425
+ }
12003
12426
  }
12004
12427
  else {
12005
12428
  args[`${index}`] = this.batchIndex;
@@ -12074,7 +12497,7 @@ class Edit {
12074
12497
  }
12075
12498
  if (e.target.classList.contains('e-treegridcollapse') || e.target.classList.contains('e-treegridexpand')) {
12076
12499
  const tr = parentsUntil(e.target, 'e-row');
12077
- const rowIndex = tr && parseInt(tr.getAttribute('data-rowindex'), 10);
12500
+ const rowIndex = tr && parseInt(tr.getAttribute('aria-rowindex'), 10) - 1;
12078
12501
  if (!isNullOrUndefined(rowIndex) && rowIndex >= 0 && this.parent.allowPaging) {
12079
12502
  /* eslint-disable-next-line */
12080
12503
  this.parent.grid.getDataRows()[rowIndex].dataset.uid = this.parent.grid.contentModule.getRows()[rowIndex].uid;
@@ -12243,7 +12666,7 @@ class Edit {
12243
12666
  if (!(this.parent.grid.editSettings.allowEditing) || this.parent.grid.isEdit) {
12244
12667
  return;
12245
12668
  }
12246
- const column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('data-colindex'));
12669
+ const column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex') - 1);
12247
12670
  if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&
12248
12671
  this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||
12249
12672
  target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {
@@ -12251,8 +12674,8 @@ class Edit {
12251
12674
  this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);
12252
12675
  if (this.parent.enableVirtualization) {
12253
12676
  const tr = parentsUntil(args.target, 'e-row');
12254
- this.prevAriaRowIndex = tr.getAttribute('data-rowindex');
12255
- tr.setAttribute('data-rowindex', tr.rowIndex + '');
12677
+ this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');
12678
+ tr.setAttribute('aria-rowindex', (tr.rowIndex + 1) + '');
12256
12679
  }
12257
12680
  this.updateGridEditMode('Batch');
12258
12681
  }
@@ -12295,7 +12718,7 @@ class Edit {
12295
12718
  const prom = args[`${promise}`];
12296
12719
  delete args[`${promise}`];
12297
12720
  if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
12298
- args.row.setAttribute('data-rowindex', this.prevAriaRowIndex);
12721
+ args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
12299
12722
  this.prevAriaRowIndex = undefined;
12300
12723
  }
12301
12724
  if (this.keyPress !== 'enter') {
@@ -12618,8 +13041,8 @@ class Edit {
12618
13041
  }
12619
13042
  }
12620
13043
  const rows = this.parent.grid.getDataRows();
12621
- const firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
12622
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
13044
+ const firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') - 1 : 0;
13045
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
12623
13046
  const withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
12624
13047
  const isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
12625
13048
  if (this.parent.editSettings.mode !== 'Dialog') {
@@ -12670,7 +13093,7 @@ class Edit {
12670
13093
  if (isVirtualization) {
12671
13094
  this.prevAriaRowIndex = '-1';
12672
13095
  }
12673
- if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
13096
+ if (!this.parent.enableVirtualization || this.parent.enableVirtualization) {
12674
13097
  this.isScrollByFocus = true;
12675
13098
  focussedElement.focus();
12676
13099
  }
@@ -12762,7 +13185,7 @@ class Edit {
12762
13185
  this.selectedIndex = this.parent.grid.selectedRowIndex;
12763
13186
  }
12764
13187
  if (this.parent.enableVirtualization) {
12765
- let selector = '.e-row[data-rowindex="' + this.selectedIndex + '"]';
13188
+ let selector = '.e-row[aria-rowindex="' + (this.selectedIndex + 1) + '"]';
12766
13189
  let row;
12767
13190
  if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&
12768
13191
  this.parent.editSettings.newRowPosition !== 'Bottom') {
@@ -12772,7 +13195,7 @@ class Edit {
12772
13195
  }
12773
13196
  else {
12774
13197
  if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {
12775
- selector = '.e-row[data-rowindex="' + this.prevAriaRowIndex + '"]';
13198
+ selector = '.e-row[aria-rowindex="' + (this.prevAriaRowIndex + 1) + '"]';
12776
13199
  row = this.parent.getContent().querySelector(selector);
12777
13200
  this.addRowIndex = row ? row.rowIndex : 0;
12778
13201
  }
@@ -12865,7 +13288,7 @@ class Edit {
12865
13288
  const isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
12866
13289
  const rows = this.parent.getRows();
12867
13290
  const firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
12868
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
13291
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
12869
13292
  const withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
12870
13293
  this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
12871
13294
  if (currentData.length) {
@@ -13059,7 +13482,7 @@ class Edit {
13059
13482
  closeEdit() {
13060
13483
  if (this.parent.enableVirtualization && this.parent.grid.editSettings.mode === 'Batch' && this.parent.grid.pageSettings.currentPage > 1) {
13061
13484
  this.editedRowIndex = this.parent.grid.editModule.editModule['cellDetails'].rowIndex;
13062
- this.parent.grid.editModule.editModule['cellDetails'].rowIndex = parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule['cellDetails'].rowIndex].getAttribute('data-rowIndex'), 10);
13485
+ this.parent.grid.editModule.editModule['cellDetails'].rowIndex = parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule['cellDetails'].rowIndex].getAttribute('aria-rowIndex'), 10) - 1;
13063
13486
  }
13064
13487
  this.parent.grid.editModule.closeEdit();
13065
13488
  }
@@ -13211,6 +13634,11 @@ class DetailRow {
13211
13634
  }
13212
13635
  }
13213
13636
 
13637
+ /**
13638
+ * VirtualTreeContentRenderer
13639
+ *
13640
+ * @hidden
13641
+ */
13214
13642
  class VirtualTreeContentRenderer extends VirtualContentRenderer {
13215
13643
  constructor(parent, locator) {
13216
13644
  super(parent, locator);
@@ -13230,23 +13658,45 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13230
13658
  getModelGenerator() {
13231
13659
  return new TreeVirtualRowModelGenerator(this.parent);
13232
13660
  }
13661
+ /**
13662
+ * Retrieves the row element for a given row index.
13663
+ *
13664
+ * @param {number} index - The index of the row to retrieve.
13665
+ * @returns {Element} The row element at the specified index.
13666
+ */
13233
13667
  getRowByIndex(index) {
13234
13668
  if (this.parent.enableVirtualization && this.parent.isFrozenGrid()) {
13235
13669
  return this.getRowCollection(index, true);
13236
13670
  }
13237
13671
  const dataRows = this.parent.getDataRows();
13238
- const targetRow = dataRows.find((e) => parseInt(e.getAttribute('data-rowindex'), 10) === index);
13672
+ const targetRow = dataRows.find((e) => parseInt(e.getAttribute('aria-rowindex'), 10) - 1 === index);
13239
13673
  if (!targetRow && this.parent.isEdit && this.parent.editSettings.mode === 'Batch') {
13240
13674
  return index != null ? this.parent.getRows()[parseInt(index.toString(), 10)] : undefined;
13241
13675
  }
13242
13676
  return targetRow;
13243
13677
  }
13678
+ /**
13679
+ * Retrieves the frozen right virtual row element by its index.
13680
+ *
13681
+ * @param {number} index - The index of the row to be retrieved.
13682
+ * @returns {Element} The DOM element representing the frozen right virtual row.
13683
+ */
13244
13684
  getFrozenRightVirtualRowByIndex(index) {
13245
13685
  return this.getRowCollection(index, false, false, true);
13246
13686
  }
13687
+ /**
13688
+ * Retrieves the row or record from the virtual tree grid based on the provided index.
13689
+ * Considers conditions such as frozen rows and pagination for accurate retrieval.
13690
+ *
13691
+ * @param {number} index - The index of the desired row or record.
13692
+ * @param {boolean} isMovable - Specifies if the content is movable.
13693
+ * @param {boolean} [isRowObject] - Optional. Determines if the return value should be a row object.
13694
+ * @param {boolean} [isFrozenRight] - Optional. Used for determining frozen right rows.
13695
+ * @returns {Element | Object} - The HTML element or row object.
13696
+ */
13247
13697
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
13248
13698
  getRowCollection(index, isMovable, isRowObject, isFrozenRight) {
13249
- const startIdx = parseInt(this.parent.getRows()[0].getAttribute(dataRowIndex), 10);
13699
+ const startIdx = parseInt(this.parent.getRows()[0].getAttribute(ariaRowIndex), 10) - 1;
13250
13700
  const rowCollection = this.parent.getDataRows();
13251
13701
  const collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
13252
13702
  let selectedRow = collection[index - startIdx];
@@ -13260,12 +13710,27 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13260
13710
  this.parent.getRowsObject()[parseInt(index.toString(), 10)].data : selectedRow;
13261
13711
  }
13262
13712
  }
13713
+ if (selectedRow == null && index != null && this.parent.editSettings.mode === 'Batch' && this.parent.isEdit && isMovable) {
13714
+ selectedRow = rowCollection[parseInt(index.toString(), 10)];
13715
+ }
13263
13716
  return selectedRow;
13264
13717
  }
13718
+ /**
13719
+ * @hidden
13720
+ * @returns {void}
13721
+ */
13265
13722
  addEventListener() {
13266
13723
  this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
13267
13724
  this.parent.on(indexModifier, this.indexModifier, this);
13268
13725
  }
13726
+ /**
13727
+ * Handles virtual scrolling actions based on the provided arguments.
13728
+ *
13729
+ * @param {Object} args - The argument object.
13730
+ * @param {boolean} args.setTop - Determines if the virtual scroll position should reset to top.
13731
+ * @param {boolean} args.isExpandCollapse - Determines if the action is part of an expand/collapse operation.
13732
+ * @returns {void}
13733
+ */
13269
13734
  virtualOtherAction(args) {
13270
13735
  if (args.setTop) {
13271
13736
  this.translateY = 0;
@@ -13276,10 +13741,22 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13276
13741
  this.isExpandCollapse = true;
13277
13742
  }
13278
13743
  }
13744
+ /**
13745
+ * Modifies the index based on various conditions such as record addition, deletion, or data source changes.
13746
+ *
13747
+ * @private
13748
+ * @param {Object} args - Contains parameters for the current operation.
13749
+ * @param {number} args.startIndex - The starting index for the modification.
13750
+ * @param {number} args.endIndex - The ending index for the modification.
13751
+ * @param {number} args.count - The number of items affected in the operation.
13752
+ * @param {string} args.requestType - The type of request, such as 'insert', 'delete', or 'update'.
13753
+ * @returns {void}
13754
+ */
13279
13755
  indexModifier(args) {
13280
13756
  const content = this.parent.getContent().querySelector('.e-content');
13757
+ const pageSize = this.parent.pageSettings.pageSize;
13281
13758
  if ((this.recordAdded || args.requestType === 'delete' && this.endIndex > args.count - this.parent.pageSettings.pageSize) && this.startIndex > -1 && this.endIndex > -1) {
13282
- if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {
13759
+ if (this.endIndex > args.count - pageSize) {
13283
13760
  const nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
13284
13761
  let lastIndex = nextSetResIndex + this.parent.getRows().length;
13285
13762
  if (lastIndex > args.count) {
@@ -13297,12 +13774,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13297
13774
  }
13298
13775
  if (this.isDataSourceChanged) {
13299
13776
  this.startIndex = 0;
13300
- this.endIndex = this.parent.pageSettings.pageSize - 1;
13777
+ this.endIndex = pageSize - 1;
13301
13778
  }
13302
- if ((this.endIndex - this.startIndex !== this.parent.pageSettings.pageSize) &&
13303
- (this.totalRecords > this.parent.pageSettings.pageSize)
13779
+ if ((this.endIndex - this.startIndex !== pageSize) &&
13780
+ (this.totalRecords > pageSize)
13304
13781
  && (this.endIndex === this.totalRecords)) {
13305
- args.startIndex = this.endIndex - this.parent.pageSettings.pageSize;
13782
+ args.startIndex = this.endIndex - pageSize;
13306
13783
  args.endIndex = this.endIndex;
13307
13784
  }
13308
13785
  else {
@@ -13310,6 +13787,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13310
13787
  args.endIndex = this.endIndex;
13311
13788
  }
13312
13789
  }
13790
+ /**
13791
+ * Handles the addition or removal of event listeners for virtual scrolling in a TreeGrid.
13792
+ *
13793
+ * @param {string} action - The action to perform, either 'on' or 'off'.
13794
+ * @returns {void}
13795
+ */
13313
13796
  eventListener(action) {
13314
13797
  if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13315
13798
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
@@ -13335,6 +13818,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13335
13818
  this.parent.addEventListener('rowSelected', this.rowSelectedEvent.bind(this));
13336
13819
  this.parent[`${action}`]('select-virtual-Row', this.toSelectVirtualRow, this);
13337
13820
  this.parent.on('content-ready', this.fn, this);
13821
+ this.parent.addEventListener(actionBegin, this.handleActionBegin.bind(this));
13338
13822
  this.parent.addEventListener(actionComplete, this.onActionComplete.bind(this));
13339
13823
  this.parent[`${action}`]('virtual-scroll-edit-action-begin', this.beginEdit, this);
13340
13824
  this.parent[`${action}`]('virtual-scroll-add-action-begin', this.beginAdd, this);
@@ -13345,15 +13829,30 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13345
13829
  this.parent[`${action}`]('select-row-on-context-open', this.toSelectRowOnContextOpen, this);
13346
13830
  this.parent[`${action}`]('refresh-virtual-editform-cells', this.refreshCell, this);
13347
13831
  this.parent[`${action}`]('virtaul-cell-focus', this.cellFocus, this);
13832
+ this.parent[`${action}`]('virtual-scroll-edit', this.restoreEditState, this);
13348
13833
  }
13349
13834
  else {
13350
13835
  super.eventListener('on');
13351
13836
  }
13352
13837
  }
13838
+ /**
13839
+ * Handles cell focus transitions in a virtualized tree grid component
13840
+ * when a keyboard event is triggered.
13841
+ *
13842
+ * @param {KeyboardEventArgs} e - The keyboard event arguments that contain
13843
+ * information about the key action.
13844
+ * @returns {void}
13845
+ */
13353
13846
  cellFocus(e) {
13354
13847
  const virtualCellFocus = 'virtualCellFocus';
13355
13848
  super[`${virtualCellFocus}`](e);
13356
13849
  }
13850
+ /**
13851
+ * Handles the data ready event for the virtual tree grid content renderer.
13852
+ *
13853
+ * @param {NotifyArgs} [e] - The notification arguments that contain information about the data.
13854
+ * @returns {void}
13855
+ */
13357
13856
  onDataReady(e) {
13358
13857
  super.onDataReady(e);
13359
13858
  if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
@@ -13378,6 +13877,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13378
13877
  }
13379
13878
  }
13380
13879
  }
13880
+ /**
13881
+ * Renders the table for the virtual tree content. It sets up a new `TreeInterSectionObserver`
13882
+ * based on certain conditions regarding the data source and counting requirements.
13883
+ *
13884
+ * @returns {void}
13885
+ */
13381
13886
  renderTable() {
13382
13887
  super.renderTable();
13383
13888
  if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
@@ -13387,6 +13892,17 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13387
13892
  this.contents = this.getPanel().firstChild;
13388
13893
  }
13389
13894
  }
13895
+ /**
13896
+ * Calculates the translateY value for a virtual tree grid based on the scroll top, container height,
13897
+ * and additional virtual scrolling information. This method specifically handles logic for remote
13898
+ * data sources and ensures smooth scrolling with respect to expansion states.
13899
+ *
13900
+ * @param {number} sTop - The scroll top position.
13901
+ * @param {number} cHeight - The height of the container.
13902
+ * @param {VirtualInfo} [info] - Optional virtual scrolling information.
13903
+ * @param {boolean} [isOnenter] - Flag indicating if the scroll event is on enter.
13904
+ * @returns {number} The calculated translateY value.
13905
+ */
13390
13906
  getTranslateY(sTop, cHeight, info, isOnenter) {
13391
13907
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13392
13908
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
@@ -13394,15 +13910,15 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13394
13910
  this.isRemoteExpand = false;
13395
13911
  return this.preTranslate;
13396
13912
  }
13397
- else {
13398
- this.preTranslate = super.getTranslateY(sTop, cHeight, info, isOnenter);
13399
- return super.getTranslateY(sTop, cHeight, info, isOnenter);
13400
- }
13401
- }
13402
- else {
13403
- return super.getTranslateY(sTop, cHeight, info, isOnenter);
13913
+ this.preTranslate = super.getTranslateY(sTop, cHeight, info, isOnenter);
13404
13914
  }
13915
+ return super.getTranslateY(sTop, cHeight, info, isOnenter);
13405
13916
  }
13917
+ /**
13918
+ * Handles the dataBound event to calculate and set the initial row top position for the grid.
13919
+ *
13920
+ * @returns {void}
13921
+ */
13406
13922
  dataBoundEvent() {
13407
13923
  const dataBoundEve = 'dataBound';
13408
13924
  const initialRowTop = 'initialRowTop';
@@ -13419,11 +13935,27 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13419
13935
  }
13420
13936
  super[`${dataBoundEve}`]();
13421
13937
  }
13938
+ /**
13939
+ * Handles the row selection event for virtual tree grid rows.
13940
+ * It invokes the base class's rowSelected method and notifies
13941
+ * the parent component about a virtual transformation change.
13942
+ *
13943
+ * @param {RowSelectEventArgs} args - The arguments related to the row selection event.
13944
+ * @returns {void} This method does not return a value.
13945
+ */
13422
13946
  rowSelectedEvent(args) {
13423
13947
  const rowSelected = 'rowSelected';
13424
13948
  super[`${rowSelected}`](args);
13425
13949
  this.parent.notify('virtualTransform', { requestType: 'transformChange' });
13426
13950
  }
13951
+ /**
13952
+ * Handles virtual row selection in TreeGrid.
13953
+ *
13954
+ * @param {Object} args - The argument object containing the selected index.
13955
+ * @param {number} args.selectedIndex - The index of the row to be selected.
13956
+ *
13957
+ * @returns {void}
13958
+ */
13427
13959
  toSelectVirtualRow(args) {
13428
13960
  if (this.parent.isEdit) {
13429
13961
  return;
@@ -13446,9 +13978,20 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13446
13978
  super[`${selectVirtualRow}`](args);
13447
13979
  }
13448
13980
  }
13981
+ /**
13982
+ * Refreshes the cells for the given row object by regenerating them.
13983
+ *
13984
+ * @param {Row<Column>} rowObj - The row object for which the cells need to be refreshed.
13985
+ * @returns {void} This method does not return any value.
13986
+ */
13449
13987
  refreshCell(rowObj) {
13450
13988
  rowObj.cells = this.generateCells();
13451
13989
  }
13990
+ /**
13991
+ * Generates an array of cells for each column in the parent.
13992
+ *
13993
+ * @returns {Cell<Column>[]} An array of cells for the corresponding columns.
13994
+ */
13452
13995
  generateCells() {
13453
13996
  const cells = [];
13454
13997
  for (let i = 0; i < this.parent.columns.length; i++) {
@@ -13456,6 +13999,18 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13456
13999
  }
13457
14000
  return cells;
13458
14001
  }
14002
+ /**
14003
+ * Generates a cell object with provided column and row configurations.
14004
+ *
14005
+ * @param {Column} col - The Column object which holds the column configuration.
14006
+ * @param {string} [rowId] - An optional string that represents the row ID.
14007
+ * @param {CellType} [cellType] - An optional CellType enum to specify the type of the cell.
14008
+ * @param {number} [colSpan] - An optional number to specify the column span of the cell.
14009
+ * @param {number} [oIndex] - An optional number for the order index of the cell.
14010
+ * @param {Object} [foreignKeyData] - An optional object for foreign key data associated with the column.
14011
+ *
14012
+ * @returns {Cell<Column>} Returns a newly created Cell object of type Column.
14013
+ */
13459
14014
  generateCell(col, rowId, cellType, colSpan, oIndex, foreignKeyData) {
13460
14015
  const opt = {
13461
14016
  'visible': col.visible,
@@ -13474,13 +14029,29 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13474
14029
  }
13475
14030
  return new Cell(opt);
13476
14031
  }
14032
+ /**
14033
+ * Begins the edit operation for a specified row in the grid.
14034
+ * Updates the `editedRowIndex` and assigns row data to the event data.
14035
+ *
14036
+ * @param {{ data: Object, index: number }} e - An object containing the row data and index.
14037
+ * @param {Object} e.data - The data of the row to be edited.
14038
+ * @param {number} e.index - The index of the row to be edited.
14039
+ * @returns {void}
14040
+ */
13477
14041
  beginEdit(e) {
13478
14042
  this['editedRowIndex'] = e.index;
13479
- const selector = '.e-row[data-rowindex="' + e.index + '"]';
14043
+ const selector = '.e-row[aria-rowindex="' + (e.index + 1) + '"]';
13480
14044
  const index = this.parent.getContent().querySelector(selector).rowIndex;
13481
14045
  const rowData = this.parent.getCurrentViewRecords()[parseInt(index.toString(), 10)];
13482
14046
  e.data = rowData;
13483
14047
  }
14048
+ /**
14049
+ * Begins the process of adding a new row in the tree grid.
14050
+ *
14051
+ * @param {Object} args - The arguments for adding a new row.
14052
+ * @param {boolean} args.startEdit - A flag indicating whether to start editing.
14053
+ * @returns {void}
14054
+ */
13484
14055
  beginAdd(args) {
13485
14056
  const addAction = 'addActionBegin';
13486
14057
  const isAdd = 'isAdd';
@@ -13490,8 +14061,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13490
14061
  this.addRowIndex = addArgs.addRowIndex;
13491
14062
  this.dataRowIndex = addArgs.dataRowIndex;
13492
14063
  const rows = this.parent.getRows();
13493
- const firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
13494
- const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
14064
+ const firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') - 1 : 0;
14065
+ const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
13495
14066
  const withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;
13496
14067
  if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
13497
14068
  this[`${isAdd}`] = true;
@@ -13501,10 +14072,21 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13501
14072
  super[`${addAction}`](args);
13502
14073
  }
13503
14074
  }
14075
+ /**
14076
+ * Restores the edit state of the tree grid content. This method calls the
14077
+ * base class method to handle the restoration logic.
14078
+ *
14079
+ * @returns {void} This method does not return any value.
14080
+ */
13504
14081
  restoreEditState() {
13505
14082
  const restoreEdit = 'restoreEdit';
13506
14083
  super[`${restoreEdit}`]();
13507
14084
  }
14085
+ /**
14086
+ * Resets the edit state if certain conditions are met.
14087
+ *
14088
+ * @returns {void}
14089
+ */
13508
14090
  resetIseditValue() {
13509
14091
  const resetIsEdit = 'resetIsedit';
13510
14092
  const isAdd = 'isAdd';
@@ -13513,6 +14095,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13513
14095
  super[`${resetIsEdit}`]();
13514
14096
  }
13515
14097
  }
14098
+ /**
14099
+ * Handles the successful editing operation when virtual scrolling is enabled.
14100
+ * Checks if a row has been added to the tree grid and sets the `recordAdded` flag accordingly.
14101
+ *
14102
+ * @returns {void}
14103
+ */
13516
14104
  virtualEditSuccess() {
13517
14105
  const isAdd = 'isAdd';
13518
14106
  const content = this.parent.getContent().querySelector('.e-content');
@@ -13520,14 +14108,33 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13520
14108
  this.recordAdded = true;
13521
14109
  }
13522
14110
  }
14111
+ /**
14112
+ * Cancels the edit operation for the provided data.
14113
+ *
14114
+ * @param {Object} args - The arguments containing the data to cancel edit for.
14115
+ * @param {Object} args.data - The specific data object for which the edit operation needs to be canceled.
14116
+ * @returns {void}
14117
+ */
13523
14118
  cancelEdit(args) {
13524
14119
  const editCancel = 'editCancel';
13525
14120
  super[`${editCancel}`](args);
13526
14121
  }
14122
+ /**
14123
+ * Handles the action of selecting a row when the context menu is opened.
14124
+ *
14125
+ * @param {Object} args - An object containing related parameters.
14126
+ * @param {boolean} args.isOpen - A flag indicating whether the context menu is open.
14127
+ * @returns {void} This method does not return any value.
14128
+ */
13527
14129
  toSelectRowOnContextOpen(args) {
13528
14130
  const selectRowOnContextOpen = 'selectRowOnContextOpen';
13529
14131
  super[`${selectRowOnContextOpen}`](args);
13530
14132
  }
14133
+ /**
14134
+ * Restores a new row in the grid when necessary by adding it back to the content.
14135
+ *
14136
+ * @returns {void} This method does not return any value.
14137
+ */
13531
14138
  restoreNewRow() {
13532
14139
  const isAdd = 'isAdd';
13533
14140
  const content = this.parent.getContent().querySelector('.e-content');
@@ -13536,10 +14143,41 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13536
14143
  this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
13537
14144
  }
13538
14145
  }
14146
+ /**
14147
+ * Retrieves virtual data for operations like adding or canceling rows in the grid.
14148
+ *
14149
+ * @param {Object} data - An object containing properties to determine the virtual data processing.
14150
+ * @param {Object} data.virtualData - The virtual data object to be processed.
14151
+ * @param {boolean} data.isAdd - A boolean indicating if the operation is an addition.
14152
+ * @param {boolean} data.isCancel - A boolean indicating if the operation is a cancellation.
14153
+ * @returns {void} This method does not return any value.
14154
+ */
13539
14155
  getData(data) {
13540
14156
  const getVirtualData = 'getVirtualData';
13541
14157
  super[`${getVirtualData}`](data);
13542
14158
  }
14159
+ /**
14160
+ * Initiates the beginning of an action within the tree grid component.
14161
+ * This method is invoked before any action is performed, allowing for
14162
+ * any necessary modifications or cancellations of the upcoming action.
14163
+ *
14164
+ * @param {NotifyArgs} args - The arguments associated with the action,
14165
+ * providing context and specifics about what is being commenced.
14166
+ * @returns {void}
14167
+ */
14168
+ handleActionBegin(args) {
14169
+ const actionBegin = 'actionBegin';
14170
+ super[`${actionBegin}`](args);
14171
+ }
14172
+ /**
14173
+ * Handles the completion of various actions, such as adding a new row.
14174
+ * Updates row positions and indexes based on the action completed.
14175
+ *
14176
+ * @param {NotifyArgs} args - An object containing the details of the completed action.
14177
+ * Specifically, it includes the `requestType` which determines the type
14178
+ * of action that was completed.
14179
+ * @returns {void} This method does not return any value.
14180
+ */
13543
14181
  onActionComplete(args) {
13544
14182
  if (args.requestType === 'add') {
13545
14183
  const addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
@@ -13551,6 +14189,19 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13551
14189
  const actionComplete = 'actionComplete';
13552
14190
  super[`${actionComplete}`](args);
13553
14191
  }
14192
+ /**
14193
+ * Creates a callback function to be executed during virtual scrolling actions.
14194
+ * This function handles the adjustment of virtual elements and rendering logic,
14195
+ * particularly optimizing for non-IE browsers, wheel events, and virtual masks.
14196
+ *
14197
+ * @returns {Function} A function that handles scrolling and adjusts table rendering.
14198
+ * @param {HTMLElement} element - The HTML element involved in the action.
14199
+ * @param {SentinelType} current - The type of sentinel indicating the scroll.
14200
+ * @param {string} direction - The scroll direction.
14201
+ * @param {Offsets} e - The offset values indicating the current scroll position.
14202
+ * @param {boolean} isWheel - Indicates if the scrolling was initiated by a mouse wheel.
14203
+ * @param {boolean} check - A boolean flag for additional control logic.
14204
+ */
13554
14205
  onEnteredAction() {
13555
14206
  return (element, current, direction, e, isWheel, check) => {
13556
14207
  const directVirtualRender = 'directVirtualRender';
@@ -13592,8 +14243,17 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13592
14243
  }
13593
14244
  };
13594
14245
  }
14246
+ /**
14247
+ * Handles scroll events to manage virtual scrolling and row rendering.
14248
+ * Adjusts view information, row indexes, and translates viewport positioning
14249
+ * based on the given scroll arguments.
14250
+ *
14251
+ * @param {ScrollArg} scrollArgs - Contains the scroll offsets, sentinel information, direction of scroll, and other related details.
14252
+ * @returns {void} - No return value. It adjusts scrolling state internally.
14253
+ */
13595
14254
  scrollListeners(scrollArgs) {
13596
14255
  this['scrollAfterEdit']();
14256
+ this.shouldPreventScrolling(scrollArgs);
13597
14257
  if (this.parent.root.enablePersistence) {
13598
14258
  this.parent.root.scrollPosition = scrollArgs.offset;
13599
14259
  }
@@ -13613,9 +14273,11 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13613
14273
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
13614
14274
  const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
13615
14275
  this.parent.element.getBoundingClientRect().height);
13616
- let index = (~~(content.scrollTop / rowHeight)
13617
- + Math.ceil(vHeight / rowHeight))
13618
- - this.parent.pageSettings.pageSize;
14276
+ // Calculate the integer number of rows that are scrolled past plus the number of rows that fit within the visible height
14277
+ const scrolledRows = Math.floor(content.scrollTop / rowHeight);
14278
+ const visibleRows = Math.ceil(vHeight / rowHeight);
14279
+ // Calculate the index by subtracting the page size from the total rows taken into account
14280
+ let index = scrolledRows + visibleRows - this.parent.pageSettings.pageSize;
13619
14281
  index = (index > 0) ? index : 0;
13620
14282
  if (!isNullOrUndefined(this[`${selectedRowIndex}`]) && this[`${selectedRowIndex}`] !== -1 && index !== this[`${selectedRowIndex}`] &&
13621
14283
  ((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop) && !this.parent.allowRowDragAndDrop) {
@@ -13692,20 +14354,19 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13692
14354
  this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
13693
14355
  this.startIndex = currentViewData[0][`${indexValue}`] + (this.parent.pageSettings.pageSize / 2);
13694
14356
  }
13695
- if (this.parent.root.isSelfReference) {
13696
- const selectedIndex = this.parent.root.selectedRowIndex;
13697
- this.startIndex = selectedIndex !== -1 && selectedIndex !== this.startIndex ? this.startIndex - 1 : this.startIndex;
13698
- }
13699
14357
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
13700
14358
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
13701
14359
  }
13702
14360
  else {
13703
14361
  if (this.totalRecords === this.endIndex) {
13704
- if (isLastBlock) {
13705
- this.translateY = (this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight);
13706
- }
13707
- else {
13708
- this.translateY = (this.totalRecords * rowHeight) - ((this.endIndex - this.startIndex) * rowHeight);
14362
+ if (this.totalRecords === this.endIndex) {
14363
+ if (this.parent.isEdit) {
14364
+ this.translateY = ((this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight))
14365
+ + rowHeight;
14366
+ }
14367
+ else {
14368
+ this.translateY = (this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight);
14369
+ }
13709
14370
  }
13710
14371
  }
13711
14372
  else {
@@ -13718,24 +14379,23 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13718
14379
  }
13719
14380
  }
13720
14381
  }
13721
- if (isRemoteData(this.parent) || ((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14382
+ if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
13722
14383
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
13723
14384
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13724
14385
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
13725
14386
  const viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
13726
14387
  this.previousInfo = viewInfo;
13727
- if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14388
+ if (this.prevInfo && viewInfo.event !== 'refresh-virtual-block' && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
13728
14389
  || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
13729
14390
  || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
13730
14391
  && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
13731
14392
  this.parent.removeMaskRow();
13732
- this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });
13733
14393
  if (Browser.isIE) {
13734
14394
  this.parent.hideSpinner();
13735
14395
  }
13736
14396
  this.requestType = this.requestType === 'virtualscroll' ? this['empty'] : this.requestType;
13737
14397
  if (info.axis === 'Y') {
13738
- this['restoreEdit']();
14398
+ this.restoreEditState();
13739
14399
  }
13740
14400
  return;
13741
14401
  }
@@ -13763,9 +14423,32 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13763
14423
  }
13764
14424
  }
13765
14425
  }
14426
+ /**
14427
+ * Prevents scrolling under specific conditions related to adding a new row.
14428
+ *
14429
+ * @param {ScrollArg} scrollArgs - The scroll event arguments containing offset details.
14430
+ * @returns {void}
14431
+ */
14432
+ shouldPreventScrolling(scrollArgs) {
14433
+ const addedRow = this.parent.element.querySelector('.e-addedrow');
14434
+ if (addedRow && this.rowPosition !== 'Top' && this.rowPosition !== 'Bottom' && scrollArgs.offset.top !== 0) {
14435
+ this.parent.closeEdit();
14436
+ return;
14437
+ }
14438
+ }
14439
+ /**
14440
+ * Appends content to the target element. Handles dynamic adjustments for remote data sources,
14441
+ * frozen columns, and virtual scrolling.
14442
+ *
14443
+ * @param {HTMLElement} target - The target HTML element where content is to be appended.
14444
+ * @param {DocumentFragment} newChild - The new content as a DocumentFragment to append.
14445
+ * @param {NotifyArgs} e - Object containing information about the operation.
14446
+ * @returns {void}
14447
+ */
13766
14448
  appendContent(target, newChild, e) {
13767
14449
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13768
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
14450
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
14451
+ || (this.parent.isFrozenGrid() && (e.requestType === undefined || !isNullOrUndefined(e.virtualInfo) && (e.virtualInfo.direction === 'right' || e.virtualInfo.direction === 'left')))) {
13769
14452
  if (getValue('isExpandCollapse', e)) {
13770
14453
  this.isRemoteExpand = true;
13771
14454
  }
@@ -13793,6 +14476,9 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13793
14476
  target.appendChild(newChild);
13794
14477
  const replace = 'replaceWith';
13795
14478
  this.getTable().querySelector('tbody')[`${replace}`](target);
14479
+ if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
14480
+ this.isExpandCollapse = false;
14481
+ }
13796
14482
  if (!this.isExpandCollapse || this.translateY === 0) {
13797
14483
  this.translateY = this.translateY < 0 ? 0 : this.translateY;
13798
14484
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
@@ -13825,6 +14511,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13825
14511
  super[`${ensureSelectedRowPosition}`]();
13826
14512
  }
13827
14513
  }
14514
+ /**
14515
+ * Unsubscribes all event listeners to prevent memory leaks.
14516
+ * This method is called when the component is being destroyed or when event listeners need to be cleaned up.
14517
+ *
14518
+ * @returns {void}
14519
+ */
13828
14520
  removeEventListener() {
13829
14521
  if (this.parent.isDestroyed) {
13830
14522
  return;
@@ -13845,6 +14537,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13845
14537
  this.parent.off('select-row-on-context-open', this.toSelectRowOnContextOpen);
13846
14538
  this.parent.off('refresh-virtual-editform-cells', this.refreshCell);
13847
14539
  this.parent.off('virtaul-cell-focus', this.cellFocus);
14540
+ this.parent.off('virtual-scroll-edit', this.restoreEditState);
13848
14541
  }
13849
14542
  }
13850
14543
  class TreeInterSectionObserver extends InterSectionObserver {
@@ -13855,6 +14548,15 @@ class TreeInterSectionObserver extends InterSectionObserver {
13855
14548
  this.lastPos = 0;
13856
14549
  this.timer = 0;
13857
14550
  }
14551
+ /**
14552
+ * Sets up observers to monitor scroll events on a given container
14553
+ * and its movable companion within a virtual grid setup.
14554
+ *
14555
+ * @param {Function} callback - Function to call when a scroll event is detected.
14556
+ * @param {Function} onEnterCallback - Function to call when a specific event, like entering a region, is detected.
14557
+ * @param {IGrid} instance - The grid instance that requires observation.
14558
+ * @returns {void}
14559
+ */
13858
14560
  observes(callback, onEnterCallback, instance) {
13859
14561
  const containerRect = 'containerRect';
13860
14562
  super[`${containerRect}`] = getValue('options', this).container.getBoundingClientRect();
@@ -13865,9 +14567,23 @@ class TreeInterSectionObserver extends InterSectionObserver {
13865
14567
  EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback, instance), this);
13866
14568
  }
13867
14569
  }
14570
+ /**
14571
+ * Clears the last known position.
14572
+ *
14573
+ * @returns {void} No value is returned from this function.
14574
+ */
13868
14575
  clear() {
13869
14576
  this.lastPos = null;
13870
14577
  }
14578
+ /**
14579
+ * Handles virtual scrolling events and manages scroll direction and debouncing for rendering updates.
14580
+ *
14581
+ * @private
14582
+ * @param {Function} callback - Function to call on scroll end.
14583
+ * @param {Function} onEnterCallback - Function to call on entering a virtual scrolling area.
14584
+ * @param {IGrid} instance - The grid instance on which virtual scrolling is being implemented.
14585
+ * @returns {Function} - A function that processes scroll events.
14586
+ */
13871
14587
  virtualScrollHandlers(callback, onEnterCallback, instance) {
13872
14588
  const delay = Browser.info.name === 'chrome' ? 200 : 100;
13873
14589
  const options = 'options';
@@ -13963,9 +14679,6 @@ class VirtualScroll {
13963
14679
  Grid.Inject(TreeVirtual);
13964
14680
  this.addEventListener();
13965
14681
  }
13966
- returnVisualData(args) {
13967
- args.data = this.visualData;
13968
- }
13969
14682
  /**
13970
14683
  * For internal use only - Get the module name.
13971
14684
  *
@@ -13999,28 +14712,58 @@ class VirtualScroll {
13999
14712
  this.parent.off(pagingActions, this.virtualPageAction);
14000
14713
  this.parent.off(destroy, this.destroy);
14001
14714
  }
14715
+ /**
14716
+ * Handles the virtual child collapse or expand action in a tree grid.
14717
+ *
14718
+ * @param {object} row - Object containing information about the collapse/expand action.
14719
+ * @param {string} row.action - The type of action, either "collapse" or "expand".
14720
+ * @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
14721
+ * @param {ITreeData} row.record - The tree data record associated with the row.
14722
+ * @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
14723
+ *
14724
+ * @returns {void} No return value as the function executes a procedure.
14725
+ */
14002
14726
  collapseExpandVirtualchilds(row) {
14003
14727
  this.parent.grid.notify(virtualActionArgs, { isExpandCollapse: true });
14004
14728
  this.expandCollapseRec = row.record;
14005
14729
  row.record.expanded = row.action === 'collapse' ? false : true;
14006
- const ret = {
14730
+ this.parent.flatData.map((e) => e.expanded = e.uniqueID === row.record.uniqueID &&
14731
+ e.expanded !== row.record.expanded ? row.record.expanded : e.expanded);
14732
+ const actionDetails = {
14007
14733
  result: this.parent.flatData,
14008
14734
  row: row.row,
14009
14735
  action: row.action,
14010
14736
  record: row.record,
14011
14737
  count: this.parent.flatData.length
14012
14738
  };
14013
- if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
14014
- this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
14739
+ this.handleSelection();
14740
+ const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
14741
+ getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: requestType });
14742
+ }
14743
+ /**
14744
+ * Handles selection logic for the TreeGrid component.
14745
+ *
14746
+ * @returns {void}
14747
+ */
14748
+ handleSelection() {
14749
+ if ((this.parent.selectionSettings.mode === 'Cell' ||
14750
+ (this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection))) {
14015
14751
  this.parent.grid.clearSelection();
14016
14752
  }
14017
14753
  if (getValue('isCollapseAll', this.parent) && this.parent.selectionSettings.persistSelection && this.parent.getSelectedRecords().length > 0) {
14018
14754
  this.prevSelectedRecord = this.parent.getSelectedRecords();
14019
14755
  this.parent.grid.clearSelection();
14020
14756
  }
14021
- const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
14022
- getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
14023
14757
  }
14758
+ /**
14759
+ * Handles the action related to virtual scrolling with paging details.
14760
+ *
14761
+ * @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
14762
+ * @param {ITreeData[]} pageingDetails.result - The result data to be handled.
14763
+ * @param {number} pageingDetails.count - The count of results.
14764
+ * @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
14765
+ * @returns {void}
14766
+ */
14024
14767
  virtualPageAction(pageingDetails) {
14025
14768
  const dm = new DataManager(pageingDetails.result);
14026
14769
  const expanded = new Predicate$1('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
@@ -14050,7 +14793,7 @@ class VirtualScroll {
14050
14793
  if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' || (requestType === 'refresh' && getValue('isExpandAll', this.parent)) ||
14051
14794
  (requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length && isNullOrUndefined(this.expandCollapseRec))) {
14052
14795
  startIndex = 0;
14053
- endIndex = this.parent.grid.pageSettings.pageSize - 1;
14796
+ endIndex = this.parent.grid.pageSettings.pageSize;
14054
14797
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
14055
14798
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
14056
14799
  }
@@ -14090,10 +14833,9 @@ class VirtualScroll {
14090
14833
  sIndex = sIndex > 0 ? sIndex : 0;
14091
14834
  endIndex = visualData.length;
14092
14835
  if (endIndex - startIndex < resourceCount) {
14093
- const newRowsCount = sIndex - startIndex;
14094
14836
  startIndex = sIndex;
14095
14837
  if (visualData.indexOf(this.expandCollapseRec) > visualData.length - resourceCount / 2) {
14096
- const newTranslateY = translateY + (newRowsCount * this.parent.grid.getRowHeight());
14838
+ const newTranslateY = startIndex * this.parent.grid.getRowHeight();
14097
14839
  this.parent.grid.contentModule['translateY'] = newTranslateY;
14098
14840
  this.parent.grid.contentModule.virtualEle.adjustTable(0, newTranslateY);
14099
14841
  }
@@ -14116,7 +14858,7 @@ class VirtualScroll {
14116
14858
  if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
14117
14859
  startIndex = 0;
14118
14860
  }
14119
- else if (!this.parent['isExpandAll']) {
14861
+ else if (!this.parent['isExpandAll'] && this.parent.grid.contentModule['translateY'] === 0) {
14120
14862
  startIndex = this.prevstartIndex === -1 ? 0 : this.prevstartIndex;
14121
14863
  }
14122
14864
  }
@@ -14143,6 +14885,26 @@ class VirtualScroll {
14143
14885
  destroy() {
14144
14886
  this.removeEventListener();
14145
14887
  }
14888
+ /**
14889
+ * Updates the row selection when the header checkbox is clicked and the number of selected rows
14890
+ * does not match the current view data length.
14891
+ *
14892
+ * @param {RowDeselectEventArgs} args - The arguments containing details of the row deselection event.
14893
+ * @returns {void} - This method does not return a value.
14894
+ */
14895
+ updateSelection(args) {
14896
+ if (args.isHeaderCheckboxClicked &&
14897
+ this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length) {
14898
+ const updateRowSelection = 'updateRowSelection';
14899
+ for (let i = 0; i < this.parent.getRows().length; i++) {
14900
+ if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
14901
+ this.parent.grid.selectionModule[`${updateRowSelection}`](this.parent.getRows()[parseInt(i.toString(), 10)],
14902
+ // eslint-disable-next-line max-len
14903
+ this.parent.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
14904
+ }
14905
+ }
14906
+ }
14907
+ }
14146
14908
  }
14147
14909
  class TreeVirtual extends VirtualScroll$1 {
14148
14910
  constructor(parent, locator) {
@@ -14626,5 +15388,5 @@ class InfiniteScroll {
14626
15388
  }
14627
15389
  }
14628
15390
 
14629
- 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, collapsed, collapsing, content, contextMenuClick, contextMenuOpen, crudAction, dataBound, dataColIndex, dataListener, dataRowIndex, 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 };
15391
+ 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, 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 };
14630
15392
  //# sourceMappingURL=ej2-treegrid.es2015.js.map