@syncfusion/ej2-treegrid 31.2.12 → 32.1.19

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 (156) hide show
  1. package/dist/ej2-treegrid.min.js +1 -10
  2. package/dist/ej2-treegrid.umd.min.js +1 -10
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +1069 -324
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +1075 -327
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +1 -10
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +0 -9
  11. package/package.json +5 -5
  12. package/src/treegrid/actions/batch-edit.js +22 -4
  13. package/src/treegrid/actions/context-menu.d.ts +1 -0
  14. package/src/treegrid/actions/context-menu.js +16 -0
  15. package/src/treegrid/actions/crud-actions.js +12 -5
  16. package/src/treegrid/actions/edit.d.ts +4 -1
  17. package/src/treegrid/actions/edit.js +59 -3
  18. package/src/treegrid/actions/freeze-column.js +1 -1
  19. package/src/treegrid/actions/rowdragdrop.js +3 -0
  20. package/src/treegrid/actions/selection.d.ts +226 -8
  21. package/src/treegrid/actions/selection.js +759 -288
  22. package/src/treegrid/actions/summary.js +1 -1
  23. package/src/treegrid/actions/virtual-scroll.js +6 -3
  24. package/src/treegrid/base/data.js +2 -1
  25. package/src/treegrid/base/treegrid-model.d.ts +16 -0
  26. package/src/treegrid/base/treegrid.d.ts +50 -4
  27. package/src/treegrid/base/treegrid.js +158 -19
  28. package/src/treegrid/models/column.d.ts +24 -0
  29. package/src/treegrid/models/column.js +12 -0
  30. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -0
  31. package/src/treegrid/renderer/virtual-tree-content-render.js +24 -2
  32. package/styles/bds-lite.scss +17 -18
  33. package/styles/bds.scss +18 -19
  34. package/styles/bootstrap-dark-lite.scss +17 -18
  35. package/styles/bootstrap-dark.scss +18 -19
  36. package/styles/bootstrap-lite.scss +17 -18
  37. package/styles/bootstrap.scss +18 -19
  38. package/styles/bootstrap4-lite.scss +17 -18
  39. package/styles/bootstrap4.scss +18 -19
  40. package/styles/bootstrap5-dark-lite.scss +17 -18
  41. package/styles/bootstrap5-dark.scss +18 -19
  42. package/styles/bootstrap5-lite.scss +18 -18
  43. package/styles/bootstrap5.3-lite.css +81 -1
  44. package/styles/bootstrap5.3-lite.scss +18 -18
  45. package/styles/bootstrap5.3.css +81 -1
  46. package/styles/bootstrap5.3.scss +19 -19
  47. package/styles/bootstrap5.scss +19 -19
  48. package/styles/fabric-dark-lite.scss +18 -18
  49. package/styles/fabric-dark.scss +19 -19
  50. package/styles/fabric-lite.scss +18 -18
  51. package/styles/fabric.scss +19 -19
  52. package/styles/fluent-dark-lite.scss +18 -18
  53. package/styles/fluent-dark.scss +19 -19
  54. package/styles/fluent-lite.scss +18 -18
  55. package/styles/fluent.scss +19 -19
  56. package/styles/fluent2-lite.css +152 -4
  57. package/styles/fluent2-lite.scss +18 -18
  58. package/styles/fluent2.css +152 -4
  59. package/styles/fluent2.scss +19 -19
  60. package/styles/highcontrast-light-lite.scss +18 -18
  61. package/styles/highcontrast-light.scss +19 -19
  62. package/styles/highcontrast-lite.scss +18 -18
  63. package/styles/highcontrast.scss +19 -19
  64. package/styles/material-dark-lite.scss +18 -18
  65. package/styles/material-dark.scss +19 -19
  66. package/styles/material-lite.scss +17 -18
  67. package/styles/material.scss +18 -19
  68. package/styles/material3-dark-lite.css +140 -1
  69. package/styles/material3-dark-lite.scss +18 -18
  70. package/styles/material3-dark.css +140 -1
  71. package/styles/material3-dark.scss +19 -21
  72. package/styles/material3-lite.css +140 -1
  73. package/styles/material3-lite.scss +18 -18
  74. package/styles/material3.css +140 -1
  75. package/styles/material3.scss +19 -21
  76. package/styles/tailwind-dark-lite.scss +18 -18
  77. package/styles/tailwind-dark.scss +19 -19
  78. package/styles/tailwind-lite.scss +18 -18
  79. package/styles/tailwind.scss +19 -19
  80. package/styles/tailwind3-lite.css +119 -1
  81. package/styles/tailwind3-lite.scss +18 -18
  82. package/styles/tailwind3.css +119 -1
  83. package/styles/tailwind3.scss +19 -19
  84. package/styles/treegrid/_all.scss +2 -2
  85. package/styles/treegrid/_bds-definition.scss +2 -0
  86. package/styles/treegrid/_bigger.scss +2 -0
  87. package/styles/treegrid/_bootstrap-dark-definition.scss +2 -0
  88. package/styles/treegrid/_bootstrap-definition.scss +2 -0
  89. package/styles/treegrid/_bootstrap4-definition.scss +2 -0
  90. package/styles/treegrid/_bootstrap5-dark-definition.scss +26 -1
  91. package/styles/treegrid/_bootstrap5-definition.scss +2 -0
  92. package/styles/treegrid/_bootstrap5.3-definition.scss +2 -0
  93. package/styles/treegrid/_fabric-dark-definition.scss +2 -0
  94. package/styles/treegrid/_fabric-definition.scss +2 -0
  95. package/styles/treegrid/_fluent-dark-definition.scss +27 -1
  96. package/styles/treegrid/_fluent-definition.scss +2 -0
  97. package/styles/treegrid/_fluent2-definition.scss +2 -0
  98. package/styles/treegrid/_highcontrast-definition.scss +2 -0
  99. package/styles/treegrid/_highcontrast-light-definition.scss +2 -0
  100. package/styles/treegrid/_layout.scss +5 -2
  101. package/styles/treegrid/_material-dark-definition.scss +2 -0
  102. package/styles/treegrid/_material-definition.scss +2 -0
  103. package/styles/treegrid/_material3-dark-definition.scss +26 -1
  104. package/styles/treegrid/_material3-definition.scss +2 -0
  105. package/styles/treegrid/_tailwind-dark-definition.scss +26 -1
  106. package/styles/treegrid/_tailwind-definition.scss +2 -0
  107. package/styles/treegrid/_tailwind3-definition.scss +2 -0
  108. package/styles/treegrid/_theme-variables.scss +1 -0
  109. package/styles/treegrid/bds.scss +19 -19
  110. package/styles/treegrid/bootstrap-dark.scss +19 -19
  111. package/styles/treegrid/bootstrap.scss +19 -19
  112. package/styles/treegrid/bootstrap4.scss +19 -19
  113. package/styles/treegrid/bootstrap5-dark.scss +19 -19
  114. package/styles/treegrid/bootstrap5.3.css +81 -1
  115. package/styles/treegrid/bootstrap5.3.scss +19 -19
  116. package/styles/treegrid/bootstrap5.scss +19 -19
  117. package/styles/treegrid/fabric-dark.scss +19 -19
  118. package/styles/treegrid/fabric.scss +19 -19
  119. package/styles/treegrid/fluent-dark.scss +19 -19
  120. package/styles/treegrid/fluent.scss +19 -19
  121. package/styles/treegrid/fluent2.css +152 -4
  122. package/styles/treegrid/fluent2.scss +19 -19
  123. package/styles/treegrid/highcontrast-light.scss +19 -19
  124. package/styles/treegrid/highcontrast.scss +19 -19
  125. package/styles/treegrid/icons/_bds.scss +1 -0
  126. package/styles/treegrid/icons/_bootstrap-dark.scss +1 -0
  127. package/styles/treegrid/icons/_bootstrap.scss +1 -0
  128. package/styles/treegrid/icons/_bootstrap4.scss +1 -0
  129. package/styles/treegrid/icons/_bootstrap5-dark.scss +1 -1
  130. package/styles/treegrid/icons/_bootstrap5.3.scss +1 -0
  131. package/styles/treegrid/icons/_bootstrap5.scss +1 -0
  132. package/styles/treegrid/icons/_fabric-dark.scss +1 -0
  133. package/styles/treegrid/icons/_fabric.scss +1 -0
  134. package/styles/treegrid/icons/_fluent-dark.scss +1 -1
  135. package/styles/treegrid/icons/_fluent.scss +1 -0
  136. package/styles/treegrid/icons/_fluent2.scss +1 -0
  137. package/styles/treegrid/icons/_fusionnew.scss +1 -0
  138. package/styles/treegrid/icons/_highcontrast-light.scss +1 -0
  139. package/styles/treegrid/icons/_highcontrast.scss +1 -0
  140. package/styles/treegrid/icons/_material-dark.scss +1 -0
  141. package/styles/treegrid/icons/_material.scss +1 -0
  142. package/styles/treegrid/icons/_material3-dark.scss +1 -1
  143. package/styles/treegrid/icons/_material3.scss +1 -0
  144. package/styles/treegrid/icons/_tailwind-dark.scss +1 -0
  145. package/styles/treegrid/icons/_tailwind.scss +1 -0
  146. package/styles/treegrid/icons/_tailwind3.scss +1 -0
  147. package/styles/treegrid/material-dark.scss +19 -19
  148. package/styles/treegrid/material.scss +19 -19
  149. package/styles/treegrid/material3-dark.css +140 -1
  150. package/styles/treegrid/material3-dark.scss +19 -20
  151. package/styles/treegrid/material3.css +140 -1
  152. package/styles/treegrid/material3.scss +19 -20
  153. package/styles/treegrid/tailwind-dark.scss +19 -19
  154. package/styles/treegrid/tailwind.scss +19 -19
  155. package/styles/treegrid/tailwind3.css +119 -1
  156. package/styles/treegrid/tailwind3.scss +19 -19
@@ -188,7 +188,7 @@ var Aggregate = /** @class */ (function () {
188
188
  var value_1 = types[parseInt(i.toString(), 10)] !== 'Custom' ? val["" + key] : val;
189
189
  single["" + disp] = single["" + disp] || {};
190
190
  single["" + disp]["" + key] = value_1;
191
- single["" + disp][types[parseInt(i.toString(), 10)]] = !isNullOrUndefined(val) ? formatFn(value_1) : ' ';
191
+ single["" + disp][types[parseInt(i.toString(), 10)]] = (!isNullOrUndefined(val) && !isNullOrUndefined(value_1)) ? formatFn(value_1) : ' ';
192
192
  }
193
193
  helper.format = summaryColumn.getFormatter();
194
194
  var cellElement = createElement('td', {
@@ -129,9 +129,12 @@ var VirtualScroll = /** @class */ (function () {
129
129
  var dm = new DataManager(pageingDetails.result);
130
130
  var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
131
131
  var parents = dm.executeLocal(new Query().where(expanded));
132
- var visualData = parents.filter(function (e) {
133
- return getExpandStatus(_this.parent, e, parents);
134
- });
132
+ var isFiltering = pageingDetails.actionArgs.requestType === 'filtering';
133
+ var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
134
+ this.parent.filterSettings.hierarchyMode === 'None';
135
+ var visualData = isFiltering && isFlatHierarchy
136
+ ? parents
137
+ : parents.filter(function (e) { return getExpandStatus(_this.parent, e, parents); });
135
138
  this.visualData = visualData;
136
139
  pageingDetails.count = visualData.length;
137
140
  this.parent.grid.notify(events.dataListener, { data: visualData });
@@ -56,6 +56,7 @@ var DataManipulation = /** @class */ (function () {
56
56
  */
57
57
  DataManipulation.prototype.destroy = function () {
58
58
  this.removeEventListener();
59
+ this.hierarchyData = null;
59
60
  };
60
61
  /**
61
62
  * @hidden
@@ -668,7 +669,7 @@ var DataManipulation = /** @class */ (function () {
668
669
  this.parent.parentData.push(currentData);
669
670
  }
670
671
  currentData.uniqueID = getUid(this.parent.element.id + '_data_');
671
- setValue('uniqueIDCollection.' + currentData.uniqueID, currentData, this.parent);
672
+ this.parent.uniqueIDCollection[currentData.uniqueID] = currentData;
672
673
  if (!isNullOrUndefined(parentRecords)) {
673
674
  var parentData = extend({}, parentRecords);
674
675
  delete parentData.childRecords;
@@ -643,6 +643,22 @@ export interface TreeGridModel extends ComponentModel{
643
643
  */
644
644
  allowPdfExport?: boolean;
645
645
 
646
+ /**
647
+ * Enables or disables column spanning for adjacent cells with similar data.
648
+ * When enabled, the treegrid merges adjacent cells with identical data between columns into a single cell, spanning multiple columns to enhance data presentation.
649
+ *
650
+ * @default false
651
+ */
652
+ enableColumnSpan?: boolean;
653
+
654
+ /**
655
+ * Enables or disables row spanning for adjacent cells with similar data.
656
+ * When enabled, the treegrid merges adjacent cells with identical data between rows into a single cell, spanning multiple rows to improve readability.
657
+ *
658
+ * @default false
659
+ */
660
+ enableRowSpan?: boolean;
661
+
646
662
  /**
647
663
  * Triggers when the component is created.
648
664
  *
@@ -77,8 +77,14 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
77
77
  private l10n;
78
78
  dataModule: DataManipulation;
79
79
  private registeredTemplate;
80
- private uniqueIDCollection;
81
- private uniqueIDFilterCollection;
80
+ /** @hidden */
81
+ uniqueIDCollection: {
82
+ [key: string]: ITreeData;
83
+ };
84
+ /** @hidden */
85
+ uniqueIDFilterCollection: {
86
+ [key: string]: ITreeData;
87
+ };
82
88
  private changedRecords;
83
89
  private deletedRecords;
84
90
  private addedRecords;
@@ -117,6 +123,8 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
117
123
  private treeColumnField;
118
124
  private stackedHeader;
119
125
  private freezeColumnRefresh;
126
+ private componentRefresh;
127
+ private isComponentRefresh;
120
128
  private isExcel;
121
129
  /** @hidden */
122
130
  initialRender: boolean;
@@ -759,6 +767,20 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
759
767
  * @default false
760
768
  */
761
769
  allowPdfExport: boolean;
770
+ /**
771
+ * Enables or disables column spanning for adjacent cells with similar data.
772
+ * When enabled, the treegrid merges adjacent cells with identical data between columns into a single cell, spanning multiple columns to enhance data presentation.
773
+ *
774
+ * @default false
775
+ */
776
+ enableColumnSpan: boolean;
777
+ /**
778
+ * Enables or disables row spanning for adjacent cells with similar data.
779
+ * When enabled, the treegrid merges adjacent cells with identical data between rows into a single cell, spanning multiple rows to improve readability.
780
+ *
781
+ * @default false
782
+ */
783
+ enableRowSpan: boolean;
762
784
  /**
763
785
  * Triggers when the component is created.
764
786
  *
@@ -1246,6 +1268,22 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1246
1268
  * @returns {string} Returns TreeGrid module name
1247
1269
  */
1248
1270
  protected getModuleName(): string;
1271
+ /**
1272
+ * Initiates a complete refresh of the TreeGrid's column and layout.
1273
+ *
1274
+ * This method forces a full re-render of the TreeGrid, ensuring that any dynamic
1275
+ * changes to columns or layout are immediately reflected.
1276
+ *
1277
+ * @returns {void}
1278
+ */
1279
+ refreshLayout(): void;
1280
+ /**
1281
+ * @param {Object} prop - Defines the property
1282
+ * @param {boolean} muteOnChange - Defines the mute on change
1283
+ * @returns {void}
1284
+ * @private
1285
+ */
1286
+ setProperties(prop: Object, muteOnChange?: boolean): void;
1249
1287
  /**
1250
1288
  * For internal use only - Initialize the event handler;
1251
1289
  *
@@ -1469,7 +1507,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1469
1507
  /**
1470
1508
  * Adds a new record to the TreeGrid at the specified position or default location.
1471
1509
  *
1472
- * @param {Object} data - Object containing the data for the new record. If omitted, an empty row is added.
1510
+ * @param {Object | Object[]} data - Object containing data for a single record, or an array of objects for creating multiple records. If omitted, an empty row is added.
1473
1511
  * @param {number} index - The index at which the new row should be added.
1474
1512
  * @param {RowPosition} position - Specifies the position of the new row (e.g., before, after or child).
1475
1513
  *
@@ -1477,7 +1515,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1477
1515
  *
1478
1516
  * @returns {void}
1479
1517
  */
1480
- addRecord(data?: Object, index?: number, position?: RowPosition): void;
1518
+ addRecord(data?: Object | Object[], index?: number, position?: RowPosition): void;
1481
1519
  /**
1482
1520
  * Cancels the current edit operation on the TreeGrid.
1483
1521
  *
@@ -2100,6 +2138,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
2100
2138
  * @returns {void}
2101
2139
  */
2102
2140
  private removeListener;
2141
+ private getCellsByTableName;
2103
2142
  private partialFilterUpdate;
2104
2143
  /**
2105
2144
  * Filters the TreeGrid rows based on a specified column and filter criteria.
@@ -2421,6 +2460,13 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
2421
2460
  * @returns {void}
2422
2461
  */
2423
2462
  outdent(record?: Object): void;
2463
+ /**
2464
+ * Calculates and returns the optimal page size that fits the current height of the TreeGrid's container.
2465
+ *
2466
+ * @param {number | string } containerHeight - (Optional) The height of the container - i.e. the complete TreeGrid height, which can be a number (in pixels) or a string.
2467
+ * @returns {number} returns the page size
2468
+ */
2469
+ getPageSizeByHeight(containerHeight?: number | string): number;
2424
2470
  /**
2425
2471
  * `columnchooserModule` is used to dynamically show or hide the TreeGrid columns.
2426
2472
  *
@@ -67,7 +67,9 @@ var TreeGrid = /** @class */ (function (_super) {
67
67
  function TreeGrid(options, element) {
68
68
  var _this = _super.call(this, options, element) || this;
69
69
  _this.dataResults = {};
70
+ /** @hidden */
70
71
  _this.uniqueIDCollection = {};
72
+ /** @hidden */
71
73
  _this.uniqueIDFilterCollection = {};
72
74
  _this.changedRecords = 'changedRecords';
73
75
  _this.deletedRecords = 'deletedRecords';
@@ -77,6 +79,8 @@ var TreeGrid = /** @class */ (function (_super) {
77
79
  _this.modifiedRecords = [];
78
80
  _this.stackedHeader = false;
79
81
  _this.freezeColumnRefresh = true;
82
+ _this.componentRefresh = Component.prototype.refresh;
83
+ _this.isComponentRefresh = false;
80
84
  _this.objectEqualityChecker = function (old, current) {
81
85
  if (old) {
82
86
  var keys = Object.keys(old);
@@ -127,7 +131,7 @@ var TreeGrid = /** @class */ (function (_super) {
127
131
  /* eslint-disable */
128
132
  TreeGrid.prototype.excelExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {
129
133
  /* eslint-enable */
130
- return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false);
134
+ return this.allowExcelExport ? this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false) : null;
131
135
  };
132
136
  /**
133
137
  * Exports the TreeGrid data to a CSV file.
@@ -141,7 +145,7 @@ var TreeGrid = /** @class */ (function (_super) {
141
145
  /* eslint-disable */
142
146
  TreeGrid.prototype.csvExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {
143
147
  /* eslint-enable */
144
- return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true);
148
+ return this.allowExcelExport ? this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true) : null;
145
149
  };
146
150
  /**
147
151
  * Exports the TreeGrid data to a PDF document.
@@ -153,7 +157,7 @@ var TreeGrid = /** @class */ (function (_super) {
153
157
  * @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
154
158
  */
155
159
  TreeGrid.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
156
- return this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
160
+ return this.allowPdfExport ? this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) : null;
157
161
  };
158
162
  /**
159
163
  * Sends a POST request to export the TreeGrid to an Excel file on the server side.
@@ -273,6 +277,26 @@ var TreeGrid = /** @class */ (function (_super) {
273
277
  TreeGrid.prototype.getModuleName = function () {
274
278
  return 'treegrid';
275
279
  };
280
+ /**
281
+ * Initiates a complete refresh of the TreeGrid's column and layout.
282
+ *
283
+ * This method forces a full re-render of the TreeGrid, ensuring that any dynamic
284
+ * changes to columns or layout are immediately reflected.
285
+ *
286
+ * @returns {void}
287
+ */
288
+ TreeGrid.prototype.refreshLayout = function () {
289
+ this.componentRefresh();
290
+ };
291
+ /**
292
+ * @param {Object} prop - Defines the property
293
+ * @param {boolean} muteOnChange - Defines the mute on change
294
+ * @returns {void}
295
+ * @private
296
+ */
297
+ TreeGrid.prototype.setProperties = function (prop, muteOnChange) {
298
+ _super.prototype.setProperties.call(this, prop, muteOnChange);
299
+ };
276
300
  /**
277
301
  * For internal use only - Initialize the event handler;
278
302
  *
@@ -280,6 +304,9 @@ var TreeGrid = /** @class */ (function (_super) {
280
304
  * @returns {void}
281
305
  */
282
306
  TreeGrid.prototype.preRender = function () {
307
+ if (this.isComponentRefresh) {
308
+ this.grid = new Grid();
309
+ }
283
310
  this.TreeGridLocale();
284
311
  this.initProperties();
285
312
  this.defaultLocale = {
@@ -449,7 +476,10 @@ var TreeGrid = /** @class */ (function (_super) {
449
476
  }
450
477
  }
451
478
  else {
452
- this.clearSelection();
479
+ var contentTableBody = this.grid.getContent().querySelector('.e-table tbody');
480
+ if (parentTarget && contentTableBody && parentTarget !== contentTableBody.lastElementChild) {
481
+ this.clearSelection();
482
+ }
453
483
  }
454
484
  }
455
485
  }
@@ -520,6 +550,8 @@ var TreeGrid = /** @class */ (function (_super) {
520
550
  this.isExpandAll = false;
521
551
  this.isCollapseAll = false;
522
552
  this.freezeColumnRefresh = true;
553
+ this.componentRefresh = Component.prototype.refresh;
554
+ this.isComponentRefresh = false;
523
555
  this.keyConfigs = {
524
556
  ctrlDownArrow: 'ctrl+downarrow',
525
557
  ctrlUpArrow: 'ctrl+uparrow',
@@ -840,6 +872,7 @@ var TreeGrid = /** @class */ (function (_super) {
840
872
  if (this.isIndentEnabled) {
841
873
  this.refreshToolbarItems();
842
874
  }
875
+ this.updateColumnModel();
843
876
  this.wireEvents();
844
877
  this.renderComplete();
845
878
  var destroyTemplate = 'destroyTemplate';
@@ -890,6 +923,15 @@ var TreeGrid = /** @class */ (function (_super) {
890
923
  if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
891
924
  failureCases.push('Selection is not supported in RowTemplate');
892
925
  }
926
+ if (!this.allowExcelExport && this.action === 'csvExport') {
927
+ failureCases.push('CSV export is not allowed when allowExcelExport is disabled.');
928
+ }
929
+ if (!this.allowPdfExport && this.action === 'pdfExport') {
930
+ failureCases.push('PDF export is not allowed when allowPdfExport is disabled');
931
+ }
932
+ if (!this.allowExcelExport && this.action === 'excelExport') {
933
+ failureCases.push('Excel export is not allowed when allowExcelExport is disabled.');
934
+ }
893
935
  if (this.treeColumnIndex >= this.columns.length) {
894
936
  failureCases.push('TreeColumnIndex value should not exceed the total column count.');
895
937
  }
@@ -1050,6 +1092,8 @@ var TreeGrid = /** @class */ (function (_super) {
1050
1092
  this.grid.frozenRows = this.frozenRows;
1051
1093
  this.grid.frozenColumns = this.frozenColumns;
1052
1094
  this.grid.clipMode = getActualProperties(this.clipMode);
1095
+ this.grid.enableColumnSpan = this.enableColumnSpan;
1096
+ this.grid.enableRowSpan = this.enableRowSpan;
1053
1097
  var templateInstance = 'templateDotnetInstance';
1054
1098
  this.grid["" + templateInstance] = this["" + templateInstance];
1055
1099
  var isJsComponent = 'isJsComponent';
@@ -1530,12 +1574,12 @@ var TreeGrid = /** @class */ (function (_super) {
1530
1574
  _this.grid.refresh();
1531
1575
  }
1532
1576
  if (args.action === 'filter') {
1533
- if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1577
+ if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
1534
1578
  _this.expandAll();
1535
1579
  }
1536
1580
  }
1537
1581
  if (args.requestType === 'searching') {
1538
- if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
1582
+ if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
1539
1583
  _this.expandAll();
1540
1584
  }
1541
1585
  }
@@ -1875,12 +1919,15 @@ var TreeGrid = /** @class */ (function (_super) {
1875
1919
  TreeGrid.prototype.onPropertyChanged = function (newProp) {
1876
1920
  var properties = Object.keys(newProp);
1877
1921
  var requireRefresh = false;
1878
- if (properties.indexOf('columns') > -1 && !isNullOrUndefined(newProp.columns)) {
1879
- this.refreshColumns();
1880
- }
1881
1922
  for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {
1882
1923
  var prop = properties_1[_i];
1883
1924
  switch (prop) {
1925
+ case 'columns':
1926
+ if (!isNullOrUndefined(newProp.columns)) {
1927
+ this.refreshColumns();
1928
+ }
1929
+ requireRefresh = true;
1930
+ break;
1884
1931
  case 'treeColumnIndex':
1885
1932
  this.grid.refreshColumns();
1886
1933
  break;
@@ -2091,8 +2138,19 @@ var TreeGrid = /** @class */ (function (_super) {
2091
2138
  }
2092
2139
  this.grid.editSettings = this.getGridEditSettings();
2093
2140
  break;
2141
+ case 'enableRowSpan':
2142
+ case 'enableColumnSpan':
2143
+ this.grid.enableRowSpan = this.enableRowSpan;
2144
+ this.grid.enableColumnSpan = this.enableColumnSpan;
2145
+ this.refreshColumns();
2146
+ break;
2094
2147
  }
2095
- if (requireRefresh) {
2148
+ }
2149
+ if (requireRefresh) {
2150
+ if (this.isFrozenGrid()) {
2151
+ this.refreshLayout();
2152
+ }
2153
+ else {
2096
2154
  this.grid.refresh();
2097
2155
  }
2098
2156
  }
@@ -2113,6 +2171,7 @@ var TreeGrid = /** @class */ (function (_super) {
2113
2171
  * @returns {void}
2114
2172
  */
2115
2173
  TreeGrid.prototype.destroy = function () {
2174
+ this.isComponentRefresh = true;
2116
2175
  var treeGridElement = this.element;
2117
2176
  if (!treeGridElement) {
2118
2177
  return;
@@ -2123,15 +2182,20 @@ var TreeGrid = /** @class */ (function (_super) {
2123
2182
  this.unwireEvents();
2124
2183
  }
2125
2184
  this.removeListener();
2126
- if (hasTreeGridChild) {
2127
- _super.prototype.destroy.call(this);
2185
+ if (this.dataModule) {
2186
+ this.dataModule.destroy();
2128
2187
  }
2129
2188
  if (this.grid) {
2189
+ this.grid.dataSource = null;
2130
2190
  this.grid.destroy();
2131
2191
  }
2132
- if (this.dataModule) {
2133
- this.dataModule.destroy();
2192
+ if (hasTreeGridChild) {
2193
+ _super.prototype.destroy.call(this);
2134
2194
  }
2195
+ this.infiniteScrollData = null;
2196
+ this.remoteCollapsedData = null;
2197
+ this.remoteExpandedData = null;
2198
+ this.parentData = null;
2135
2199
  var modules = ['dataModule', 'sortModule', 'renderModule', 'filterModule', 'printModule', 'clipboardModule',
2136
2200
  'excelExportModule', 'pdfExportModule', 'toolbarModule', 'summaryModule', 'reorderModule', 'resizeModule',
2137
2201
  'pagerModule', 'keyboardModule', 'columnMenuModule', 'contextMenuModule', 'editModule', 'virtualScrollModule',
@@ -2141,6 +2205,9 @@ var TreeGrid = /** @class */ (function (_super) {
2141
2205
  this[modules[parseInt(i.toString(), 10)]] = null;
2142
2206
  }
2143
2207
  }
2208
+ this.dataResults = null;
2209
+ this.uniqueIDCollection = {};
2210
+ this.uniqueIDFilterCollection = {};
2144
2211
  this.element.innerHTML = '';
2145
2212
  this.grid = null;
2146
2213
  };
@@ -2282,7 +2349,7 @@ var TreeGrid = /** @class */ (function (_super) {
2282
2349
  /**
2283
2350
  * Adds a new record to the TreeGrid at the specified position or default location.
2284
2351
  *
2285
- * @param {Object} data - Object containing the data for the new record. If omitted, an empty row is added.
2352
+ * @param {Object | Object[]} data - Object containing data for a single record, or an array of objects for creating multiple records. If omitted, an empty row is added.
2286
2353
  * @param {number} index - The index at which the new row should be added.
2287
2354
  * @param {RowPosition} position - Specifies the position of the new row (e.g., before, after or child).
2288
2355
  *
@@ -3093,7 +3160,9 @@ var TreeGrid = /** @class */ (function (_super) {
3093
3160
  if (isNullOrUndefined(refreshUI) || refreshUI) {
3094
3161
  this.grid.columns = this.getGridColumns(this.columns);
3095
3162
  this.getTreeColumn();
3096
- this.grid.refreshColumns();
3163
+ if (!this.isFrozenGrid()) {
3164
+ this.grid.refreshColumns();
3165
+ }
3097
3166
  }
3098
3167
  else {
3099
3168
  this.grid.setProperties({ columns: this.getGridColumns(this.columns) }, true);
@@ -3635,7 +3704,8 @@ var TreeGrid = /** @class */ (function (_super) {
3635
3704
  if (rows.length) {
3636
3705
  for (var i = 0; i < rows.length; i++) {
3637
3706
  if (action === 'collapse') {
3638
- if (!isNullOrUndefined(this.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex])) {
3707
+ var currentRecordIndx = this.frozenRows ? this.getCurrentViewRecords()[parseInt(rows[parseInt(i.toString(), 10)].getAttribute('aria-rowindex'), 10) - 1] : this.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex];
3708
+ if (!isNullOrUndefined(currentRecordIndx)) {
3639
3709
  this.collapseRow(rows[parseInt(i.toString(), 10)]);
3640
3710
  }
3641
3711
  }
@@ -3762,8 +3832,9 @@ var TreeGrid = /** @class */ (function (_super) {
3762
3832
  }
3763
3833
  var lastrowIdx = this.getVisibleRecords()[this.getVisibleRecords().length - 1]['index'];
3764
3834
  var lastRow = this.getRowByIndex(lastrowIdx);
3765
- if (this.grid.getContentTable().clientHeight <= this.grid.getContent().clientHeight && !isNullOrUndefined(lastRow) && !lastRow.cells[0].classList.contains('e-lastrowcell')) {
3766
- this.lastRowBorder(lastRow, true);
3835
+ var borderElement = lastRow ? lastRow.nextElementSibling ? lastRow.nextElementSibling.classList.contains('e-detailrow') ? lastRow.nextElementSibling : lastRow : lastRow : null;
3836
+ if (this.grid.getContentTable().clientHeight <= this.grid.getContent().clientHeight && !isNullOrUndefined(borderElement) && !borderElement.cells[0].classList.contains('e-lastrowcell')) {
3837
+ this.lastRowBorder(borderElement, true);
3767
3838
  }
3768
3839
  }
3769
3840
  if (isCountRequired(this) && action === 'expand') {
@@ -3927,12 +3998,16 @@ var TreeGrid = /** @class */ (function (_super) {
3927
3998
  };
3928
3999
  TreeGrid.prototype.localExpand = function (action, row, record) {
3929
4000
  var rows;
4001
+ var detailRow = row.nextElementSibling ? row.nextElementSibling.classList.contains('e-detailrow') ? row.nextElementSibling : null : null;
3930
4002
  var childRecords = this.grid.currentViewData.filter(function (e) {
3931
4003
  return e.parentUniqueID === record.uniqueID;
3932
4004
  });
3933
4005
  if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {
3934
4006
  this.lastRowBorder(row, false);
3935
4007
  }
4008
+ else if (this.isPixelHeight() && detailRow && detailRow.cells[0].classList.contains('e-lastrowcell')) {
4009
+ this.lastRowBorder(row.nextElementSibling, false);
4010
+ }
3936
4011
  var movableRows;
3937
4012
  var freezeRightRows;
3938
4013
  var gridRows = this.getRows();
@@ -4147,6 +4222,7 @@ var TreeGrid = /** @class */ (function (_super) {
4147
4222
  this.on('updateResults', this.updateResultModel, this);
4148
4223
  this.grid.on('initial-end', this.afterGridRender, this);
4149
4224
  this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
4225
+ this.grid.on('get-row-cells', this.getCellsByTableName, this);
4150
4226
  };
4151
4227
  TreeGrid.prototype.updateResultModel = function (returnResult) {
4152
4228
  this.dataResults = returnResult;
@@ -4163,6 +4239,16 @@ var TreeGrid = /** @class */ (function (_super) {
4163
4239
  this.grid.off('initial-end', this.afterGridRender);
4164
4240
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
4165
4241
  this.grid.off('partial-filter-update', this.partialFilterUpdate);
4242
+ this.grid.off('get-row-cells', this.getCellsByTableName);
4243
+ };
4244
+ TreeGrid.prototype.getCellsByTableName = function (args) {
4245
+ if (!Array.isArray(args.elements)) {
4246
+ args.elements = [];
4247
+ }
4248
+ if (args.rowIndex < this.grid.getDataRows().length) {
4249
+ var cells = [].slice.call(this.grid.getDataRows()[parseInt(args.rowIndex.toString(), 10)].getElementsByClassName('e-rowcell'));
4250
+ Array.prototype.push.apply(args.elements, cells);
4251
+ }
4166
4252
  };
4167
4253
  TreeGrid.prototype.partialFilterUpdate = function (args) {
4168
4254
  var gridFiltered = args.gridFiltered;
@@ -4587,6 +4673,53 @@ var TreeGrid = /** @class */ (function (_super) {
4587
4673
  this.rowDragAndDropModule[this.indentOutdentAction](record, 'outdent');
4588
4674
  }
4589
4675
  };
4676
+ /**
4677
+ * Calculates and returns the optimal page size that fits the current height of the TreeGrid's container.
4678
+ *
4679
+ * @param {number | string } containerHeight - (Optional) The height of the container - i.e. the complete TreeGrid height, which can be a number (in pixels) or a string.
4680
+ * @returns {number} returns the page size
4681
+ */
4682
+ TreeGrid.prototype.getPageSizeByHeight = function (containerHeight) {
4683
+ if (isNullOrUndefined(containerHeight)) {
4684
+ var treegridControlElement = document.getElementById(this.element.id);
4685
+ if (treegridControlElement) {
4686
+ containerHeight = treegridControlElement.clientHeight;
4687
+ }
4688
+ else {
4689
+ var root = this.element;
4690
+ containerHeight = root ? (root.offsetHeight || root.clientHeight || 0) : 0;
4691
+ }
4692
+ }
4693
+ if ((this.allowTextWrap && this.textWrapSettings.wrapMode === 'Header') || (!this.allowTextWrap)) {
4694
+ var pagesize = 0;
4695
+ if (typeof containerHeight === 'string' && containerHeight.indexOf('%') !== -1) {
4696
+ containerHeight = parseInt(containerHeight, 10) / 100 * this.element.clientHeight;
4697
+ }
4698
+ var nonContentHeight = this.grid['getNoncontentHeight']() + this.grid.getRowHeight();
4699
+ if (containerHeight > nonContentHeight) {
4700
+ var contentHeight = 0;
4701
+ var calcNonContentHeight = this.grid['getNoncontentHeight']();
4702
+ var pagerMsg = document.getElementsByClassName('e-pagerexternalmsg')[0];
4703
+ if (pagerMsg) {
4704
+ calcNonContentHeight += pagerMsg.clientHeight;
4705
+ }
4706
+ contentHeight = containerHeight - calcNonContentHeight;
4707
+ pagesize = (contentHeight / this.grid.getRowHeight());
4708
+ }
4709
+ if (this.frozenRows > 0) {
4710
+ pagesize = pagesize + this.frozenRows;
4711
+ }
4712
+ if (pagesize > 0) {
4713
+ return Math.floor(pagesize);
4714
+ }
4715
+ else {
4716
+ return 0;
4717
+ }
4718
+ }
4719
+ else {
4720
+ return 0;
4721
+ }
4722
+ };
4590
4723
  var TreeGrid_1;
4591
4724
  __decorate([
4592
4725
  Property(0)
@@ -4801,6 +4934,12 @@ var TreeGrid = /** @class */ (function (_super) {
4801
4934
  __decorate([
4802
4935
  Property(false)
4803
4936
  ], TreeGrid.prototype, "allowPdfExport", void 0);
4937
+ __decorate([
4938
+ Property(false)
4939
+ ], TreeGrid.prototype, "enableColumnSpan", void 0);
4940
+ __decorate([
4941
+ Property(false)
4942
+ ], TreeGrid.prototype, "enableRowSpan", void 0);
4804
4943
  __decorate([
4805
4944
  Event()
4806
4945
  ], TreeGrid.prototype, "created", void 0);
@@ -293,6 +293,18 @@ export declare class Column {
293
293
  * @default false
294
294
  */
295
295
  lockColumn: boolean;
296
+ /**
297
+ * Allows treegrid to perform row spanning on the specified column.
298
+ *
299
+ * @default true
300
+ */
301
+ enableRowSpan: boolean;
302
+ /**
303
+ * Allows treegrid to perform column spanning on the specified column.
304
+ *
305
+ * @default true
306
+ */
307
+ enableColumnSpan: boolean;
296
308
  /**
297
309
  * Dictates the column freeze position. Options include:
298
310
  * * `Left` - Freeze the column on the left.
@@ -654,6 +666,18 @@ export interface ColumnModel {
654
666
  * @default false
655
667
  */
656
668
  lockColumn?: boolean;
669
+ /**
670
+ * Allows treegrid to perform row spanning on the specified column.
671
+ *
672
+ * @default true
673
+ */
674
+ enableRowSpan?: boolean;
675
+ /**
676
+ * Allows treegrid to perform column spanning on the specified column.
677
+ *
678
+ * @default true
679
+ */
680
+ enableColumnSpan?: boolean;
657
681
  /**
658
682
  * Determines which side (left, right, or center) the column should be frozen on.
659
683
  *
@@ -78,6 +78,18 @@ var Column = /** @class */ (function () {
78
78
  * @default null
79
79
  */
80
80
  this.filter = {};
81
+ /**
82
+ * Allows treegrid to perform row spanning on the specified column.
83
+ *
84
+ * @default true
85
+ */
86
+ this.enableRowSpan = true;
87
+ /**
88
+ * Allows treegrid to perform column spanning on the specified column.
89
+ *
90
+ * @default true
91
+ */
92
+ this.enableColumnSpan = true;
81
93
  merge(this, options);
82
94
  }
83
95
  /**
@@ -323,6 +323,10 @@ export declare class TreeInterSectionObserver extends InterSectionObserver {
323
323
  private newPos;
324
324
  private lastPos;
325
325
  private timer;
326
+ private containerEl;
327
+ private movableContainerEl;
328
+ private containerScrollHandler;
329
+ private movableScrollHandler;
326
330
  /**
327
331
  * Sets up observers to monitor scroll events on a given container
328
332
  * and its movable companion within a virtual grid setup.
@@ -333,6 +337,7 @@ export declare class TreeInterSectionObserver extends InterSectionObserver {
333
337
  * @returns {void}
334
338
  */
335
339
  observes(callback: Function, onEnterCallback: Function, instance: IGrid): void;
340
+ disconnect(): void;
336
341
  /**
337
342
  * Clears the last known position.
338
343
  *