@syncfusion/ej2-treegrid 28.2.4 → 29.1.33
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.
- package/README.md +2 -2
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +1275 -519
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1277 -519
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -10
- package/src/treegrid/actions/batch-edit.js +12 -5
- package/src/treegrid/actions/edit.js +12 -12
- package/src/treegrid/actions/page.js +1 -1
- package/src/treegrid/actions/rowdragdrop.d.ts +21 -1
- package/src/treegrid/actions/rowdragdrop.js +248 -48
- package/src/treegrid/actions/summary.js +1 -1
- package/src/treegrid/actions/virtual-scroll.d.ts +34 -1
- package/src/treegrid/actions/virtual-scroll.js +58 -11
- package/src/treegrid/base/constant.d.ts +0 -4
- package/src/treegrid/base/constant.js +0 -4
- package/src/treegrid/base/data.js +48 -47
- package/src/treegrid/base/treegrid-model.d.ts +195 -208
- package/src/treegrid/base/treegrid.d.ts +598 -411
- package/src/treegrid/base/treegrid.js +523 -306
- package/src/treegrid/enum.d.ts +77 -80
- package/src/treegrid/enum.js +2 -2
- package/src/treegrid/models/column.d.ts +122 -177
- package/src/treegrid/models/column.js +14 -26
- package/src/treegrid/models/edit-settings-model.d.ts +24 -25
- package/src/treegrid/models/edit-settings.d.ts +25 -26
- package/src/treegrid/models/edit-settings.js +1 -1
- package/src/treegrid/models/filter-settings-model.d.ts +41 -49
- package/src/treegrid/models/filter-settings.d.ts +43 -51
- package/src/treegrid/models/filter-settings.js +2 -2
- package/src/treegrid/models/infinite-scroll-settings-model.d.ts +4 -4
- package/src/treegrid/models/infinite-scroll-settings.d.ts +4 -4
- package/src/treegrid/models/infinite-scroll-settings.js +1 -1
- package/src/treegrid/models/loading-indicator-model.d.ts +3 -4
- package/src/treegrid/models/loading-indicator.d.ts +4 -4
- package/src/treegrid/models/loading-indicator.js +1 -1
- package/src/treegrid/models/page-settings-model.d.ts +10 -13
- package/src/treegrid/models/page-settings.d.ts +11 -14
- package/src/treegrid/models/page-settings.js +1 -1
- package/src/treegrid/models/rowdrop-settings-model.d.ts +1 -1
- package/src/treegrid/models/rowdrop-settings.d.ts +13 -6
- package/src/treegrid/models/rowdrop-settings.js +1 -1
- package/src/treegrid/models/search-settings-model.d.ts +13 -11
- package/src/treegrid/models/search-settings.d.ts +14 -12
- package/src/treegrid/models/search-settings.js +1 -1
- package/src/treegrid/models/selection-settings-model.d.ts +18 -29
- package/src/treegrid/models/selection-settings.d.ts +18 -29
- package/src/treegrid/models/sort-settings-model.d.ts +8 -5
- package/src/treegrid/models/sort-settings.d.ts +10 -7
- package/src/treegrid/models/sort-settings.js +2 -2
- package/src/treegrid/models/summary-model.d.ts +28 -29
- package/src/treegrid/models/summary.d.ts +32 -30
- package/src/treegrid/models/summary.js +4 -1
- package/src/treegrid/models/textwrap-settings-model.d.ts +7 -4
- package/src/treegrid/models/textwrap-settings.d.ts +8 -5
- package/src/treegrid/models/textwrap-settings.js +1 -1
- package/src/treegrid/renderer/render.js +11 -5
- package/src/treegrid/renderer/virtual-row-model-generator.js +5 -4
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +277 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +328 -35
- package/src/treegrid/utils.d.ts +1 -1
- package/styles/bootstrap-lite.css +0 -12
- package/styles/bootstrap.css +0 -12
- package/styles/bootstrap5-dark-lite.css +1 -1
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/treegrid/_layout.scss +0 -1
- package/styles/treegrid/_material-dark-definition.scss +2 -2
- package/styles/treegrid/_material-definition.scss +2 -2
- package/styles/treegrid/bootstrap.css +0 -12
- package/styles/treegrid/bootstrap5-dark.css +1 -1
- package/styles/treegrid/icons/_bootstrap.scss +0 -17
- package/styles/treegrid/icons/_bootstrap5.scss +1 -1
- package/styles/treegrid/icons/_fabric-dark.scss +1 -1
- package/styles/treegrid/icons/_fabric.scss +1 -1
- package/styles/treegrid/icons/_fluent2.scss +1 -1
- package/styles/treegrid/icons/_fusionnew.scss +1 -0
- package/styles/treegrid/icons/_highcontrast-light.scss +1 -1
- package/styles/treegrid/icons/_tailwind-dark.scss +2 -2
|
@@ -24,90 +24,78 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
24
24
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* Represents
|
|
27
|
+
* Represents the "Column" model class for TreeGrid, defining essential properties and functionalities of a column.
|
|
28
28
|
*/
|
|
29
29
|
var Column = /** @__PURE__ @class */ (function () {
|
|
30
30
|
function Column(options) {
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* By default all columns are editable.
|
|
32
|
+
* Allows or disallows editing of the column. Set to `false` to make a column non-editable.
|
|
33
|
+
* By default, all columns are editable.
|
|
34
34
|
*
|
|
35
35
|
* @default true
|
|
36
36
|
*/
|
|
37
37
|
this.allowEditing = true;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Customization options for the edit cell.
|
|
40
40
|
*
|
|
41
41
|
* @default {}
|
|
42
42
|
*/
|
|
43
43
|
this.edit = {};
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* When set to `true`, encodes HTML content in headers and cells to prevent HTML injection.
|
|
46
46
|
*
|
|
47
47
|
* @default true
|
|
48
48
|
*/
|
|
49
49
|
this.disableHtmlEncode = true;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* By default all columns can be reorder.
|
|
51
|
+
* Disables column reordering if set to `false`. By default, columns can be reordered.
|
|
53
52
|
*
|
|
54
53
|
* @default true
|
|
55
54
|
*/
|
|
56
55
|
this.allowReordering = true;
|
|
57
56
|
/**
|
|
58
|
-
*
|
|
59
|
-
* By default column menu will show for all columns
|
|
57
|
+
* Disables column menu for the column if set to `false`. By default, column menus are enabled for all columns.
|
|
60
58
|
*
|
|
61
59
|
* @default true
|
|
62
60
|
*/
|
|
63
61
|
this.showColumnMenu = true;
|
|
64
62
|
/**
|
|
65
|
-
*
|
|
66
|
-
* By default all columns are filterable.
|
|
63
|
+
* Disables filtering for the column if set to `false`. By default, columns are filterable.
|
|
67
64
|
*
|
|
68
65
|
* @default true
|
|
69
66
|
*/
|
|
70
67
|
this.allowFiltering = true;
|
|
71
68
|
/**
|
|
72
|
-
*
|
|
73
|
-
* By default all columns are sortable.
|
|
69
|
+
* Disables sorting for the column if set to `false`. By default, columns are sortable.
|
|
74
70
|
*
|
|
75
71
|
* @default true
|
|
76
72
|
*/
|
|
77
73
|
this.allowSorting = true;
|
|
78
74
|
/**
|
|
79
|
-
*
|
|
80
|
-
* By default all the columns can be resized.
|
|
75
|
+
* Disables resizing for the column if set to `false`. By default, columns can be resized.
|
|
81
76
|
*
|
|
82
77
|
* @default true
|
|
83
78
|
*/
|
|
84
79
|
this.allowResizing = true;
|
|
85
80
|
/**
|
|
86
|
-
*
|
|
87
|
-
* * type - Specifies the filter type as menu.
|
|
88
|
-
* * ui - to render custom component for specific column it has following functions.
|
|
89
|
-
* * ui.create – It is used for creating custom components.
|
|
90
|
-
* * ui.read - It is used for read the value from the component.
|
|
91
|
-
* * ui.write - It is used to apply component model as dynamically.
|
|
81
|
+
* Customize default filter options for a specific column, providing types and UI definitions for custom components.
|
|
92
82
|
*
|
|
93
|
-
*
|
|
83
|
+
* @default null
|
|
94
84
|
*/
|
|
95
85
|
this.filter = {};
|
|
96
86
|
merge(this, options);
|
|
97
87
|
}
|
|
98
88
|
/**
|
|
99
|
-
*
|
|
89
|
+
* Reflects state changes for TreeGrid column directives, particularly in React.
|
|
100
90
|
*
|
|
101
|
-
* @param {Column} column -
|
|
91
|
+
* @param {Column} column - The column to update.
|
|
102
92
|
* @returns {void}
|
|
103
93
|
* @hidden
|
|
104
94
|
*/
|
|
105
95
|
Column.prototype.setProperties = function (column) {
|
|
106
|
-
//Angular two way binding
|
|
107
96
|
var keys = Object.keys(column);
|
|
108
97
|
for (var i = 0; i < keys.length; i++) {
|
|
109
98
|
this[keys[parseInt(i.toString(), 10)]] = column[keys[parseInt(i.toString(), 10)]];
|
|
110
|
-
//Refresh the react columnTemplates on state change
|
|
111
99
|
if (this.parent && this.parent['isReact'] && keys[parseInt(i.toString(), 10)] === 'template') {
|
|
112
100
|
var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
|
|
113
101
|
this.parent.clipboardModule['treeGridParent'].renderModule["" + refreshReactColumnTemplateByUid](this.uid);
|
|
@@ -160,7 +148,7 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
160
148
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
161
149
|
};
|
|
162
150
|
/**
|
|
163
|
-
* Configures the
|
|
151
|
+
* Configures the loading indicator for the Tree Grid, allowing you to display a visual indicator during data loading operations to enhance user experience.
|
|
164
152
|
*/
|
|
165
153
|
var LoadingIndicator = /** @__PURE__ @class */ (function (_super) {
|
|
166
154
|
__extends$1(LoadingIndicator, _super);
|
|
@@ -193,7 +181,7 @@ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
193
181
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
194
182
|
};
|
|
195
183
|
/**
|
|
196
|
-
* Represents the
|
|
184
|
+
* Represents the filter configuration for a column in the TreeGrid.
|
|
197
185
|
*/
|
|
198
186
|
var Predicate = /** @__PURE__ @class */ (function (_super) {
|
|
199
187
|
__extends$2(Predicate, _super);
|
|
@@ -239,7 +227,7 @@ var Predicate = /** @__PURE__ @class */ (function (_super) {
|
|
|
239
227
|
return Predicate;
|
|
240
228
|
}(ChildProperty));
|
|
241
229
|
/**
|
|
242
|
-
* Configures the filtering behavior of the TreeGrid.
|
|
230
|
+
* Configures the filtering behavior of the TreeGrid, enabling complex data filtering capabilities.
|
|
243
231
|
*/
|
|
244
232
|
var FilterSettings = /** @__PURE__ @class */ (function (_super) {
|
|
245
233
|
__extends$2(FilterSettings, _super);
|
|
@@ -293,7 +281,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
293
281
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
294
282
|
};
|
|
295
283
|
/**
|
|
296
|
-
* Configures the
|
|
284
|
+
* Configures the text wrapping behavior of the TreeGrid.
|
|
297
285
|
*/
|
|
298
286
|
var TextWrapSettings = /** @__PURE__ @class */ (function (_super) {
|
|
299
287
|
__extends$3(TextWrapSettings, _super);
|
|
@@ -595,12 +583,8 @@ var frozenRight = 'frozen-right';
|
|
|
595
583
|
/** @hidden */
|
|
596
584
|
var frozenLeft = 'frozen-left';
|
|
597
585
|
/** @hidden */
|
|
598
|
-
var dataColIndex = 'data-colindex';
|
|
599
|
-
/** @hidden */
|
|
600
586
|
var ariaColIndex = 'aria-colindex';
|
|
601
587
|
/** @hidden */
|
|
602
|
-
var dataRowIndex = 'data-rowindex';
|
|
603
|
-
/** @hidden */
|
|
604
588
|
var ariaRowIndex = 'aria-rowindex';
|
|
605
589
|
/** @hidden */
|
|
606
590
|
var actionFailure = 'actionFailure';
|
|
@@ -1581,7 +1565,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
1581
1565
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1582
1566
|
};
|
|
1583
1567
|
/**
|
|
1584
|
-
* Configures the
|
|
1568
|
+
* Configures the searching behavior of the TreeGrid.
|
|
1585
1569
|
*/
|
|
1586
1570
|
var SearchSettings = /** @__PURE__ @class */ (function (_super) {
|
|
1587
1571
|
__extends$6(SearchSettings, _super);
|
|
@@ -1788,10 +1772,9 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1788
1772
|
if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType
|
|
1789
1773
|
=== 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {
|
|
1790
1774
|
var container = createElement('div', { className: 'e-treecolumn-container' });
|
|
1791
|
-
var emptyExpandIcon = createElement('span', {
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
});
|
|
1775
|
+
var emptyExpandIcon = createElement('span', { className: 'e-icons e-none' });
|
|
1776
|
+
emptyExpandIcon.style.width = '10px';
|
|
1777
|
+
emptyExpandIcon.style.display = 'inline-block';
|
|
1795
1778
|
for (var n = 0; n < pad; n++) {
|
|
1796
1779
|
totalIconsWidth += 10;
|
|
1797
1780
|
container.appendChild(emptyExpandIcon.cloneNode());
|
|
@@ -1818,6 +1801,13 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1818
1801
|
}
|
|
1819
1802
|
else {
|
|
1820
1803
|
expand = !(!data.expanded || !getExpandStatus(this.parent, data, this.parent.grid.getCurrentViewRecords()));
|
|
1804
|
+
// TicketsID 43483: While Modify Data Expand and Collapse Icon Behavior Changed
|
|
1805
|
+
if (this.parent.editSettings.mode === 'Cell' && !isRemoteData(this.parent)) {
|
|
1806
|
+
var selectedRow = this.parent.flatData.find(function (item) { return item.uniqueID === data.uniqueID; });
|
|
1807
|
+
if (!isNullOrUndefined(selectedRow)) {
|
|
1808
|
+
expand = data.expanded !== selectedRow.expanded ? selectedRow.expanded : data.expanded;
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1821
1811
|
}
|
|
1822
1812
|
addClass([expandIcon], (expand) ? 'e-treegridexpand' : 'e-treegridcollapse');
|
|
1823
1813
|
totalIconsWidth += 18;
|
|
@@ -1935,7 +1925,7 @@ var Render = /** @__PURE__ @class */ (function () {
|
|
|
1935
1925
|
var templateFn = 'templateFn';
|
|
1936
1926
|
var colindex = args.column.index;
|
|
1937
1927
|
if (isNullOrUndefined(treeColumn.field)) {
|
|
1938
|
-
args.cell.setAttribute('
|
|
1928
|
+
args.cell.setAttribute('aria-colindex', (colindex + 1) + '');
|
|
1939
1929
|
}
|
|
1940
1930
|
if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {
|
|
1941
1931
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -2407,7 +2397,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2407
2397
|
qry.expand(expandDetail);
|
|
2408
2398
|
}
|
|
2409
2399
|
qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
|
|
2410
|
-
if (rowDetails.action === 'remoteExpand' && this.parent.grid.
|
|
2400
|
+
if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
|
|
2411
2401
|
var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
|
|
2412
2402
|
qry.queries.push(filterqry[0]);
|
|
2413
2403
|
}
|
|
@@ -2476,115 +2466,116 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2476
2466
|
rowDetails.record.childRecords = result;
|
|
2477
2467
|
}
|
|
2478
2468
|
for (var r = 0; r < result.length; r++) {
|
|
2479
|
-
|
|
2469
|
+
var record = result[parseInt(r.toString(), 10)];
|
|
2470
|
+
if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
|
|
2480
2471
|
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
2481
2472
|
}
|
|
2482
|
-
else if (_this.parent.enableVirtualization &&
|
|
2473
|
+
else if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'collapse') {
|
|
2483
2474
|
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
2484
2475
|
if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
2485
2476
|
_this.parent["" + remoteExpandedData].splice(i, 1);
|
|
2486
2477
|
}
|
|
2487
2478
|
}
|
|
2488
2479
|
}
|
|
2489
|
-
|
|
2490
|
-
if (
|
|
2480
|
+
record.taskData = extend$1({}, record);
|
|
2481
|
+
if (record["" + _this.parent.parentIdMapping] && _this.parent.enableVirtualization && _this.parent["" + remoteExpandedData].length) {
|
|
2491
2482
|
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
2492
|
-
if (
|
|
2493
|
-
|
|
2483
|
+
if (record["" + _this.parent.parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
2484
|
+
record.level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
|
|
2494
2485
|
var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
|
|
2495
2486
|
delete parentData.childRecords;
|
|
2496
|
-
|
|
2497
|
-
|
|
2487
|
+
record.parentItem = parentData;
|
|
2488
|
+
record.parentUniqueID = parentData.uniqueID;
|
|
2498
2489
|
}
|
|
2499
2490
|
}
|
|
2500
2491
|
}
|
|
2501
2492
|
else if (_this.parent.enableVirtualization) {
|
|
2502
|
-
if ((
|
|
2503
|
-
_this.parentItems.indexOf(
|
|
2493
|
+
if ((record["" + _this.parent.hasChildMapping] ||
|
|
2494
|
+
_this.parentItems.indexOf(record["" + _this.parent.idMapping]) !== -1)
|
|
2504
2495
|
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
2505
|
-
if (isNullOrUndefined(
|
|
2506
|
-
|
|
2496
|
+
if (isNullOrUndefined(record["" + _this.parent.parentIdMapping])) {
|
|
2497
|
+
record.level = 0;
|
|
2507
2498
|
if (rowDetails.action === 'remoteExpand') {
|
|
2508
|
-
|
|
2509
|
-
|
|
2499
|
+
record.childRecords = [];
|
|
2500
|
+
record.childRecords = rowDetails.record.childRecords;
|
|
2510
2501
|
}
|
|
2511
2502
|
}
|
|
2512
2503
|
else {
|
|
2513
|
-
|
|
2504
|
+
record.level = rowDetails.record.level;
|
|
2514
2505
|
}
|
|
2515
2506
|
}
|
|
2516
2507
|
else {
|
|
2517
2508
|
var parentData = extend$1({}, rowDetails.record);
|
|
2518
2509
|
delete parentData.childRecords;
|
|
2519
|
-
|
|
2520
|
-
|
|
2510
|
+
record.parentItem = parentData;
|
|
2511
|
+
record.parentUniqueID = rowDetails.record.uniqueID;
|
|
2521
2512
|
}
|
|
2522
2513
|
}
|
|
2523
2514
|
else {
|
|
2524
|
-
|
|
2515
|
+
record.level = rowDetails.record.level + 1;
|
|
2525
2516
|
var parentData = extend$1({}, rowDetails.record);
|
|
2526
2517
|
delete parentData.childRecords;
|
|
2527
|
-
|
|
2528
|
-
|
|
2518
|
+
record.parentItem = parentData;
|
|
2519
|
+
record.parentUniqueID = rowDetails.record.uniqueID;
|
|
2529
2520
|
}
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
if (rowDetails.record["" + _this.parent.idMapping] ===
|
|
2533
|
-
rowDetails.record.uniqueID =
|
|
2521
|
+
record.index = Math.ceil(Math.random() * 1000);
|
|
2522
|
+
record.uniqueID = getUid(_this.parent.element.id + '_data_');
|
|
2523
|
+
if (rowDetails.record["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
|
|
2524
|
+
rowDetails.record.uniqueID = record.uniqueID;
|
|
2534
2525
|
}
|
|
2535
|
-
|
|
2536
|
-
if (_this.parent.enableVirtualization && isNullOrUndefined(
|
|
2526
|
+
record.checkboxState = 'uncheck';
|
|
2527
|
+
if (_this.parent.enableVirtualization && isNullOrUndefined(record.level)) {
|
|
2537
2528
|
for (var p = 0; p < _this.parent.grid.currentViewData.length; p++) {
|
|
2538
|
-
if (_this.parent.grid.currentViewData[parseInt(p.toString(), 10)]["" + _this.parent.idMapping] ===
|
|
2539
|
-
|
|
2529
|
+
if (_this.parent.grid.currentViewData[parseInt(p.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.parentIdMapping]) {
|
|
2530
|
+
record.level = _this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
|
|
2540
2531
|
}
|
|
2541
2532
|
}
|
|
2542
2533
|
}
|
|
2543
|
-
setValue('uniqueIDCollection.' +
|
|
2534
|
+
setValue('uniqueIDCollection.' + record.uniqueID, record, _this.parent);
|
|
2544
2535
|
// delete result[r].parentItem.childRecords;
|
|
2545
|
-
if ((
|
|
2546
|
-
_this.parentItems.indexOf(
|
|
2536
|
+
if ((record["" + _this.parent.hasChildMapping] ||
|
|
2537
|
+
_this.parentItems.indexOf(record["" + _this.parent.idMapping]) !== -1)
|
|
2547
2538
|
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
2548
|
-
|
|
2539
|
+
record.hasChildRecords = true;
|
|
2549
2540
|
if (_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand) {
|
|
2550
2541
|
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
2551
|
-
if (
|
|
2552
|
-
|
|
2542
|
+
if (record["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
2543
|
+
record.expanded = _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];
|
|
2553
2544
|
}
|
|
2554
2545
|
}
|
|
2555
|
-
if (rowDetails.action === 'collapse' &&
|
|
2556
|
-
|
|
2546
|
+
if (rowDetails.action === 'collapse' && record["" + _this.parent.idMapping] !== rowDetails.record["" + _this.parent.idMapping] && record.expanded !== false) {
|
|
2547
|
+
record.expanded = true;
|
|
2557
2548
|
}
|
|
2558
|
-
else if (rowDetails.action === 'collapse' &&
|
|
2559
|
-
|
|
2549
|
+
else if (rowDetails.action === 'collapse' && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
|
|
2550
|
+
record.expanded = false;
|
|
2560
2551
|
_this.parent["" + remoteCollapsedData].push(rowDetails.record);
|
|
2561
2552
|
}
|
|
2562
2553
|
else if (rowDetails.action === 'remoteExpand') {
|
|
2563
2554
|
for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {
|
|
2564
|
-
if (_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] ===
|
|
2555
|
+
if (_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
|
|
2565
2556
|
result.splice(r, 1, _this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
|
|
2566
2557
|
}
|
|
2567
2558
|
}
|
|
2568
|
-
if (
|
|
2559
|
+
if (record[_this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
|
|
2569
2560
|
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
2570
2561
|
if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
2571
2562
|
_this.parent["" + remoteCollapsedData].splice(i, 1);
|
|
2572
2563
|
}
|
|
2573
2564
|
}
|
|
2574
2565
|
}
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2566
|
+
if (record.expanded !== false) {
|
|
2567
|
+
record.expanded = true;
|
|
2577
2568
|
}
|
|
2578
2569
|
}
|
|
2579
2570
|
}
|
|
2580
|
-
else if (_this.parent.enableVirtualization &&
|
|
2581
|
-
|
|
2571
|
+
else if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action !== 'collapse') {
|
|
2572
|
+
record.expanded = true;
|
|
2582
2573
|
}
|
|
2583
2574
|
else if (!(_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand)) {
|
|
2584
|
-
|
|
2575
|
+
record.expanded = false;
|
|
2585
2576
|
}
|
|
2586
2577
|
}
|
|
2587
|
-
datas.splice(inx + r + 1, 0,
|
|
2578
|
+
datas.splice(inx + r + 1, 0, record);
|
|
2588
2579
|
}
|
|
2589
2580
|
setValue('result', datas, e);
|
|
2590
2581
|
setValue('action', 'beforecontentrender', e);
|
|
@@ -2926,7 +2917,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2926
2917
|
}());
|
|
2927
2918
|
|
|
2928
2919
|
/**
|
|
2929
|
-
* Defines
|
|
2920
|
+
* Defines enumerable toolbar items for programmatic access.
|
|
2930
2921
|
*
|
|
2931
2922
|
* @hidden
|
|
2932
2923
|
*/
|
|
@@ -2948,7 +2939,7 @@ var ToolbarItem;
|
|
|
2948
2939
|
ToolbarItem[ToolbarItem["RowOutdent"] = 13] = "RowOutdent";
|
|
2949
2940
|
})(ToolbarItem || (ToolbarItem = {}));
|
|
2950
2941
|
/**
|
|
2951
|
-
*
|
|
2942
|
+
* Enumerates detailed context menu items used for menu configurations.
|
|
2952
2943
|
*
|
|
2953
2944
|
* @hidden
|
|
2954
2945
|
*/
|
|
@@ -2994,7 +2985,7 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
2994
2985
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2995
2986
|
};
|
|
2996
2987
|
/**
|
|
2997
|
-
* Configures the paging behavior of the TreeGrid.
|
|
2988
|
+
* Configures the paging behavior of the TreeGrid, enabling you to manage and display data efficiently across multiple pages.
|
|
2998
2989
|
*/
|
|
2999
2990
|
var PageSettings = /** @__PURE__ @class */ (function (_super) {
|
|
3000
2991
|
__extends$8(PageSettings, _super);
|
|
@@ -3048,7 +3039,7 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3048
3039
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3049
3040
|
};
|
|
3050
3041
|
/**
|
|
3051
|
-
* Configures the
|
|
3042
|
+
* Configures the aggregate column for the TreeGrid.
|
|
3052
3043
|
*/
|
|
3053
3044
|
var AggregateColumn = /** @__PURE__ @class */ (function (_super) {
|
|
3054
3045
|
__extends$9(AggregateColumn, _super);
|
|
@@ -3139,6 +3130,9 @@ var AggregateColumn = /** @__PURE__ @class */ (function (_super) {
|
|
|
3139
3130
|
], AggregateColumn.prototype, "customAggregate", void 0);
|
|
3140
3131
|
return AggregateColumn;
|
|
3141
3132
|
}(ChildProperty));
|
|
3133
|
+
/**
|
|
3134
|
+
* Configures the aggregate rows in the TreeGrid.
|
|
3135
|
+
*/
|
|
3142
3136
|
var AggregateRow = /** @__PURE__ @class */ (function (_super) {
|
|
3143
3137
|
__extends$9(AggregateRow, _super);
|
|
3144
3138
|
function AggregateRow() {
|
|
@@ -3173,7 +3167,7 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3173
3167
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3174
3168
|
};
|
|
3175
3169
|
/**
|
|
3176
|
-
* Configures the edit behavior of the TreeGrid.
|
|
3170
|
+
* Configures the edit behavior of the TreeGrid, defining how records can be added, modified, or deleted.
|
|
3177
3171
|
*/
|
|
3178
3172
|
var EditSettings = /** @__PURE__ @class */ (function (_super) {
|
|
3179
3173
|
__extends$a(EditSettings, _super);
|
|
@@ -3236,7 +3230,7 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3236
3230
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3237
3231
|
};
|
|
3238
3232
|
/**
|
|
3239
|
-
* Represents the field name and direction of sort column.
|
|
3233
|
+
* Represents the field name and direction of a sort column in the TreeGrid.
|
|
3240
3234
|
*/
|
|
3241
3235
|
var SortDescriptor = /** @__PURE__ @class */ (function (_super) {
|
|
3242
3236
|
__extends$b(SortDescriptor, _super);
|
|
@@ -3252,7 +3246,7 @@ var SortDescriptor = /** @__PURE__ @class */ (function (_super) {
|
|
|
3252
3246
|
return SortDescriptor;
|
|
3253
3247
|
}(ChildProperty));
|
|
3254
3248
|
/**
|
|
3255
|
-
* Configures the sorting behavior of TreeGrid.
|
|
3249
|
+
* Configures the sorting behavior of the TreeGrid.
|
|
3256
3250
|
*/
|
|
3257
3251
|
var SortSettings = /** @__PURE__ @class */ (function (_super) {
|
|
3258
3252
|
__extends$b(SortSettings, _super);
|
|
@@ -3695,7 +3689,7 @@ var __decorate$a = (undefined && undefined.__decorate) || function (decorators,
|
|
|
3695
3689
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3696
3690
|
};
|
|
3697
3691
|
/**
|
|
3698
|
-
* Configures the infinite scroll behavior of Tree Grid.
|
|
3692
|
+
* Configures the infinite scroll behavior of the Tree Grid.
|
|
3699
3693
|
*/
|
|
3700
3694
|
var InfiniteScrollSettings = /** @__PURE__ @class */ (function (_super) {
|
|
3701
3695
|
__extends$c(InfiniteScrollSettings, _super);
|
|
@@ -3796,13 +3790,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3796
3790
|
}
|
|
3797
3791
|
TreeGrid_1 = TreeGrid;
|
|
3798
3792
|
/**
|
|
3799
|
-
*
|
|
3793
|
+
* Exports the TreeGrid data to an Excel file (.xlsx).
|
|
3800
3794
|
*
|
|
3801
|
-
* @param
|
|
3802
|
-
* @param
|
|
3803
|
-
* @param
|
|
3804
|
-
* @param
|
|
3805
|
-
* @returns {Promise<any>} - Returns promise
|
|
3795
|
+
* @param {ExcelExportProperties | TreeGridExcelExportProperties} excelExportProperties - The properties used to configure the Excel export.
|
|
3796
|
+
* @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
|
|
3797
|
+
* @param {workbook} workbook - The workbook instance used for multiple exports.
|
|
3798
|
+
* @param {boolean} isBlob - If set to true, the result will be returned as blob data.
|
|
3799
|
+
* @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
|
|
3806
3800
|
*/
|
|
3807
3801
|
/* eslint-disable */
|
|
3808
3802
|
TreeGrid.prototype.excelExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {
|
|
@@ -3810,13 +3804,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3810
3804
|
return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false);
|
|
3811
3805
|
};
|
|
3812
3806
|
/**
|
|
3813
|
-
*
|
|
3807
|
+
* Exports the TreeGrid data to a CSV file.
|
|
3814
3808
|
*
|
|
3815
|
-
* @param
|
|
3816
|
-
* @param
|
|
3817
|
-
* @param
|
|
3818
|
-
* @param
|
|
3819
|
-
* @returns {Promise<any>} - Returns promise
|
|
3809
|
+
* @param {ExcelExportProperties} excelExportProperties - The properties used to configure the CSV export.
|
|
3810
|
+
* @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
|
|
3811
|
+
* @param {workbook} workbook - The workbook instance used for multiple exports.
|
|
3812
|
+
* @param {boolean} isBlob - If set to true, the result will be returned as blob data.
|
|
3813
|
+
* @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
|
|
3820
3814
|
*/
|
|
3821
3815
|
/* eslint-disable */
|
|
3822
3816
|
TreeGrid.prototype.csvExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {
|
|
@@ -3824,21 +3818,21 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3824
3818
|
return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true);
|
|
3825
3819
|
};
|
|
3826
3820
|
/**
|
|
3827
|
-
*
|
|
3821
|
+
* Exports the TreeGrid data to a PDF document.
|
|
3828
3822
|
*
|
|
3829
|
-
* @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties -
|
|
3830
|
-
* @param {boolean} isMultipleExport -
|
|
3831
|
-
* @param {Object} pdfDoc -
|
|
3832
|
-
* @param {boolean} isBlob - If
|
|
3833
|
-
* @returns {Promise<any>} - Returns promise
|
|
3823
|
+
* @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties - The properties used to configure the PDF export.
|
|
3824
|
+
* @param {boolean} isMultipleExport - Indicates whether multiple exporting is enabled.
|
|
3825
|
+
* @param {Object} pdfDoc - The PDF document instance used for multiple exports.
|
|
3826
|
+
* @param {boolean} isBlob - If set to true, the result will be returned as blob data.
|
|
3827
|
+
* @returns {Promise<any>} - Returns a promise that resolves with the result of the export action.
|
|
3834
3828
|
*/
|
|
3835
3829
|
TreeGrid.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
|
|
3836
3830
|
return this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
|
|
3837
3831
|
};
|
|
3838
3832
|
/**
|
|
3839
|
-
* Sends a
|
|
3833
|
+
* Sends a POST request to export the TreeGrid to an Excel file on the server side.
|
|
3840
3834
|
*
|
|
3841
|
-
* @param
|
|
3835
|
+
* @param {string} url - The URL for the server-side Excel export action.
|
|
3842
3836
|
* @returns {void}
|
|
3843
3837
|
*/
|
|
3844
3838
|
TreeGrid.prototype.serverExcelExport = function (url) {
|
|
@@ -3846,9 +3840,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3846
3840
|
this.exportTreeGrid(url);
|
|
3847
3841
|
};
|
|
3848
3842
|
/**
|
|
3849
|
-
* Sends a
|
|
3843
|
+
* Sends a POST request to export the TreeGrid to a PDF document on the server side.
|
|
3850
3844
|
*
|
|
3851
|
-
* @param
|
|
3845
|
+
* @param {string} url - The URL for the server-side PDF export action.
|
|
3852
3846
|
* @returns {void}
|
|
3853
3847
|
*/
|
|
3854
3848
|
TreeGrid.prototype.serverPdfExport = function (url) {
|
|
@@ -3856,9 +3850,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3856
3850
|
this.exportTreeGrid(url);
|
|
3857
3851
|
};
|
|
3858
3852
|
/**
|
|
3859
|
-
* Sends a
|
|
3853
|
+
* Sends a POST request to export the TreeGrid to a CSV file on the server side.
|
|
3860
3854
|
*
|
|
3861
|
-
* @param
|
|
3855
|
+
* @param {string} url - The URL for the server-side CSV export action.
|
|
3862
3856
|
* @returns {void}
|
|
3863
3857
|
*/
|
|
3864
3858
|
TreeGrid.prototype.serverCsvExport = function (url) {
|
|
@@ -3886,7 +3880,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3886
3880
|
treeGridModel.searchSettings.fields = queries.search && queries.search[0]['fields'] || [];
|
|
3887
3881
|
treeGridModel.sortSettings.columns = queries.sorted;
|
|
3888
3882
|
treeGridModel.columns = this.setHeaderText(treeGridModel.columns, include);
|
|
3889
|
-
var form = this.createElement('form', { id: 'ExportForm'
|
|
3883
|
+
var form = this.createElement('form', { id: 'ExportForm' });
|
|
3884
|
+
form.style.display = 'none';
|
|
3890
3885
|
var treeGridInput = this.createElement('input', { id: 'treeGridInput', attrs: { name: 'treeGridModel' } });
|
|
3891
3886
|
treeGridInput.value = JSON.stringify(treeGridModel);
|
|
3892
3887
|
form.method = 'POST';
|
|
@@ -3977,11 +3972,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3977
3972
|
}
|
|
3978
3973
|
};
|
|
3979
3974
|
/**
|
|
3980
|
-
* Sorts a column with the
|
|
3975
|
+
* Sorts a column with the specified options.
|
|
3981
3976
|
*
|
|
3982
|
-
* @param {string} columnName -
|
|
3983
|
-
* @param {SortDirection} direction -
|
|
3984
|
-
* @param {boolean} isMultiSort - Specifies whether
|
|
3977
|
+
* @param {string} columnName - The name of the column to be sorted.
|
|
3978
|
+
* @param {SortDirection} direction - The direction of the sorting operation.
|
|
3979
|
+
* @param {boolean} isMultiSort - Specifies whether previous sorted columns should be maintained during sorting.
|
|
3985
3980
|
* @returns {void}
|
|
3986
3981
|
*/
|
|
3987
3982
|
TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {
|
|
@@ -3990,7 +3985,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
3990
3985
|
}
|
|
3991
3986
|
};
|
|
3992
3987
|
/**
|
|
3993
|
-
* Clears all the sorted columns
|
|
3988
|
+
* Clears all the sorted columns in the TreeGrid.
|
|
3994
3989
|
*
|
|
3995
3990
|
* @returns {void}
|
|
3996
3991
|
*/
|
|
@@ -4000,9 +3995,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4000
3995
|
}
|
|
4001
3996
|
};
|
|
4002
3997
|
/**
|
|
4003
|
-
*
|
|
3998
|
+
* Removes the sorted state from a column specified by the field name.
|
|
4004
3999
|
*
|
|
4005
|
-
* @param {string} field -
|
|
4000
|
+
* @param {string} field - The field name of the column from which the sort state should be removed.
|
|
4006
4001
|
* @returns {void}
|
|
4007
4002
|
* @hidden
|
|
4008
4003
|
*/
|
|
@@ -4012,36 +4007,32 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4012
4007
|
}
|
|
4013
4008
|
};
|
|
4014
4009
|
/**
|
|
4015
|
-
* Searches TreeGrid records using
|
|
4016
|
-
*
|
|
4017
|
-
* [`searchSettings`](./#searchsettings/).
|
|
4010
|
+
* Searches for TreeGrid records using a specified search string.
|
|
4011
|
+
* Customize the search behavior through the [searchSettings](./#searchsettings/).
|
|
4018
4012
|
*
|
|
4019
|
-
* @param
|
|
4013
|
+
* @param {string} searchString - The string used as the search key.
|
|
4020
4014
|
* @returns {void}
|
|
4021
4015
|
*/
|
|
4022
4016
|
TreeGrid.prototype.search = function (searchString) {
|
|
4023
4017
|
this.grid.search(searchString);
|
|
4024
4018
|
};
|
|
4025
4019
|
/**
|
|
4026
|
-
*
|
|
4027
|
-
*
|
|
4028
|
-
*
|
|
4020
|
+
* Adjusts column widths to fit their content, ensuring content is displayed without wrapping or truncation.
|
|
4021
|
+
* - Hidden columns are ignored by this method.
|
|
4022
|
+
* - Use the `autoFitColumns` method during the `dataBound` event for initial rendering.
|
|
4029
4023
|
*
|
|
4030
|
-
* @param
|
|
4024
|
+
* @param {string | string[]} fieldNames - The name(s) of the column(s) to be auto-fitted.
|
|
4031
4025
|
* @returns {void}
|
|
4032
|
-
*
|
|
4033
|
-
*
|
|
4034
|
-
*
|
|
4035
4026
|
*/
|
|
4036
4027
|
TreeGrid.prototype.autoFitColumns = function (fieldNames) {
|
|
4037
4028
|
this.resizeModule.autoFitColumns(fieldNames);
|
|
4038
4029
|
this.updateColumnModel();
|
|
4039
4030
|
};
|
|
4040
4031
|
/**
|
|
4041
|
-
*
|
|
4032
|
+
* Reorders TreeGrid columns by specifying their field names.
|
|
4042
4033
|
*
|
|
4043
|
-
* @param
|
|
4044
|
-
* @param
|
|
4034
|
+
* @param {string | string[]} fromFName - The field name(s) of the column(s) to be moved.
|
|
4035
|
+
* @param {string} toFName - The destination field name to place the moved columns.
|
|
4045
4036
|
* @returns {void}
|
|
4046
4037
|
*/
|
|
4047
4038
|
TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {
|
|
@@ -4064,9 +4055,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4064
4055
|
}
|
|
4065
4056
|
};
|
|
4066
4057
|
/**
|
|
4067
|
-
*
|
|
4068
|
-
*
|
|
4069
|
-
* [`printMode`](./#printmode).
|
|
4058
|
+
* Prints all the pages of the TreeGrid and hides the pager by default.
|
|
4059
|
+
* Customize print options using the [printMode](./#printmode).
|
|
4070
4060
|
*
|
|
4071
4061
|
* @returns {void}
|
|
4072
4062
|
*/
|
|
@@ -4210,7 +4200,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4210
4200
|
this.isSelfReference = !isNullOrUndefined(this.parentIdMapping);
|
|
4211
4201
|
};
|
|
4212
4202
|
/**
|
|
4213
|
-
*
|
|
4203
|
+
* Attaches event handlers to the necessary elements during the component's initialization.
|
|
4214
4204
|
*
|
|
4215
4205
|
* @hidden
|
|
4216
4206
|
* @returns {void}
|
|
@@ -4228,9 +4218,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4228
4218
|
}
|
|
4229
4219
|
};
|
|
4230
4220
|
/**
|
|
4231
|
-
*
|
|
4221
|
+
* Provides a list of the modules that are required for rendering the TreeGrid component.
|
|
4222
|
+
*
|
|
4223
|
+
* This method is essential for ensuring that all dependent modules are loaded and available
|
|
4224
|
+
* during the component's lifecycle, enabling full functionality.
|
|
4232
4225
|
*
|
|
4233
|
-
* @returns {ModuleDeclaration[]} - Returns TreeGrid
|
|
4226
|
+
* @returns {ModuleDeclaration[]} - Returns an array of the required TreeGrid module declarations.
|
|
4234
4227
|
* @hidden
|
|
4235
4228
|
*/
|
|
4236
4229
|
TreeGrid.prototype.requiredModules = function () {
|
|
@@ -4547,7 +4540,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4547
4540
|
if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
|
|
4548
4541
|
failureCases.push('Virtual scrolling is not compatible with the detail template');
|
|
4549
4542
|
}
|
|
4550
|
-
if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; })
|
|
4543
|
+
if ((this.frozenColumns > 0 || this.frozenRows > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }))
|
|
4551
4544
|
&& (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
|
|
4552
4545
|
failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
|
|
4553
4546
|
}
|
|
@@ -4557,9 +4550,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4557
4550
|
if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
|
|
4558
4551
|
failureCases.push('Selection is not supported in RowTemplate');
|
|
4559
4552
|
}
|
|
4560
|
-
if (this.treeColumnIndex < 0) {
|
|
4561
|
-
failureCases.push('For showing tree structure it is must to set the TreeColumnIndex value.');
|
|
4562
|
-
}
|
|
4563
4553
|
if (this.treeColumnIndex >= this.columns.length) {
|
|
4564
4554
|
failureCases.push('TreeColumnIndex value should not exceed the total column count.');
|
|
4565
4555
|
}
|
|
@@ -4585,9 +4575,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4585
4575
|
failureCases.push('Only one column can have the ShowCheckbox option enabled.');
|
|
4586
4576
|
}
|
|
4587
4577
|
}
|
|
4588
|
-
var alignColumn
|
|
4589
|
-
if (
|
|
4590
|
-
|
|
4578
|
+
var alignColumn;
|
|
4579
|
+
if (this.treeColumnIndex !== null && this.treeColumnIndex !== -1) {
|
|
4580
|
+
alignColumn = this.columnModel.filter(function (col) { return col.textAlign === 'Right' && col.field === _this.columnModel[_this.treeColumnIndex].field; });
|
|
4581
|
+
if (alignColumn.length !== 0) {
|
|
4582
|
+
failureCases.push('TextAlign right for the tree column is not applicable.');
|
|
4583
|
+
}
|
|
4591
4584
|
}
|
|
4592
4585
|
if (failureCases.length > 0) {
|
|
4593
4586
|
var failureEventArgs_1 = {
|
|
@@ -4623,7 +4616,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4623
4616
|
this.flatData = data;
|
|
4624
4617
|
this.flatData.filter(function (e) {
|
|
4625
4618
|
setValue('uniqueIDCollection.' + e.uniqueID, e, _this);
|
|
4626
|
-
if (e.level === 0) {
|
|
4619
|
+
if (e.level === 0 && !_this.parentData.some(function (record) { return record.uniqueID === e.uniqueID; })) {
|
|
4627
4620
|
_this.parentData.push(e);
|
|
4628
4621
|
}
|
|
4629
4622
|
});
|
|
@@ -4757,14 +4750,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
4757
4750
|
_this.trigger(rowDeselecting, args);
|
|
4758
4751
|
};
|
|
4759
4752
|
this.grid.rowSelected = function (args) {
|
|
4760
|
-
if (_this.enableVirtualization
|
|
4761
|
-
_this.
|
|
4762
|
-
var updateRowSelection = 'updateRowSelection';
|
|
4763
|
-
for (var i = 0; i < _this.getRows().length; i++) {
|
|
4764
|
-
if (_this.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
4765
|
-
_this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(i.toString(), 10)], _this.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
|
|
4766
|
-
}
|
|
4767
|
-
}
|
|
4753
|
+
if (_this.enableVirtualization) {
|
|
4754
|
+
_this.virtualScrollModule.updateSelection(args);
|
|
4768
4755
|
}
|
|
4769
4756
|
_this.selectedRowIndex = _this.grid.selectedRowIndex;
|
|
4770
4757
|
_this.notify(rowSelected, args);
|
|
@@ -5506,6 +5493,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5506
5493
|
}
|
|
5507
5494
|
return gridColumnCollection;
|
|
5508
5495
|
};
|
|
5496
|
+
TreeGrid.prototype.lastRowCellBorderUpdated = function () {
|
|
5497
|
+
var rows = this.getContentTable().querySelectorAll('tr.e-row');
|
|
5498
|
+
var visibleRows = Array.from(rows).filter(function (row) { return !row.classList.contains('e-childrow-hidden'); });
|
|
5499
|
+
if (visibleRows.length > 0) {
|
|
5500
|
+
var lastVisibleRow = visibleRows[visibleRows.length - 1];
|
|
5501
|
+
this.lastRowBorder(lastVisibleRow, true);
|
|
5502
|
+
}
|
|
5503
|
+
};
|
|
5509
5504
|
/**
|
|
5510
5505
|
* Called internally if any of the property value changed.
|
|
5511
5506
|
*
|
|
@@ -5731,7 +5726,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5731
5726
|
this.grid.refreshColumns();
|
|
5732
5727
|
};
|
|
5733
5728
|
/**
|
|
5734
|
-
* Destroys the component
|
|
5729
|
+
* Destroys the TreeGrid component by detaching event handlers,
|
|
5730
|
+
* removing attributes and classes, and clearing the component's DOM elements.
|
|
5731
|
+
*
|
|
5732
|
+
* This method ensures that all resources used by the TreeGrid are properly released
|
|
5733
|
+
* and the component is cleaned up from the DOM to prevent memory leaks.
|
|
5735
5734
|
*
|
|
5736
5735
|
* @method destroy
|
|
5737
5736
|
* @returns {void}
|
|
@@ -5769,7 +5768,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5769
5768
|
this.grid = null;
|
|
5770
5769
|
};
|
|
5771
5770
|
/**
|
|
5772
|
-
*
|
|
5771
|
+
* Updates the TreeGrid model and ensures that the underlying Grid's data model is in sync with TreeGrid.
|
|
5772
|
+
* This method binds current data and settings to the TreeGrid.
|
|
5773
5773
|
*
|
|
5774
5774
|
* @method dataBind
|
|
5775
5775
|
* @returns {void}
|
|
@@ -5788,7 +5788,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5788
5788
|
this.grid.dataBind();
|
|
5789
5789
|
};
|
|
5790
5790
|
/**
|
|
5791
|
-
*
|
|
5791
|
+
* Retrieves the properties of the TreeGrid that should be retained and persisted between sessions.
|
|
5792
|
+
*
|
|
5793
|
+
* The method ensures that user preferences and important settings like paging, sorting, filtering,
|
|
5794
|
+
* column configurations, etc., are preserved and can be restored when the component is re-initialized.
|
|
5792
5795
|
*
|
|
5793
5796
|
* @returns {string} - Returns persist properties details
|
|
5794
5797
|
* @hidden
|
|
@@ -5880,7 +5883,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5880
5883
|
}
|
|
5881
5884
|
};
|
|
5882
5885
|
/**
|
|
5883
|
-
*
|
|
5886
|
+
* Retrieves all the TreeGrid row elements.
|
|
5887
|
+
*
|
|
5888
|
+
* This method is useful for accessing the HTML representation of the rows for further manipulation or inspection.
|
|
5884
5889
|
*
|
|
5885
5890
|
* @returns {HTMLTableRowElement[]} - Returns row elements collection
|
|
5886
5891
|
*/
|
|
@@ -5888,7 +5893,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5888
5893
|
return this.grid.getRows();
|
|
5889
5894
|
};
|
|
5890
5895
|
/**
|
|
5891
|
-
*
|
|
5896
|
+
* Obtains the pager element of the TreeGrid.
|
|
5897
|
+
*
|
|
5898
|
+
* The pager enables navigation between pages when the TreeGrid displays paginated data.
|
|
5892
5899
|
*
|
|
5893
5900
|
* @returns {Element} - Returns pager element
|
|
5894
5901
|
*/
|
|
@@ -5896,12 +5903,14 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5896
5903
|
return this.grid.getPager(); //get element from pager
|
|
5897
5904
|
};
|
|
5898
5905
|
/**
|
|
5899
|
-
* Adds a new record to the TreeGrid
|
|
5900
|
-
*
|
|
5906
|
+
* Adds a new record to the TreeGrid at the specified position or default location.
|
|
5907
|
+
*
|
|
5908
|
+
* @param {Object} data - Object containing the data for the new record. If omitted, an empty row is added.
|
|
5909
|
+
* @param {number} index - The index at which the new row should be added.
|
|
5910
|
+
* @param {RowPosition} position - Specifies the position of the new row (e.g., before, after or child).
|
|
5911
|
+
*
|
|
5912
|
+
* > Requires `editSettings.allowAdding` to be true.
|
|
5901
5913
|
*
|
|
5902
|
-
* @param {Object} data - Defines the new add record data.
|
|
5903
|
-
* @param {number} index - Defines the row index to be added.
|
|
5904
|
-
* @param {RowPosition} position - Defines the new row position to be added.
|
|
5905
5914
|
* @returns {void}
|
|
5906
5915
|
*/
|
|
5907
5916
|
TreeGrid.prototype.addRecord = function (data, index, position) {
|
|
@@ -5912,7 +5921,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5912
5921
|
}
|
|
5913
5922
|
};
|
|
5914
5923
|
/**
|
|
5915
|
-
* Cancels
|
|
5924
|
+
* Cancels the current edit operation on the TreeGrid.
|
|
5925
|
+
*
|
|
5926
|
+
* This method discards changes made to the row and exits the edit mode without saving.
|
|
5916
5927
|
*
|
|
5917
5928
|
* @returns {void}
|
|
5918
5929
|
*/
|
|
@@ -5922,7 +5933,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5922
5933
|
}
|
|
5923
5934
|
};
|
|
5924
5935
|
/**
|
|
5925
|
-
* Saves the cell
|
|
5936
|
+
* Saves the current cell value changes without committing to the data source.
|
|
5937
|
+
*
|
|
5938
|
+
* This operation persists the changes in the UI but not in the underlying data model.
|
|
5926
5939
|
*
|
|
5927
5940
|
* @returns {void}
|
|
5928
5941
|
*/
|
|
@@ -5932,7 +5945,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5932
5945
|
}
|
|
5933
5946
|
};
|
|
5934
5947
|
/**
|
|
5935
|
-
*
|
|
5948
|
+
* Updates the value of a specific cell directly, bypassing the edit mode.
|
|
5949
|
+
*
|
|
5950
|
+
* This method provides a quick way to update the UI and data without user interaction.
|
|
5936
5951
|
*
|
|
5937
5952
|
* @param {number} rowIndex Defines the row index.
|
|
5938
5953
|
* @param {string} field Defines the column field.
|
|
@@ -5945,10 +5960,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5945
5960
|
}
|
|
5946
5961
|
};
|
|
5947
5962
|
/**
|
|
5948
|
-
*
|
|
5963
|
+
* Updates a specific row with given values directly, skipping the edit state.
|
|
5964
|
+
*
|
|
5965
|
+
* This method allows for bulk updates of row data programmatically.
|
|
5949
5966
|
*
|
|
5950
|
-
* @param {number} index
|
|
5951
|
-
* @param {Object} data
|
|
5967
|
+
* @param {number} index - The index of the row to update.
|
|
5968
|
+
* @param {Object} data - The data object containing updated field values.
|
|
5952
5969
|
* @returns {void}
|
|
5953
5970
|
*/
|
|
5954
5971
|
TreeGrid.prototype.updateRow = function (index, data) {
|
|
@@ -5964,12 +5981,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5964
5981
|
}
|
|
5965
5982
|
};
|
|
5966
5983
|
/**
|
|
5967
|
-
*
|
|
5968
|
-
* > `editSettings.allowDeleting` should be true.
|
|
5984
|
+
* Deletes a record based on specified criteria or the selected record if none specified.
|
|
5969
5985
|
*
|
|
5970
|
-
* @param {string} fieldName -
|
|
5971
|
-
* @param {Object} data -
|
|
5986
|
+
* @param {string} fieldName - The name of the primary key field.
|
|
5987
|
+
* @param {Object} data - The data object representing the record to delete.
|
|
5972
5988
|
* @returns {void}
|
|
5989
|
+
*
|
|
5990
|
+
* > Requires `editSettings.allowDeleting` to be true.
|
|
5973
5991
|
*/
|
|
5974
5992
|
TreeGrid.prototype.deleteRecord = function (fieldName, data) {
|
|
5975
5993
|
if ((isNullOrUndefined(fieldName) && (isNullOrUndefined(data)) || (this.getSelectedRecords().length <= 0))) {
|
|
@@ -5981,9 +5999,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5981
5999
|
}
|
|
5982
6000
|
};
|
|
5983
6001
|
/**
|
|
5984
|
-
*
|
|
6002
|
+
* Initiates editing for a specific row using its HTML element.
|
|
6003
|
+
*
|
|
6004
|
+
* This allows for manual control of which row enters edit mode through the UI.
|
|
5985
6005
|
*
|
|
5986
|
-
* @param {HTMLTableRowElement} row -
|
|
6006
|
+
* @param {HTMLTableRowElement} row - The table row element to enter into edit mode.
|
|
5987
6007
|
* @returns {void}
|
|
5988
6008
|
*/
|
|
5989
6009
|
TreeGrid.prototype.startEdit = function (row) {
|
|
@@ -5992,10 +6012,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
5992
6012
|
}
|
|
5993
6013
|
};
|
|
5994
6014
|
/**
|
|
5995
|
-
*
|
|
6015
|
+
* Begins editing of a specific cell using row and field indices.
|
|
5996
6016
|
*
|
|
5997
|
-
*
|
|
5998
|
-
*
|
|
6017
|
+
* Customers can programmatically specify which cell to edit without user input.
|
|
6018
|
+
*
|
|
6019
|
+
* @param {number} rowIndex - The index of the row containing the cell.
|
|
6020
|
+
* @param {string} field - The field name of the cell to edit.
|
|
5999
6021
|
* @returns {void}
|
|
6000
6022
|
*/
|
|
6001
6023
|
TreeGrid.prototype.editCell = function (rowIndex, field) {
|
|
@@ -6004,10 +6026,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6004
6026
|
}
|
|
6005
6027
|
};
|
|
6006
6028
|
/**
|
|
6007
|
-
* Enables or disables ToolBar items.
|
|
6029
|
+
* Enables or disables specified ToolBar items within the TreeGrid.
|
|
6008
6030
|
*
|
|
6009
|
-
*
|
|
6010
|
-
*
|
|
6031
|
+
* This facilitates dynamic control of toolbar actions based on application logic.
|
|
6032
|
+
*
|
|
6033
|
+
* @param {string[]} items - Array of ToolBar item IDs to enable or disable.
|
|
6034
|
+
* @param {boolean} isEnable - Boolean flag to determine whether to enable (true) or disable (false) items.
|
|
6011
6035
|
* @returns {void}
|
|
6012
6036
|
*/
|
|
6013
6037
|
TreeGrid.prototype.enableToolbarItems = function (items, isEnable) {
|
|
@@ -6016,7 +6040,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6016
6040
|
}
|
|
6017
6041
|
};
|
|
6018
6042
|
/**
|
|
6019
|
-
*
|
|
6043
|
+
* Commits the edits made to a record in edit mode, updating the data source.
|
|
6044
|
+
*
|
|
6045
|
+
* Use this method to finalize changes for rows in edit mode, ensuring persistence.
|
|
6020
6046
|
*
|
|
6021
6047
|
* @returns {void}
|
|
6022
6048
|
*/
|
|
@@ -6026,10 +6052,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6026
6052
|
}
|
|
6027
6053
|
};
|
|
6028
6054
|
/**
|
|
6029
|
-
*
|
|
6055
|
+
* Displays the column chooser at a specified screen position.
|
|
6056
|
+
*
|
|
6057
|
+
* Useful for customizing the visibility of columns interactively via the UI.
|
|
6030
6058
|
*
|
|
6031
|
-
* @param {number} x -
|
|
6032
|
-
* @param {number} y -
|
|
6059
|
+
* @param {number} x - The X-axis position of the column chooser.
|
|
6060
|
+
* @param {number} y - The Y-axis position of the column chooser.
|
|
6033
6061
|
* @returns {void}
|
|
6034
6062
|
*/
|
|
6035
6063
|
TreeGrid.prototype.openColumnChooser = function (x, y) {
|
|
@@ -6038,9 +6066,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6038
6066
|
}
|
|
6039
6067
|
};
|
|
6040
6068
|
/**
|
|
6041
|
-
*
|
|
6069
|
+
* Deletes a visible row from the TreeGrid using its HTML element.
|
|
6070
|
+
*
|
|
6071
|
+
* Apply this method when handling row deletions through DOM manipulations.
|
|
6042
6072
|
*
|
|
6043
|
-
* @param {HTMLTableRowElement} tr -
|
|
6073
|
+
* @param {HTMLTableRowElement} tr - The table row element to remove.
|
|
6044
6074
|
* @returns {void}
|
|
6045
6075
|
*/
|
|
6046
6076
|
TreeGrid.prototype.deleteRow = function (tr) {
|
|
@@ -6049,20 +6079,23 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6049
6079
|
}
|
|
6050
6080
|
};
|
|
6051
6081
|
/**
|
|
6052
|
-
*
|
|
6082
|
+
* Retrieves the primary key field names used in the TreeGrid.
|
|
6053
6083
|
*
|
|
6054
|
-
*
|
|
6084
|
+
* This information is crucial for identifying and manipulating unique rows.
|
|
6085
|
+
*
|
|
6086
|
+
* @returns {string[]} - Returns an array of primary key field names.
|
|
6055
6087
|
*/
|
|
6056
6088
|
TreeGrid.prototype.getPrimaryKeyFieldNames = function () {
|
|
6057
6089
|
return this.grid.getPrimaryKeyFieldNames();
|
|
6058
6090
|
};
|
|
6059
6091
|
/**
|
|
6060
|
-
* Updates
|
|
6061
|
-
*
|
|
6092
|
+
* Updates the value of a specific cell using its primary key for identification.
|
|
6093
|
+
*
|
|
6094
|
+
* Useful for targeted updates that leverage unique identifiers to ensure accuracy.
|
|
6062
6095
|
*
|
|
6063
|
-
* @param {string| number} key -
|
|
6064
|
-
* @param {string
|
|
6065
|
-
* @param {string | number | boolean | Date} value -
|
|
6096
|
+
* @param {string| number} key - The primary key value of the row containing the cell.
|
|
6097
|
+
* @param {string} field - The field name of the cell to update.
|
|
6098
|
+
* @param {string | number | boolean | Date} value - The new value to assign to the specified cell.
|
|
6066
6099
|
* @returns {void}
|
|
6067
6100
|
*/
|
|
6068
6101
|
TreeGrid.prototype.setCellValue = function (key, field, value) {
|
|
@@ -6072,11 +6105,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6072
6105
|
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
|
|
6073
6106
|
};
|
|
6074
6107
|
/**
|
|
6075
|
-
* Updates
|
|
6076
|
-
* > Primary key column must be specified using `columns.isPrimaryKey` property.
|
|
6108
|
+
* Updates the data for a specific row identified by its primary key and refreshes the display.
|
|
6077
6109
|
*
|
|
6078
|
-
*
|
|
6079
|
-
*
|
|
6110
|
+
* Important for keeping the displayed data consistent with the source database or dataset.
|
|
6111
|
+
*
|
|
6112
|
+
* @param {string| number} key - The primary key value of the row to update.
|
|
6113
|
+
* @param {Object} rowData - The new data to apply to the row.
|
|
6080
6114
|
* @returns {void}
|
|
6081
6115
|
*/
|
|
6082
6116
|
TreeGrid.prototype.setRowData = function (key, rowData) {
|
|
@@ -6114,9 +6148,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6114
6148
|
}
|
|
6115
6149
|
};
|
|
6116
6150
|
/**
|
|
6117
|
-
* Navigates to
|
|
6151
|
+
* Navigates to a specified page number within the TreeGrid pagination.
|
|
6118
6152
|
*
|
|
6119
|
-
*
|
|
6153
|
+
* This can be used to programmatically change the page being viewed,
|
|
6154
|
+
* allowing for scripted navigation through data.
|
|
6155
|
+
*
|
|
6156
|
+
* @param {number} pageNo - The page number to navigate to. Must be within valid page range.
|
|
6120
6157
|
* @returns {void}
|
|
6121
6158
|
*/
|
|
6122
6159
|
TreeGrid.prototype.goToPage = function (pageNo) {
|
|
@@ -6125,9 +6162,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6125
6162
|
}
|
|
6126
6163
|
};
|
|
6127
6164
|
/**
|
|
6128
|
-
*
|
|
6165
|
+
* Updates the external message displayed within the pager component.
|
|
6129
6166
|
*
|
|
6130
|
-
*
|
|
6167
|
+
* This is useful for showing custom messages or additional information
|
|
6168
|
+
* related to the data set or pagination status.
|
|
6169
|
+
*
|
|
6170
|
+
* @param {string} message - The custom message to display in the pager.
|
|
6131
6171
|
* @returns {void}
|
|
6132
6172
|
*/
|
|
6133
6173
|
TreeGrid.prototype.updateExternalMessage = function (message) {
|
|
@@ -6136,20 +6176,26 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6136
6176
|
}
|
|
6137
6177
|
};
|
|
6138
6178
|
/**
|
|
6139
|
-
*
|
|
6179
|
+
* Retrieves a cell element based on its row and column indices in the TreeGrid.
|
|
6140
6180
|
*
|
|
6141
|
-
*
|
|
6142
|
-
*
|
|
6143
|
-
*
|
|
6181
|
+
* This method is helpful for accessing cell-level elements for custom
|
|
6182
|
+
* operations or styling.
|
|
6183
|
+
*
|
|
6184
|
+
* @param {number} rowIndex - The index of the row containing the cell.
|
|
6185
|
+
* @param {number} columnIndex - The index of the column containing the cell.
|
|
6186
|
+
* @returns {Element} - Returns the HTML element of the specified cell.
|
|
6144
6187
|
*/
|
|
6145
6188
|
TreeGrid.prototype.getCellFromIndex = function (rowIndex, columnIndex) {
|
|
6146
6189
|
return this.grid.getCellFromIndex(rowIndex, columnIndex);
|
|
6147
6190
|
};
|
|
6148
6191
|
/**
|
|
6149
|
-
*
|
|
6192
|
+
* Retrieves a column object by the column's field name.
|
|
6150
6193
|
*
|
|
6151
|
-
*
|
|
6152
|
-
*
|
|
6194
|
+
* This is typically used for obtaining the details of a column for
|
|
6195
|
+
* configuration or data manipulation purposes.
|
|
6196
|
+
*
|
|
6197
|
+
* @param {string} field - The field name of the column.
|
|
6198
|
+
* @returns {Column} - Returns the column object corresponding to the field.
|
|
6153
6199
|
*/
|
|
6154
6200
|
TreeGrid.prototype.getColumnByField = function (field) {
|
|
6155
6201
|
return iterateArrayOrObject(this.columnModel, function (item) {
|
|
@@ -6160,10 +6206,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6160
6206
|
})[0];
|
|
6161
6207
|
};
|
|
6162
6208
|
/**
|
|
6163
|
-
*
|
|
6209
|
+
* Fetches a column object using the column's unique identifier (UID).
|
|
6210
|
+
*
|
|
6211
|
+
* Useful in scenarios where columns do not have unique field names but
|
|
6212
|
+
* are uniquely identifiable via UID.
|
|
6164
6213
|
*
|
|
6165
|
-
* @param
|
|
6166
|
-
* @returns {Column} - Returns
|
|
6214
|
+
* @param {string} uid - The unique identifier for the column.
|
|
6215
|
+
* @returns {Column} - Returns the column object for the given UID.
|
|
6167
6216
|
*/
|
|
6168
6217
|
TreeGrid.prototype.getColumnByUid = function (uid) {
|
|
6169
6218
|
var Columns = this.initialRender ? this.grid.columns : this.columns;
|
|
@@ -6179,34 +6228,45 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6179
6228
|
})[0];
|
|
6180
6229
|
};
|
|
6181
6230
|
/**
|
|
6182
|
-
*
|
|
6231
|
+
* Retrieves the names of all column fields in the TreeGrid.
|
|
6183
6232
|
*
|
|
6184
|
-
*
|
|
6233
|
+
* This method provides a list of field names useful for dynamic operations
|
|
6234
|
+
* or configuration where fields need to be enumerated or manipulated.
|
|
6235
|
+
*
|
|
6236
|
+
* @returns {string[]} - Returns an array of column field names.
|
|
6185
6237
|
*/
|
|
6186
6238
|
TreeGrid.prototype.getColumnFieldNames = function () {
|
|
6187
6239
|
return this.grid.getColumnFieldNames();
|
|
6188
6240
|
};
|
|
6189
6241
|
/**
|
|
6190
|
-
*
|
|
6242
|
+
* Retrieves the footer content element of the TreeGrid, usually for styling or custom manipulation.
|
|
6243
|
+
*
|
|
6244
|
+
* This can be used to access the footer for adding custom functionality
|
|
6245
|
+
* or styling purposes to enhance user interaction at the bottom of the grid.
|
|
6191
6246
|
*
|
|
6192
|
-
* @returns {Element} - Returns footer content
|
|
6247
|
+
* @returns {Element} - Returns the footer content HTML element.
|
|
6193
6248
|
*/
|
|
6194
6249
|
TreeGrid.prototype.getFooterContent = function () {
|
|
6195
6250
|
return this.grid.getFooterContent();
|
|
6196
6251
|
};
|
|
6197
6252
|
/**
|
|
6198
|
-
*
|
|
6253
|
+
* Acquires the footer table element of the TreeGrid for layout management.
|
|
6254
|
+
*
|
|
6255
|
+
* Useful for manipulating the table's structure or style beneath the grid content.
|
|
6199
6256
|
*
|
|
6200
|
-
* @returns {Element} - Returns footer
|
|
6257
|
+
* @returns {Element} - Returns the footer table HTML element.
|
|
6201
6258
|
*/
|
|
6202
6259
|
TreeGrid.prototype.getFooterContentTable = function () {
|
|
6203
6260
|
return this.grid.getFooterContentTable();
|
|
6204
6261
|
};
|
|
6205
6262
|
/**
|
|
6206
|
-
* Shows
|
|
6263
|
+
* Shows one or more columns based on the specified column names.
|
|
6207
6264
|
*
|
|
6208
|
-
*
|
|
6209
|
-
*
|
|
6265
|
+
* This is useful for dynamically adjusting the visibility of columns
|
|
6266
|
+
* based on user actions or application logic.
|
|
6267
|
+
*
|
|
6268
|
+
* @param {string|string[]} keys - A single column name or an array of column names to show.
|
|
6269
|
+
* @param {string} showBy - Key to determine visibility either as field name or header text.
|
|
6210
6270
|
* @returns {void}
|
|
6211
6271
|
*/
|
|
6212
6272
|
TreeGrid.prototype.showColumns = function (keys, showBy) {
|
|
@@ -6214,10 +6274,13 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6214
6274
|
this.updateColumnModel();
|
|
6215
6275
|
};
|
|
6216
6276
|
/**
|
|
6217
|
-
* Hides
|
|
6277
|
+
* Hides one or more columns based on the specified column names.
|
|
6278
|
+
*
|
|
6279
|
+
* Utilized to dynamically reduce the visibility of columns based on
|
|
6280
|
+
* user roles or preferences.
|
|
6218
6281
|
*
|
|
6219
|
-
* @param
|
|
6220
|
-
* @param
|
|
6282
|
+
* @param {string|string[]} keys - A single column name or an array of column names to hide.
|
|
6283
|
+
* @param {string} hideBy - Key to evaluate columns either as field name or header text.
|
|
6221
6284
|
* @returns {void}
|
|
6222
6285
|
*/
|
|
6223
6286
|
TreeGrid.prototype.hideColumns = function (keys, hideBy) {
|
|
@@ -6225,37 +6288,48 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6225
6288
|
this.updateColumnModel();
|
|
6226
6289
|
};
|
|
6227
6290
|
/**
|
|
6228
|
-
*
|
|
6291
|
+
* Retrieves a column header element based on the field name of the column.
|
|
6229
6292
|
*
|
|
6230
|
-
*
|
|
6231
|
-
*
|
|
6293
|
+
* This method helps to directly manipulate headers, such as applying custom styles.
|
|
6294
|
+
*
|
|
6295
|
+
* @param {string} field - The field name of the desired column.
|
|
6296
|
+
* @returns {Element} - Returns the HTML element of the column header.
|
|
6232
6297
|
*/
|
|
6233
6298
|
TreeGrid.prototype.getColumnHeaderByField = function (field) {
|
|
6234
6299
|
return this.grid.getColumnHeaderByField(field);
|
|
6235
6300
|
};
|
|
6236
6301
|
/**
|
|
6237
|
-
*
|
|
6302
|
+
* Acquires the column header element using the column's index.
|
|
6238
6303
|
*
|
|
6239
|
-
*
|
|
6240
|
-
*
|
|
6304
|
+
* Suitable for situations where direct column index is available
|
|
6305
|
+
* and header access is needed for operations.
|
|
6306
|
+
*
|
|
6307
|
+
* @param {number} index - The index of the column.
|
|
6308
|
+
* @returns {Element} - Returns the HTML element of the specified column header.
|
|
6241
6309
|
*/
|
|
6242
6310
|
TreeGrid.prototype.getColumnHeaderByIndex = function (index) {
|
|
6243
6311
|
return this.grid.getColumnHeaderByIndex(index);
|
|
6244
6312
|
};
|
|
6245
6313
|
/**
|
|
6246
|
-
*
|
|
6314
|
+
* Retrieves a column header element utilizing the column's UID.
|
|
6315
|
+
*
|
|
6316
|
+
* Useful for precision access to header elements when UIDs are used
|
|
6317
|
+
* uniquely to manage column identities.
|
|
6247
6318
|
*
|
|
6248
|
-
* @param {string} uid -
|
|
6249
|
-
* @returns {Element} - Returns column header
|
|
6319
|
+
* @param {string} uid - The UID of the column.
|
|
6320
|
+
* @returns {Element} - Returns the HTML element of the column header.
|
|
6250
6321
|
*/
|
|
6251
6322
|
TreeGrid.prototype.getColumnHeaderByUid = function (uid) {
|
|
6252
6323
|
return this.grid.getColumnHeaderByUid(uid);
|
|
6253
6324
|
};
|
|
6254
6325
|
/**
|
|
6255
|
-
*
|
|
6326
|
+
* Determines the column index by the specified field name.
|
|
6256
6327
|
*
|
|
6257
|
-
*
|
|
6258
|
-
*
|
|
6328
|
+
* Helpful in converting field names to indices for operations that require
|
|
6329
|
+
* numeric input for array or collection indexing.
|
|
6330
|
+
*
|
|
6331
|
+
* @param {string} field - The field name of the column.
|
|
6332
|
+
* @returns {number} - Returns the index of the column.
|
|
6259
6333
|
*/
|
|
6260
6334
|
TreeGrid.prototype.getColumnIndexByField = function (field) {
|
|
6261
6335
|
return this.grid.getColumnIndexByField(field);
|
|
@@ -6271,19 +6345,25 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6271
6345
|
return !isNullOrUndefined(index) ? index : -1;
|
|
6272
6346
|
};
|
|
6273
6347
|
/**
|
|
6274
|
-
*
|
|
6348
|
+
* Determines the column index based on the unique identifier (UID).
|
|
6349
|
+
*
|
|
6350
|
+
* This can be crucial in scenarios that involve dynamic column management
|
|
6351
|
+
* where UID provides an accurate reference.
|
|
6275
6352
|
*
|
|
6276
|
-
* @param
|
|
6277
|
-
* @returns {number} - Returns column index
|
|
6353
|
+
* @param {string} uid - The UID of the column.
|
|
6354
|
+
* @returns {number} - Returns the column index.
|
|
6278
6355
|
*/
|
|
6279
6356
|
TreeGrid.prototype.getColumnIndexByUid = function (uid) {
|
|
6280
6357
|
return this.grid.getColumnIndexByUid(uid);
|
|
6281
6358
|
};
|
|
6282
6359
|
/**
|
|
6283
|
-
*
|
|
6360
|
+
* Fetches a collection of columns from the TreeGrid optionally refreshing the column model.
|
|
6284
6361
|
*
|
|
6285
|
-
*
|
|
6286
|
-
*
|
|
6362
|
+
* Use this method to retrieve and optionally refresh the list of columns
|
|
6363
|
+
* to ensure up-to-date configurations and settings.
|
|
6364
|
+
*
|
|
6365
|
+
* @param {boolean} isRefresh - Determines whether to refresh the grid's column model.
|
|
6366
|
+
* @returns {Column[]} - Returns an array of TreeGrid column objects.
|
|
6287
6367
|
*/
|
|
6288
6368
|
TreeGrid.prototype.getColumns = function (isRefresh) {
|
|
6289
6369
|
this.updateColumnModel(this.grid.getColumns(isRefresh));
|
|
@@ -6346,9 +6426,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6346
6426
|
});
|
|
6347
6427
|
};
|
|
6348
6428
|
/**
|
|
6349
|
-
*
|
|
6429
|
+
* Retrieves the main content area of the TreeGrid.
|
|
6430
|
+
*
|
|
6431
|
+
* This method allows access to the main content DIV, which can
|
|
6432
|
+
* be used for layout adjustments or adding custom elements.
|
|
6350
6433
|
*
|
|
6351
|
-
* @returns {Element} -
|
|
6434
|
+
* @returns {Element} - Returns the TreeGrid content HTML element.
|
|
6352
6435
|
*/
|
|
6353
6436
|
TreeGrid.prototype.getContent = function () {
|
|
6354
6437
|
return this.grid.getContent();
|
|
@@ -6379,17 +6462,23 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6379
6462
|
this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);
|
|
6380
6463
|
};
|
|
6381
6464
|
/**
|
|
6382
|
-
*
|
|
6465
|
+
* Retrieves the content table element of the TreeGrid.
|
|
6383
6466
|
*
|
|
6384
|
-
*
|
|
6467
|
+
* This table contains the main data display area, allowing for
|
|
6468
|
+
* interaction and data manipulation directly within the TreeGrid.
|
|
6469
|
+
*
|
|
6470
|
+
* @returns {Element} - Returns the HTML element representing the content table.
|
|
6385
6471
|
*/
|
|
6386
6472
|
TreeGrid.prototype.getContentTable = function () {
|
|
6387
6473
|
return this.grid.getContentTable();
|
|
6388
6474
|
};
|
|
6389
6475
|
/**
|
|
6390
|
-
*
|
|
6476
|
+
* Obtains all data row elements from the TreeGrid, excluding summary rows.
|
|
6477
|
+
*
|
|
6478
|
+
* Provides a way to access the visual representation of data for purposes
|
|
6479
|
+
* like custom formatting or event binding.
|
|
6391
6480
|
*
|
|
6392
|
-
* @returns {Element[]} - Returns row elements
|
|
6481
|
+
* @returns {Element[]} - Returns an array of data row elements.
|
|
6393
6482
|
*/
|
|
6394
6483
|
TreeGrid.prototype.getDataRows = function () {
|
|
6395
6484
|
var dRows = [];
|
|
@@ -6402,9 +6491,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6402
6491
|
return dRows;
|
|
6403
6492
|
};
|
|
6404
6493
|
/**
|
|
6405
|
-
*
|
|
6494
|
+
* Retrieves the current set of records that are visible in the TreeGrid view.
|
|
6406
6495
|
*
|
|
6407
|
-
*
|
|
6496
|
+
* This method excludes any summary rows to focus on the main data set
|
|
6497
|
+
* currently being viewed by the user.
|
|
6498
|
+
*
|
|
6499
|
+
* @returns {Object[]} - Returns an array of the current view records.
|
|
6408
6500
|
* @isGenericType true
|
|
6409
6501
|
*/
|
|
6410
6502
|
TreeGrid.prototype.getCurrentViewRecords = function () {
|
|
@@ -6412,60 +6504,78 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6412
6504
|
return this.grid.currentViewData.filter(function (e) { return isNullOrUndefined(e["" + isSummaryRow]); });
|
|
6413
6505
|
};
|
|
6414
6506
|
/**
|
|
6415
|
-
*
|
|
6507
|
+
* Collects data changes (added, edited, and deleted) that have not been saved in batch mode.
|
|
6508
|
+
*
|
|
6509
|
+
* This allows you to view pending changes awaiting a commit to the data source.
|
|
6416
6510
|
*
|
|
6417
|
-
* @returns {Object} - Returns batch changes
|
|
6511
|
+
* @returns {Object} - Returns an object detailing batch changes.
|
|
6418
6512
|
*/
|
|
6419
6513
|
TreeGrid.prototype.getBatchChanges = function () {
|
|
6420
6514
|
return this.grid.editModule.getBatchChanges();
|
|
6421
6515
|
};
|
|
6422
6516
|
/**
|
|
6423
|
-
*
|
|
6517
|
+
* Retrieves the header content element of the TreeGrid.
|
|
6518
|
+
*
|
|
6519
|
+
* Mainly used for interacting with the header section, which includes
|
|
6520
|
+
* column headers and any applied header styling or events.
|
|
6424
6521
|
*
|
|
6425
|
-
* @returns {Element} - Returns
|
|
6522
|
+
* @returns {Element} - Returns the HTML element for header content.
|
|
6426
6523
|
*/
|
|
6427
6524
|
TreeGrid.prototype.getHeaderContent = function () {
|
|
6428
6525
|
return this.grid.getHeaderContent();
|
|
6429
6526
|
};
|
|
6430
6527
|
/**
|
|
6431
|
-
*
|
|
6528
|
+
* Retrieves the header table element of the TreeGrid.
|
|
6432
6529
|
*
|
|
6433
|
-
*
|
|
6530
|
+
* This method is useful for direct access to the table structure
|
|
6531
|
+
* where column headers are defined.
|
|
6532
|
+
*
|
|
6533
|
+
* @returns {Element} - Returns the HTML element for the header table.
|
|
6434
6534
|
*/
|
|
6435
6535
|
TreeGrid.prototype.getHeaderTable = function () {
|
|
6436
6536
|
return this.grid.getHeaderTable();
|
|
6437
6537
|
};
|
|
6438
6538
|
/**
|
|
6439
|
-
*
|
|
6539
|
+
* Fetches a specific row element based on its index in the TreeGrid.
|
|
6440
6540
|
*
|
|
6441
|
-
*
|
|
6442
|
-
*
|
|
6541
|
+
* This provides a way to directly access and manipulate a row using its index.
|
|
6542
|
+
*
|
|
6543
|
+
* @param {number} index - The index of the desired row.
|
|
6544
|
+
* @returns {Element} - Returns the HTML element of the specified row.
|
|
6443
6545
|
*/
|
|
6444
6546
|
TreeGrid.prototype.getRowByIndex = function (index) {
|
|
6445
6547
|
return this.grid.getRowByIndex(index);
|
|
6446
6548
|
};
|
|
6447
6549
|
/**
|
|
6448
|
-
*
|
|
6550
|
+
* Provides detailed information about a row based on a specified target element.
|
|
6551
|
+
*
|
|
6552
|
+
* Integral for retrieving metadata such as row index or data object
|
|
6553
|
+
* when working with events or complex tree structures.
|
|
6449
6554
|
*
|
|
6450
|
-
* @param {Element | EventTarget} target -
|
|
6451
|
-
* @returns {RowInfo} - Returns
|
|
6555
|
+
* @param {Element | EventTarget} target - The target element or event triggering the request.
|
|
6556
|
+
* @returns {RowInfo} - Returns an object containing row information.
|
|
6452
6557
|
*/
|
|
6453
6558
|
TreeGrid.prototype.getRowInfo = function (target) {
|
|
6454
6559
|
return this.grid.getRowInfo(target);
|
|
6455
6560
|
};
|
|
6456
6561
|
/**
|
|
6457
|
-
*
|
|
6562
|
+
* Finds the unique identifier (UID) for a column based on its field name.
|
|
6458
6563
|
*
|
|
6459
|
-
*
|
|
6460
|
-
*
|
|
6564
|
+
* UIDs are essential for precise identification and manipulation within complex grids.
|
|
6565
|
+
*
|
|
6566
|
+
* @param {string} field - The field name of the column.
|
|
6567
|
+
* @returns {string} - Returns the unique identifier for the specified column.
|
|
6461
6568
|
*/
|
|
6462
6569
|
TreeGrid.prototype.getUidByColumnField = function (field) {
|
|
6463
6570
|
return this.grid.getUidByColumnField(field);
|
|
6464
6571
|
};
|
|
6465
6572
|
/**
|
|
6466
|
-
*
|
|
6573
|
+
* Retrieves all the columns that are currently set to be visible within the TreeGrid.
|
|
6574
|
+
*
|
|
6575
|
+
* Helps in understanding the user's current view and can be used to dynamically
|
|
6576
|
+
* adjust the visible columns.
|
|
6467
6577
|
*
|
|
6468
|
-
* @returns {Column[]} - Returns visible
|
|
6578
|
+
* @returns {Column[]} - Returns an array of visible column objects.
|
|
6469
6579
|
*/
|
|
6470
6580
|
TreeGrid.prototype.getVisibleColumns = function () {
|
|
6471
6581
|
var cols = [];
|
|
@@ -6478,7 +6588,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6478
6588
|
return cols;
|
|
6479
6589
|
};
|
|
6480
6590
|
/**
|
|
6481
|
-
*
|
|
6591
|
+
* Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
|
|
6592
|
+
*
|
|
6593
|
+
* This can be manually invoked to indicate processing, enhancing user experience by providing feedback.
|
|
6482
6594
|
*
|
|
6483
6595
|
* @returns {void}
|
|
6484
6596
|
*/
|
|
@@ -6486,7 +6598,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6486
6598
|
showSpinner(this.element);
|
|
6487
6599
|
};
|
|
6488
6600
|
/**
|
|
6489
|
-
*
|
|
6601
|
+
* Hides a manually shown loading spinner overlay from the TreeGrid.
|
|
6602
|
+
*
|
|
6603
|
+
* Ensures that any long-running process indication is removed after completion
|
|
6604
|
+
* to manage user interface aesthetics.
|
|
6490
6605
|
*
|
|
6491
6606
|
* @returns {void}
|
|
6492
6607
|
*/
|
|
@@ -6494,7 +6609,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6494
6609
|
hideSpinner(this.element);
|
|
6495
6610
|
};
|
|
6496
6611
|
/**
|
|
6497
|
-
* Refreshes the TreeGrid header and content.
|
|
6612
|
+
* Refreshes the visual appearance and data of the TreeGrid, updating header and content.
|
|
6613
|
+
*
|
|
6614
|
+
* This is crucial for synchronizing the displayed data with the underlying data source,
|
|
6615
|
+
* ensuring the view reflects current data.
|
|
6498
6616
|
*
|
|
6499
6617
|
* @returns {void}
|
|
6500
6618
|
*/
|
|
@@ -6514,18 +6632,24 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6514
6632
|
this.grid.refresh();
|
|
6515
6633
|
};
|
|
6516
6634
|
/**
|
|
6517
|
-
*
|
|
6635
|
+
* Retrieves the records associated with rows that have their checkboxes checked.
|
|
6636
|
+
*
|
|
6637
|
+
* Facilitates operations that require information about specifically selected or
|
|
6638
|
+
* interacted rows within the grid.
|
|
6518
6639
|
*
|
|
6519
|
-
* @returns {Object[]} - Returns
|
|
6640
|
+
* @returns {Object[]} - Returns an array of checked row data objects.
|
|
6520
6641
|
* @isGenericType true
|
|
6521
6642
|
*/
|
|
6522
6643
|
TreeGrid.prototype.getCheckedRecords = function () {
|
|
6523
6644
|
return this.selectionModule.getCheckedrecords();
|
|
6524
6645
|
};
|
|
6525
6646
|
/**
|
|
6526
|
-
*
|
|
6647
|
+
* Retrieves currently visible records according to the TreeGrid's visual state.
|
|
6527
6648
|
*
|
|
6528
|
-
*
|
|
6649
|
+
* It considers row expansion and collapse states to return only those records
|
|
6650
|
+
* that a user can currently interact with.
|
|
6651
|
+
*
|
|
6652
|
+
* @returns {Object[]} - Returns visible records reflecting the TreeGrid's current view.
|
|
6529
6653
|
* @isGenericType true
|
|
6530
6654
|
*/
|
|
6531
6655
|
TreeGrid.prototype.getVisibleRecords = function () {
|
|
@@ -6545,26 +6669,35 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6545
6669
|
return visibleRecords;
|
|
6546
6670
|
};
|
|
6547
6671
|
/**
|
|
6548
|
-
*
|
|
6672
|
+
* Retrieves the indices of rows that have their checkboxes checked.
|
|
6673
|
+
*
|
|
6674
|
+
* This can assist in programatically assessing which rows have been selected
|
|
6675
|
+
* by checkbox interaction for further processing.
|
|
6549
6676
|
*
|
|
6550
|
-
* @returns {number[]} - Returns checked
|
|
6677
|
+
* @returns {number[]} - Returns an array of indices corresponding to checked rows.
|
|
6551
6678
|
*/
|
|
6552
6679
|
TreeGrid.prototype.getCheckedRowIndexes = function () {
|
|
6553
6680
|
return this.selectionModule.getCheckedRowIndexes();
|
|
6554
6681
|
};
|
|
6555
6682
|
/**
|
|
6556
|
-
*
|
|
6683
|
+
* Selects rows in the TreeGrid using row indices, checking their associated checkboxes.
|
|
6557
6684
|
*
|
|
6558
|
-
*
|
|
6685
|
+
* This method provides automation for selecting or highlighting specific rows,
|
|
6686
|
+
* useful in scenarios needing pre-selection or default selections.
|
|
6687
|
+
*
|
|
6688
|
+
* @param {number[]} indexes - An array of row indices to be marked as selected.
|
|
6559
6689
|
* @returns {void}
|
|
6560
6690
|
*/
|
|
6561
6691
|
TreeGrid.prototype.selectCheckboxes = function (indexes) {
|
|
6562
6692
|
this.selectionModule.selectCheckboxes(indexes);
|
|
6563
6693
|
};
|
|
6564
6694
|
/**
|
|
6565
|
-
*
|
|
6695
|
+
* Updates and refreshes the TreeGrid's column definitions and layout.
|
|
6696
|
+
*
|
|
6697
|
+
* Ensures that the latest column settings are displayed, either refreshing the UI
|
|
6698
|
+
* or adjusting internal configurations to match current data or configuration updates.
|
|
6566
6699
|
*
|
|
6567
|
-
* @param {boolean} refreshUI -
|
|
6700
|
+
* @param {boolean} refreshUI - A flag indicating whether the DOM should be updated.
|
|
6568
6701
|
* @returns {void}
|
|
6569
6702
|
*/
|
|
6570
6703
|
TreeGrid.prototype.refreshColumns = function (refreshUI) {
|
|
@@ -6593,7 +6726,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6593
6726
|
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
6594
6727
|
};
|
|
6595
6728
|
/**
|
|
6596
|
-
* Refreshes the TreeGrid
|
|
6729
|
+
* Refreshes the header section of the TreeGrid to reflect any structural or data changes.
|
|
6730
|
+
*
|
|
6731
|
+
* This method is useful when there are dynamic updates or layout adjustments
|
|
6732
|
+
* needed in the header portion to ensure it aligns with current grid data or settings.
|
|
6597
6733
|
*
|
|
6598
6734
|
* @returns {void}
|
|
6599
6735
|
*/
|
|
@@ -6648,12 +6784,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6648
6784
|
}
|
|
6649
6785
|
};
|
|
6650
6786
|
/**
|
|
6651
|
-
* Expands
|
|
6787
|
+
* Expands the specified parent row within the TreeGrid to reveal its nested data.
|
|
6652
6788
|
*
|
|
6653
|
-
*
|
|
6654
|
-
*
|
|
6655
|
-
*
|
|
6656
|
-
* @param {
|
|
6789
|
+
* This method is useful for programmatically expanding rows to display their
|
|
6790
|
+
* hierarchical children, providing detailed views for nested data structures.
|
|
6791
|
+
*
|
|
6792
|
+
* @param {HTMLTableRowElement} row - The table row element that should be expanded.
|
|
6793
|
+
* @param {Object} record - Optional. Represents the data record associated with the row to be expanded.
|
|
6794
|
+
* @param {Object} key - Optional. The primary key value that uniquely identifies the record.
|
|
6795
|
+
* @param {number} level - Optional. Indicates the hierarchical level of the record within the TreeGrid.
|
|
6657
6796
|
* @returns {void}
|
|
6658
6797
|
*/
|
|
6659
6798
|
TreeGrid.prototype.expandRow = function (row, record, key, level) {
|
|
@@ -6669,7 +6808,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6669
6808
|
if (isNullOrUndefined(row) && isNullOrUndefined(record)) {
|
|
6670
6809
|
return;
|
|
6671
6810
|
}
|
|
6672
|
-
if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
6811
|
+
if (!isNullOrUndefined(row) && row.cells && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
6673
6812
|
this.lastRowBorder(row, false);
|
|
6674
6813
|
}
|
|
6675
6814
|
if (this.isExpandAll && !isRemoteData(this)) {
|
|
@@ -6709,7 +6848,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6709
6848
|
};
|
|
6710
6849
|
// Internal method to handle the rows expand
|
|
6711
6850
|
TreeGrid.prototype.expandRows = function (row, record, parentRec) {
|
|
6712
|
-
var initialTotalRecordsCount = this.grid.totalDataRecordsCount;
|
|
6713
6851
|
this.expandCollapse('expand', row, record);
|
|
6714
6852
|
var children = 'Children';
|
|
6715
6853
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record["" + children]))) {
|
|
@@ -6753,12 +6891,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6753
6891
|
}
|
|
6754
6892
|
else if (isNullOrUndefined(record) && !isNullOrUndefined(row)) {
|
|
6755
6893
|
if (this.detailTemplate) {
|
|
6756
|
-
record = this.grid.getCurrentViewRecords()[row.getAttribute('
|
|
6894
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
|
|
6757
6895
|
}
|
|
6758
6896
|
else {
|
|
6759
6897
|
if (this.enableVirtualization && (this.isCollapseAll || this.isExpandAll)) {
|
|
6760
6898
|
if (row.rowIndex === -1) {
|
|
6761
|
-
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('
|
|
6899
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
|
|
6762
6900
|
}
|
|
6763
6901
|
else {
|
|
6764
6902
|
record = this.grid.getCurrentViewRecords()[row.rowIndex];
|
|
@@ -6768,18 +6906,27 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6768
6906
|
record = this.grid.getCurrentViewRecords()[row.rowIndex];
|
|
6769
6907
|
}
|
|
6770
6908
|
else {
|
|
6771
|
-
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('
|
|
6909
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('aria-rowindex'), 10) - 1];
|
|
6772
6910
|
}
|
|
6773
6911
|
}
|
|
6774
6912
|
}
|
|
6775
6913
|
return record;
|
|
6776
6914
|
};
|
|
6777
6915
|
/**
|
|
6778
|
-
* Collapses
|
|
6916
|
+
* Collapses the specified parent row in the TreeGrid.
|
|
6917
|
+
*
|
|
6918
|
+
* This method collapses the row associated with the provided HTMLTableRowElement,
|
|
6919
|
+
* hiding any of its displayed child rows. It is typically used to manage the
|
|
6920
|
+
* visibility of hierarchical data within a tree structure.
|
|
6779
6921
|
*
|
|
6780
|
-
* @param {HTMLTableRowElement} row -
|
|
6781
|
-
*
|
|
6782
|
-
* @param {Object}
|
|
6922
|
+
* @param {HTMLTableRowElement} row - The HTMLTableRowElement representing the parent row
|
|
6923
|
+
* whose child rows are to be collapsed.
|
|
6924
|
+
* @param {Object} record - (Optional) The data record associated with the row being collapsed.
|
|
6925
|
+
* This can be used to access or manipulate the underlying data
|
|
6926
|
+
* when collapsing the row.
|
|
6927
|
+
* @param {Object} key - (Optional) The primary key value of the record. It can be used to identify
|
|
6928
|
+
* the target record uniquely when collapsing the row, especially in cases
|
|
6929
|
+
* where the row or record data needs to be referenced or logged.
|
|
6783
6930
|
* @returns {void}
|
|
6784
6931
|
*/
|
|
6785
6932
|
TreeGrid.prototype.collapseRow = function (row, record, key) {
|
|
@@ -6861,9 +7008,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6861
7008
|
}
|
|
6862
7009
|
};
|
|
6863
7010
|
/**
|
|
6864
|
-
* Expands the records at
|
|
7011
|
+
* Expands all the records at the specified hierarchical level within the TreeGrid.
|
|
6865
7012
|
*
|
|
6866
|
-
*
|
|
7013
|
+
* This method is useful for visually expanding data at a certain depth, making
|
|
7014
|
+
* all parent rows visible at the given level and their child rows accessible.
|
|
7015
|
+
*
|
|
7016
|
+
* @param {number} level - The hierarchical level at which parent rows should be expanded.
|
|
6867
7017
|
* @returns {void}
|
|
6868
7018
|
*/
|
|
6869
7019
|
TreeGrid.prototype.expandAtLevel = function (level) {
|
|
@@ -6883,9 +7033,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6883
7033
|
}
|
|
6884
7034
|
};
|
|
6885
7035
|
/**
|
|
6886
|
-
* Expands
|
|
7036
|
+
* Expands a specific record identified by the provided primary key value.
|
|
7037
|
+
*
|
|
7038
|
+
* This method is useful for expanding particular node in the TreeGrid when
|
|
7039
|
+
* the parent rows need to be targeted individually by their unique key.
|
|
6887
7040
|
*
|
|
6888
|
-
* @param {Object} key -
|
|
7041
|
+
* @param {Object} key - The primary key value of the record to be expanded.
|
|
6889
7042
|
* @returns {void}
|
|
6890
7043
|
*/
|
|
6891
7044
|
TreeGrid.prototype.expandByKey = function (key) {
|
|
@@ -6940,9 +7093,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6940
7093
|
return obj;
|
|
6941
7094
|
};
|
|
6942
7095
|
/**
|
|
6943
|
-
* Collapses the records at
|
|
7096
|
+
* Collapses all the records at the specified hierarchical level within the TreeGrid.
|
|
6944
7097
|
*
|
|
6945
|
-
*
|
|
7098
|
+
* This function helps in hiding child rows for all parent nodes at a given level,
|
|
7099
|
+
* effectively reducing the visible depth of the hierarchical structure.
|
|
7100
|
+
*
|
|
7101
|
+
* @param {number} level - The hierarchical level at which parent rows should be collapsed.
|
|
6946
7102
|
* @returns {void}
|
|
6947
7103
|
*/
|
|
6948
7104
|
TreeGrid.prototype.collapseAtLevel = function (level) {
|
|
@@ -6962,9 +7118,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6962
7118
|
}
|
|
6963
7119
|
};
|
|
6964
7120
|
/**
|
|
6965
|
-
* Collapses
|
|
7121
|
+
* Collapses a specific record identified by the provided primary key value.
|
|
7122
|
+
*
|
|
7123
|
+
* This method is useful for collapsing particular node in the TreeGrid when
|
|
7124
|
+
* the parent rows need to be targeted individually by their unique key.
|
|
6966
7125
|
*
|
|
6967
|
-
* @param {Object} key -
|
|
7126
|
+
* @param {Object} key - The primary key value of the record to be collapsed.
|
|
6968
7127
|
* @returns {void}
|
|
6969
7128
|
*/
|
|
6970
7129
|
TreeGrid.prototype.collapseByKey = function (key) {
|
|
@@ -7003,7 +7162,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7003
7162
|
}
|
|
7004
7163
|
};
|
|
7005
7164
|
/**
|
|
7006
|
-
* Expands
|
|
7165
|
+
* Expands all rows in the TreeGrid, making the full hierarchy visible.
|
|
7166
|
+
*
|
|
7167
|
+
* This method should be used with caution on large datasets, as it makes
|
|
7168
|
+
* all nodes and their child rows visible, which might affect performance.
|
|
7007
7169
|
*
|
|
7008
7170
|
* @returns {void}
|
|
7009
7171
|
*/
|
|
@@ -7014,10 +7176,23 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7014
7176
|
}
|
|
7015
7177
|
this.isExpandedEventTriggered = false;
|
|
7016
7178
|
this.isExpandingEventTriggered = false;
|
|
7179
|
+
if (this.editSettings.mode === 'Batch') {
|
|
7180
|
+
var obj = 'dialogObj';
|
|
7181
|
+
var showDialog = 'showDialog';
|
|
7182
|
+
if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
|
|
7183
|
+
this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
|
|
7184
|
+
var dialogObj = this.grid.editModule["" + obj];
|
|
7185
|
+
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
7186
|
+
return;
|
|
7187
|
+
}
|
|
7188
|
+
}
|
|
7017
7189
|
this.expandCollapseAll('expand');
|
|
7018
7190
|
};
|
|
7019
7191
|
/**
|
|
7020
|
-
* Collapses
|
|
7192
|
+
* Collapses all rows in the TreeGrid, hiding all child rows and leaving only parent nodes visible.
|
|
7193
|
+
*
|
|
7194
|
+
* This method can be used to quickly minimize the view to only top-level data,
|
|
7195
|
+
* which is helpful for summarizing or performing broad overviews of the dataset.
|
|
7021
7196
|
*
|
|
7022
7197
|
* @returns {void}
|
|
7023
7198
|
*/
|
|
@@ -7028,6 +7203,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7028
7203
|
}
|
|
7029
7204
|
this.isCollapsedEventTriggered = false;
|
|
7030
7205
|
this.isCollapsingEventTriggered = false;
|
|
7206
|
+
if (this.editSettings.mode === 'Batch') {
|
|
7207
|
+
var obj = 'dialogObj';
|
|
7208
|
+
var showDialog = 'showDialog';
|
|
7209
|
+
if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
|
|
7210
|
+
this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
|
|
7211
|
+
var dialogObj = this.grid.editModule["" + obj];
|
|
7212
|
+
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
7213
|
+
return;
|
|
7214
|
+
}
|
|
7215
|
+
}
|
|
7031
7216
|
this.expandCollapseAll('collapse');
|
|
7032
7217
|
};
|
|
7033
7218
|
TreeGrid.prototype.expandCollapseAll = function (action) {
|
|
@@ -7047,7 +7232,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7047
7232
|
}
|
|
7048
7233
|
this.isExpandAll = true;
|
|
7049
7234
|
this.isCollapseAll = true;
|
|
7050
|
-
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
|
|
7235
|
+
if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
|
|
7051
7236
|
this.flatData.filter(function (e) {
|
|
7052
7237
|
if (e.hasChildRecords) {
|
|
7053
7238
|
e.expanded = action === 'collapse' ? false : true;
|
|
@@ -7111,12 +7296,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7111
7296
|
row = gridRows[parseInt(rowIndex.toString(), 10)];
|
|
7112
7297
|
}
|
|
7113
7298
|
else {
|
|
7114
|
-
rowIndex = +row.getAttribute('
|
|
7299
|
+
rowIndex = +row.getAttribute('aria-rowindex') - 1;
|
|
7115
7300
|
}
|
|
7116
7301
|
if (!isNullOrUndefined(row)) {
|
|
7117
7302
|
row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
|
|
7118
7303
|
}
|
|
7119
|
-
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)
|
|
7304
|
+
if (((this.allowPaging && (this.pageSettings.pageSizeMode === 'All' || this.pageSettings.pageSizeMode === 'Root')) || this.enableVirtualization) && !isRemoteData(this)
|
|
7120
7305
|
&& !isCountRequired(this)) {
|
|
7121
7306
|
this.notify(localPagedExpandCollapse, { action: action, row: row, record: record });
|
|
7122
7307
|
}
|
|
@@ -7126,6 +7311,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7126
7311
|
displayAction = 'e-childrow-visible';
|
|
7127
7312
|
if (!isChild) {
|
|
7128
7313
|
record.expanded = true;
|
|
7314
|
+
this.flatData.forEach(function (e) {
|
|
7315
|
+
e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
|
|
7316
|
+
});
|
|
7129
7317
|
this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
|
|
7130
7318
|
}
|
|
7131
7319
|
if (!isNullOrUndefined(row)) {
|
|
@@ -7147,6 +7335,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7147
7335
|
displayAction = 'e-childrow-hidden';
|
|
7148
7336
|
if (!isChild || isCountRequired(this)) {
|
|
7149
7337
|
record.expanded = false;
|
|
7338
|
+
this.flatData.forEach(function (e) {
|
|
7339
|
+
e.expanded = e.uniqueID === record.uniqueID && e.expanded !== record.expanded ? record.expanded : e.expanded;
|
|
7340
|
+
});
|
|
7150
7341
|
this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;
|
|
7151
7342
|
}
|
|
7152
7343
|
if (!isNullOrUndefined(row)) {
|
|
@@ -7389,7 +7580,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7389
7580
|
}
|
|
7390
7581
|
if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization
|
|
7391
7582
|
|| this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
7392
|
-
gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex]
|
|
7583
|
+
if (!isNullOrUndefined(gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex])) {
|
|
7584
|
+
gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'e-childrow-hidden' ? true : false;
|
|
7585
|
+
}
|
|
7393
7586
|
var parentRecord = currentViewData.filter(function (e) {
|
|
7394
7587
|
return e.uniqueID === currentRecord[0].parentUniqueID;
|
|
7395
7588
|
});
|
|
@@ -7535,28 +7728,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7535
7728
|
}
|
|
7536
7729
|
return value;
|
|
7537
7730
|
};
|
|
7538
|
-
/**
|
|
7539
|
-
* Updates the rows and cells
|
|
7540
|
-
*
|
|
7541
|
-
* @param {Object[]} records - Updates the given records
|
|
7542
|
-
* @param {HTMLTableRowElement[]} rows - Updates the given rows
|
|
7543
|
-
* @param {number} index - Updates the given cell index
|
|
7544
|
-
* @returns {void}
|
|
7545
|
-
*/
|
|
7546
|
-
TreeGrid.prototype.updateRowAndCellElements = function (records, rows, index) {
|
|
7547
|
-
for (var i = 0; i < records.length; i++) {
|
|
7548
|
-
this.renderModule.cellRender({
|
|
7549
|
-
data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
|
|
7550
|
-
column: this.grid.getColumns()[this.treeColumnIndex],
|
|
7551
|
-
requestType: 'rowDragAndDrop'
|
|
7552
|
-
});
|
|
7553
|
-
if (this['action'] === 'indenting' || this['action'] === 'outdenting') {
|
|
7554
|
-
this.renderModule.RowModifier({
|
|
7555
|
-
data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
|
|
7556
|
-
});
|
|
7557
|
-
}
|
|
7558
|
-
}
|
|
7559
|
-
};
|
|
7560
7731
|
/**
|
|
7561
7732
|
* @hidden
|
|
7562
7733
|
* @returns {void}
|
|
@@ -7564,6 +7735,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7564
7735
|
TreeGrid.prototype.addListener = function () {
|
|
7565
7736
|
this.on('updateResults', this.updateResultModel, this);
|
|
7566
7737
|
this.grid.on('initial-end', this.afterGridRender, this);
|
|
7738
|
+
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
7567
7739
|
};
|
|
7568
7740
|
TreeGrid.prototype.updateResultModel = function (returnResult) {
|
|
7569
7741
|
this.dataResults = returnResult;
|
|
@@ -7578,27 +7750,31 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7578
7750
|
}
|
|
7579
7751
|
this.off('updateResults', this.updateResultModel);
|
|
7580
7752
|
this.grid.off('initial-end', this.afterGridRender);
|
|
7753
|
+
this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
|
|
7581
7754
|
};
|
|
7582
7755
|
/**
|
|
7583
|
-
* Filters TreeGrid
|
|
7756
|
+
* Filters the TreeGrid rows based on a specified column and filter criteria.
|
|
7757
|
+
*
|
|
7758
|
+
* This method allows for dynamic filtering against column data using various
|
|
7759
|
+
* operators and values, supporting case-sensitive filtering and accent sensitivity.
|
|
7584
7760
|
*
|
|
7585
|
-
* @param
|
|
7586
|
-
* @param
|
|
7587
|
-
* @param
|
|
7588
|
-
* @param
|
|
7589
|
-
* @param
|
|
7590
|
-
*
|
|
7591
|
-
* @param
|
|
7592
|
-
*
|
|
7593
|
-
* @param {string} actualFilterValue - Defines the actual filter value for filter column.
|
|
7594
|
-
* @param {string} actualOperator - Defines the actual filter operator for filter column.
|
|
7761
|
+
* @param {string} fieldName - The name of the column to apply the filter on.
|
|
7762
|
+
* @param {string} filterOperator - The operator used to perform the filter (e.g., 'equals', 'startswith').
|
|
7763
|
+
* @param {string | number | Date | boolean } filterValue - The value to filter against.
|
|
7764
|
+
* @param {string} predicate - The logical operator ('AND'/'OR') to combine this filter with others.
|
|
7765
|
+
* @param {boolean} matchCase - If true, the filter performs a case-sensitive match.
|
|
7766
|
+
* @param {boolean} ignoreAccent - If true, the filter ignores diacritical marks.
|
|
7767
|
+
* @param {string} actualFilterValue - The original value used for filtering, useful for distinguishing displayed and actual values.
|
|
7768
|
+
* @param {string} actualOperator - The actual operator that is applied when different from the displayed operator.
|
|
7595
7769
|
* @returns {void}
|
|
7596
7770
|
*/
|
|
7597
7771
|
TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
|
|
7598
7772
|
this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
|
|
7599
7773
|
};
|
|
7600
7774
|
/**
|
|
7601
|
-
* Clears all the
|
|
7775
|
+
* Clears all filters applied to the TreeGrid, restoring the view to show all records.
|
|
7776
|
+
*
|
|
7777
|
+
* This method is useful for resetting the grid to its unfiltered state.
|
|
7602
7778
|
*
|
|
7603
7779
|
* @returns {void}
|
|
7604
7780
|
*/
|
|
@@ -7617,26 +7793,32 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7617
7793
|
this.grid.removeFilteredColsByField(field, isClearFilterBar);
|
|
7618
7794
|
};
|
|
7619
7795
|
/**
|
|
7620
|
-
* Selects a row by
|
|
7796
|
+
* Selects a row in the TreeGrid by its index.
|
|
7797
|
+
*
|
|
7798
|
+
* Use this method to highlight a specific row; useful for programmatically navigating data.
|
|
7621
7799
|
*
|
|
7622
|
-
* @param
|
|
7623
|
-
* @param
|
|
7800
|
+
* @param {number} index - Index of the row to select.
|
|
7801
|
+
* @param {boolean} isToggle - If true, toggles the selection state of the row.
|
|
7624
7802
|
* @returns {void}
|
|
7625
7803
|
*/
|
|
7626
7804
|
TreeGrid.prototype.selectRow = function (index, isToggle) {
|
|
7627
7805
|
this.grid.selectRow(index, isToggle);
|
|
7628
7806
|
};
|
|
7629
7807
|
/**
|
|
7630
|
-
* Selects
|
|
7808
|
+
* Selects multiple rows in the TreeGrid given an array of row indexes.
|
|
7631
7809
|
*
|
|
7632
|
-
*
|
|
7810
|
+
* Useful for batch operations where multiple row selections are necessary.
|
|
7811
|
+
*
|
|
7812
|
+
* @param {number[]} rowIndexes - Array of row index numbers to select.
|
|
7633
7813
|
* @returns {void}
|
|
7634
7814
|
*/
|
|
7635
7815
|
TreeGrid.prototype.selectRows = function (rowIndexes) {
|
|
7636
7816
|
this.grid.selectRows(rowIndexes);
|
|
7637
7817
|
};
|
|
7638
7818
|
/**
|
|
7639
|
-
* Deselects
|
|
7819
|
+
* Deselects all selected rows and cells within the TreeGrid.
|
|
7820
|
+
*
|
|
7821
|
+
* Resets the selection state of the grid, which is useful after bulk operations.
|
|
7640
7822
|
*
|
|
7641
7823
|
* @returns {void}
|
|
7642
7824
|
*/
|
|
@@ -7647,39 +7829,47 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7647
7829
|
this.grid.clearSelection();
|
|
7648
7830
|
};
|
|
7649
7831
|
/**
|
|
7650
|
-
*
|
|
7832
|
+
* Copies the data of selected rows or cells to the clipboard.
|
|
7651
7833
|
*
|
|
7652
|
-
*
|
|
7834
|
+
* This method supports including headers for better context when pasting elsewhere.
|
|
7835
|
+
*
|
|
7836
|
+
* @param {boolean} withHeader - (Optional) If true, includes column headers in the copied data.
|
|
7653
7837
|
* @returns {void}
|
|
7654
7838
|
*/
|
|
7655
7839
|
TreeGrid.prototype.copy = function (withHeader) {
|
|
7656
7840
|
this.clipboardModule.copy(withHeader);
|
|
7657
7841
|
};
|
|
7658
7842
|
/**
|
|
7659
|
-
*
|
|
7843
|
+
* Pastes data into the selected cells from the clipboard.
|
|
7844
|
+
*
|
|
7845
|
+
* Automatically places the pasted data starting from the specified indices.
|
|
7660
7846
|
*
|
|
7661
|
-
* @param {
|
|
7662
|
-
* @param {
|
|
7663
|
-
* @param {
|
|
7847
|
+
* @param {string} data - The clipboard data to paste.
|
|
7848
|
+
* @param {number} rowIndex - The starting row index for pasting.
|
|
7849
|
+
* @param {number} colIndex - The starting column index for pasting.
|
|
7664
7850
|
* @returns {void}
|
|
7665
7851
|
*/
|
|
7666
7852
|
TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {
|
|
7667
7853
|
this.clipboardModule.paste(data, rowIndex, colIndex);
|
|
7668
7854
|
};
|
|
7669
7855
|
/**
|
|
7670
|
-
* Selects a cell by the
|
|
7856
|
+
* Selects a cell by its index position in the TreeGrid.
|
|
7671
7857
|
*
|
|
7672
|
-
*
|
|
7673
|
-
*
|
|
7858
|
+
* Useful for navigating or highlighting specific data cells within the grid.
|
|
7859
|
+
*
|
|
7860
|
+
* @param {IIndex} cellIndex - An object specifying the row and column indexes.
|
|
7861
|
+
* @param {boolean} isToggle - (Optional) If true, toggles the selection state of the cell.
|
|
7674
7862
|
* @returns {void}
|
|
7675
7863
|
*/
|
|
7676
7864
|
TreeGrid.prototype.selectCell = function (cellIndex, isToggle) {
|
|
7677
7865
|
this.grid.selectCell(cellIndex, isToggle);
|
|
7678
7866
|
};
|
|
7679
7867
|
/**
|
|
7680
|
-
*
|
|
7868
|
+
* Retrieves the currently selected rows.
|
|
7869
|
+
*
|
|
7870
|
+
* Useful for obtaining the selected data elements for downstream processing.
|
|
7681
7871
|
*
|
|
7682
|
-
* @returns {Element[]} -
|
|
7872
|
+
* @returns {Element[]} - An array of Element objects representing the selected rows.
|
|
7683
7873
|
*/
|
|
7684
7874
|
TreeGrid.prototype.getSelectedRows = function () {
|
|
7685
7875
|
return this.grid.getSelectedRows();
|
|
@@ -7891,44 +8081,59 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7891
8081
|
return cnt;
|
|
7892
8082
|
};
|
|
7893
8083
|
/**
|
|
7894
|
-
*
|
|
8084
|
+
* Retrieves the indexes of the currently selected rows in the TreeGrid.
|
|
7895
8085
|
*
|
|
7896
|
-
*
|
|
8086
|
+
* This method is useful when you need to perform actions based on the selected rows,
|
|
8087
|
+
* such as retrieving data or changing the selection.
|
|
8088
|
+
*
|
|
8089
|
+
* @returns {number[]} - An array of numbers representing the indexes of selected rows.
|
|
7897
8090
|
*/
|
|
7898
8091
|
TreeGrid.prototype.getSelectedRowIndexes = function () {
|
|
7899
8092
|
return this.grid.getSelectedRowIndexes();
|
|
7900
8093
|
};
|
|
7901
8094
|
/**
|
|
7902
|
-
*
|
|
8095
|
+
* Retrieves the indexes of the selected cells within the selected rows.
|
|
8096
|
+
*
|
|
8097
|
+
* This can be useful for handling cell-specific operations, such as
|
|
8098
|
+
* applying styles or editing values programmatically.
|
|
7903
8099
|
*
|
|
7904
|
-
* @returns {ISelectedCell[]} -
|
|
8100
|
+
* @returns {ISelectedCell[]} - An array of objects representing the selected cells' indexes.
|
|
7905
8101
|
*/
|
|
7906
8102
|
TreeGrid.prototype.getSelectedRowCellIndexes = function () {
|
|
7907
8103
|
return this.grid.getSelectedRowCellIndexes();
|
|
7908
8104
|
};
|
|
7909
8105
|
/**
|
|
7910
|
-
*
|
|
8106
|
+
* Retrieves the data records corresponding to the currently selected rows.
|
|
8107
|
+
*
|
|
8108
|
+
* This method provides the full record data for the selected rows,
|
|
8109
|
+
* which is useful for data manipulation or extraction operations.
|
|
7911
8110
|
*
|
|
7912
8111
|
* @isGenericType true
|
|
7913
|
-
* @returns {Object[]} -
|
|
8112
|
+
* @returns {Object[]} - An array of data objects representing the selected records.
|
|
7914
8113
|
*/
|
|
7915
8114
|
TreeGrid.prototype.getSelectedRecords = function () {
|
|
7916
8115
|
return this.grid.getSelectedRecords();
|
|
7917
8116
|
};
|
|
7918
8117
|
/**
|
|
7919
|
-
*
|
|
8118
|
+
* Obtains the data handling modules used by the TreeGrid.
|
|
7920
8119
|
*
|
|
7921
|
-
*
|
|
8120
|
+
* This includes both the base data module for standard grid operations and the tree module
|
|
8121
|
+
* for handling hierarchical data, giving complete access to data management capabilities.
|
|
8122
|
+
*
|
|
8123
|
+
* @returns {{baseModule: Data, treeModule: DataManipulation}} - An object containing both grid and tree data modules.
|
|
7922
8124
|
*/
|
|
7923
8125
|
TreeGrid.prototype.getDataModule = function () {
|
|
7924
8126
|
return { baseModule: this.grid.getDataModule(), treeModule: this.dataModule };
|
|
7925
8127
|
};
|
|
7926
8128
|
/**
|
|
7927
|
-
*
|
|
8129
|
+
* Reorders rows in the TreeGrid based on specified source indexes and a target position.
|
|
7928
8130
|
*
|
|
7929
|
-
*
|
|
7930
|
-
*
|
|
7931
|
-
*
|
|
8131
|
+
* This functionality allows for dynamic rearrangement of rows, such as moving selected
|
|
8132
|
+
* rows to a new position as siblings or children.
|
|
8133
|
+
*
|
|
8134
|
+
* @param {number[]} fromIndexes - An array indicating the source indexes of the rows to be moved.
|
|
8135
|
+
* @param {number} toIndex - The target index where the rows should be moved.
|
|
8136
|
+
* @param {string} position - The position relative to the target index ('above', 'below', 'child').
|
|
7932
8137
|
* @returns {void}
|
|
7933
8138
|
*/
|
|
7934
8139
|
TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
@@ -7937,9 +8142,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7937
8142
|
}
|
|
7938
8143
|
};
|
|
7939
8144
|
/**
|
|
7940
|
-
* Indents
|
|
8145
|
+
* Indents a specified record, promoting it to one level deeper in the hierarchy.
|
|
8146
|
+
*
|
|
8147
|
+
* This function moves the selected row to become the last child of its preceding row,
|
|
8148
|
+
* altering the visual and hierarchical data structure.
|
|
7941
8149
|
*
|
|
7942
|
-
* @param {Object} record
|
|
8150
|
+
* @param {Object} record - (Optional) The record to be indented. If omitted, the currently selected row is used.
|
|
7943
8151
|
* @returns {void}
|
|
7944
8152
|
*/
|
|
7945
8153
|
TreeGrid.prototype.indent = function (record) {
|
|
@@ -7949,9 +8157,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
7949
8157
|
}
|
|
7950
8158
|
};
|
|
7951
8159
|
/**
|
|
7952
|
-
*
|
|
8160
|
+
* Outdents a specified record, moving it one level up in the hierarchy.
|
|
7953
8161
|
*
|
|
7954
|
-
*
|
|
8162
|
+
* This method repositions the selected row to be a sibling of its parent, impacting
|
|
8163
|
+
* its display and the hierarchical relationships within the TreeGrid.
|
|
8164
|
+
*
|
|
8165
|
+
* @param {Object} record - (Optional) The record to be outdented. If omitted, the currently selected row is used.
|
|
7955
8166
|
* @returns {void}
|
|
7956
8167
|
*/
|
|
7957
8168
|
TreeGrid.prototype.outdent = function (record) {
|
|
@@ -8147,6 +8358,21 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
8147
8358
|
__decorate$b([
|
|
8148
8359
|
Property('All')
|
|
8149
8360
|
], TreeGrid.prototype, "columnQueryMode", void 0);
|
|
8361
|
+
__decorate$b([
|
|
8362
|
+
Property(true)
|
|
8363
|
+
], TreeGrid.prototype, "allowSelection", void 0);
|
|
8364
|
+
__decorate$b([
|
|
8365
|
+
Property(-1)
|
|
8366
|
+
], TreeGrid.prototype, "selectedRowIndex", void 0);
|
|
8367
|
+
__decorate$b([
|
|
8368
|
+
Complex({}, SelectionSettings)
|
|
8369
|
+
], TreeGrid.prototype, "selectionSettings", void 0);
|
|
8370
|
+
__decorate$b([
|
|
8371
|
+
Property(false)
|
|
8372
|
+
], TreeGrid.prototype, "allowExcelExport", void 0);
|
|
8373
|
+
__decorate$b([
|
|
8374
|
+
Property(false)
|
|
8375
|
+
], TreeGrid.prototype, "allowPdfExport", void 0);
|
|
8150
8376
|
__decorate$b([
|
|
8151
8377
|
Event()
|
|
8152
8378
|
], TreeGrid.prototype, "created", void 0);
|
|
@@ -8225,9 +8451,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
8225
8451
|
__decorate$b([
|
|
8226
8452
|
Event()
|
|
8227
8453
|
], TreeGrid.prototype, "queryCellInfo", void 0);
|
|
8228
|
-
__decorate$b([
|
|
8229
|
-
Property(true)
|
|
8230
|
-
], TreeGrid.prototype, "allowSelection", void 0);
|
|
8231
8454
|
__decorate$b([
|
|
8232
8455
|
Event()
|
|
8233
8456
|
], TreeGrid.prototype, "rowSelecting", void 0);
|
|
@@ -8318,18 +8541,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
8318
8541
|
__decorate$b([
|
|
8319
8542
|
Event()
|
|
8320
8543
|
], TreeGrid.prototype, "rowDrop", void 0);
|
|
8321
|
-
__decorate$b([
|
|
8322
|
-
Property(-1)
|
|
8323
|
-
], TreeGrid.prototype, "selectedRowIndex", void 0);
|
|
8324
|
-
__decorate$b([
|
|
8325
|
-
Complex({}, SelectionSettings)
|
|
8326
|
-
], TreeGrid.prototype, "selectionSettings", void 0);
|
|
8327
|
-
__decorate$b([
|
|
8328
|
-
Property(false)
|
|
8329
|
-
], TreeGrid.prototype, "allowExcelExport", void 0);
|
|
8330
|
-
__decorate$b([
|
|
8331
|
-
Property(false)
|
|
8332
|
-
], TreeGrid.prototype, "allowPdfExport", void 0);
|
|
8333
8544
|
__decorate$b([
|
|
8334
8545
|
Event()
|
|
8335
8546
|
], TreeGrid.prototype, "pdfQueryCellInfo", void 0);
|
|
@@ -8549,7 +8760,6 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8549
8760
|
}
|
|
8550
8761
|
var action = 'action';
|
|
8551
8762
|
var dropPosition = 'dropPosition';
|
|
8552
|
-
var updateRowAndCellElements = 'updateRowAndCellElements';
|
|
8553
8763
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
8554
8764
|
if (position === 'above') {
|
|
8555
8765
|
this.dropPosition = 'topSegment';
|
|
@@ -8599,7 +8809,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8599
8809
|
var parentrow = this.parent.getRows()[parseInt(toIndex.toString(), 10)];
|
|
8600
8810
|
totalRecord.push(parentData);
|
|
8601
8811
|
rows.push(parentrow);
|
|
8602
|
-
this.
|
|
8812
|
+
this.updateRowAndCellElements(totalRecord, rows, index);
|
|
8603
8813
|
}
|
|
8604
8814
|
if (this.parent.enableImmutableMode && this.parent["" + action] === 'outdenting') {
|
|
8605
8815
|
var index = this.parent.allowRowDragAndDrop
|
|
@@ -8611,7 +8821,29 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8611
8821
|
var rows = [];
|
|
8612
8822
|
totalRecord.push(record);
|
|
8613
8823
|
rows.push(row);
|
|
8614
|
-
this.
|
|
8824
|
+
this.updateRowAndCellElements(totalRecord, rows, index);
|
|
8825
|
+
}
|
|
8826
|
+
}
|
|
8827
|
+
};
|
|
8828
|
+
/**
|
|
8829
|
+
* Updates the rows and cells
|
|
8830
|
+
*
|
|
8831
|
+
* @param {Object[]} records - Updates the given records
|
|
8832
|
+
* @param {HTMLTableRowElement[]} rows - Updates the given rows
|
|
8833
|
+
* @param {number} index - Updates the given cell index
|
|
8834
|
+
* @returns {void}
|
|
8835
|
+
*/
|
|
8836
|
+
RowDD.prototype.updateRowAndCellElements = function (records, rows, index) {
|
|
8837
|
+
for (var i = 0; i < records.length; i++) {
|
|
8838
|
+
this.parent.renderModule.cellRender({
|
|
8839
|
+
data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
|
|
8840
|
+
column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
|
|
8841
|
+
requestType: 'rowDragAndDrop'
|
|
8842
|
+
});
|
|
8843
|
+
if (this.parent['action'] === 'indenting' || this.parent['action'] === 'outdenting') {
|
|
8844
|
+
this.parent.renderModule.RowModifier({
|
|
8845
|
+
data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
|
|
8846
|
+
});
|
|
8615
8847
|
}
|
|
8616
8848
|
}
|
|
8617
8849
|
};
|
|
@@ -8660,7 +8892,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8660
8892
|
record_1.parentItem.taskData) {
|
|
8661
8893
|
dropIndex = i;
|
|
8662
8894
|
if (tObj.enableVirtualization) {
|
|
8663
|
-
dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('
|
|
8895
|
+
dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('aria-rowindex'), 10) - 1;
|
|
8664
8896
|
}
|
|
8665
8897
|
}
|
|
8666
8898
|
}
|
|
@@ -8669,26 +8901,27 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8669
8901
|
dropIndex = this.selectedRow.rowIndex - 1;
|
|
8670
8902
|
}
|
|
8671
8903
|
if (this.parent.enableVirtualization && this.selectedRecord && !(record_1.level > this.selectedRecord.level)) {
|
|
8672
|
-
dropIndex = parseInt(this.selectedRow.getAttribute('
|
|
8904
|
+
dropIndex = parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 2;
|
|
8673
8905
|
}
|
|
8674
8906
|
tObj["" + action] = 'indenting';
|
|
8675
8907
|
tObj["" + droppedIndex] = dropIndex;
|
|
8676
8908
|
this.eventTrigger('indenting', dropIndex);
|
|
8677
8909
|
}
|
|
8678
8910
|
else if (request === 'outdent') {
|
|
8679
|
-
|
|
8680
|
-
|
|
8911
|
+
var isInvalidSelection = this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0;
|
|
8912
|
+
var isRootLevel = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0;
|
|
8913
|
+
if (isInvalidSelection || isRootLevel) {
|
|
8681
8914
|
return;
|
|
8682
8915
|
}
|
|
8683
|
-
var
|
|
8684
|
-
var
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
}
|
|
8916
|
+
var parentItem_1 = this.selectedRecord.parentItem;
|
|
8917
|
+
var records = tObj.getCurrentViewRecords();
|
|
8918
|
+
var dropIndex = records.findIndex(function (record) { return record.uniqueID === parentItem_1.uniqueID; });
|
|
8919
|
+
if (dropIndex === -1) {
|
|
8920
|
+
return;
|
|
8689
8921
|
}
|
|
8690
8922
|
if (this.parent.enableVirtualization && this.selectedRecord) {
|
|
8691
|
-
|
|
8923
|
+
var ariaRowIndex = this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('aria-rowindex');
|
|
8924
|
+
dropIndex = parseInt(ariaRowIndex, 10) - 1;
|
|
8692
8925
|
}
|
|
8693
8926
|
tObj["" + action] = 'outdenting';
|
|
8694
8927
|
tObj["" + droppedIndex] = dropIndex;
|
|
@@ -8715,7 +8948,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8715
8948
|
if (!actionArgs.cancel) {
|
|
8716
8949
|
if (actionArgs.action === 'indenting') {
|
|
8717
8950
|
if (_this.parent.enableVirtualization) {
|
|
8718
|
-
_this.reorderRows([parseInt(_this.selectedRow.getAttribute('
|
|
8951
|
+
_this.reorderRows([parseInt(_this.selectedRow.getAttribute('aria-rowindex'), 10) - 1], dropIndex, 'child');
|
|
8719
8952
|
}
|
|
8720
8953
|
else {
|
|
8721
8954
|
_this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');
|
|
@@ -8723,7 +8956,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
8723
8956
|
}
|
|
8724
8957
|
else if (actionArgs.action === 'outdenting') {
|
|
8725
8958
|
if (_this.parent.enableVirtualization) {
|
|
8726
|
-
_this.reorderRows([parseInt(_this.selectedRow.getAttribute('
|
|
8959
|
+
_this.reorderRows([parseInt(_this.selectedRow.getAttribute('aria-rowindex'), 10) - 1], dropIndex, 'below');
|
|
8727
8960
|
}
|
|
8728
8961
|
else {
|
|
8729
8962
|
_this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');
|
|
@@ -9026,7 +9259,8 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9026
9259
|
else {
|
|
9027
9260
|
rowTop = rowPositionHeight + contentHeight + roundOff;
|
|
9028
9261
|
}
|
|
9029
|
-
var rowBottom =
|
|
9262
|
+
var rowBottom = row[0].offsetHeight !== 0 && isNullOrUndefined(rowEle) ?
|
|
9263
|
+
rowTop + row[0].offsetHeight : rowTop + rowEle.offsetHeight;
|
|
9030
9264
|
var difference = rowBottom - rowTop;
|
|
9031
9265
|
var divide = difference / 3;
|
|
9032
9266
|
var topRowSegment = rowTop + divide;
|
|
@@ -9043,6 +9277,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9043
9277
|
var isTopSegment = posy <= topRowSegment;
|
|
9044
9278
|
var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
|
|
9045
9279
|
var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
|
|
9280
|
+
var isBorderNeed = true;
|
|
9046
9281
|
if (isTopSegment || isMiddleRowSegment || isBottomRowSegment) {
|
|
9047
9282
|
if (isTopSegment && this.dropPosition !== 'Invalid') {
|
|
9048
9283
|
this.removeChildBorder();
|
|
@@ -9051,19 +9286,12 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9051
9286
|
this.addFirstrowBorder(rowEle);
|
|
9052
9287
|
this.removeErrorElem();
|
|
9053
9288
|
this.removeLastrowBorder(rowEle);
|
|
9054
|
-
this.topOrBottomBorder(args.target);
|
|
9055
9289
|
}
|
|
9056
9290
|
if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {
|
|
9057
9291
|
this.removetopOrBottomBorder();
|
|
9058
|
-
|
|
9059
|
-
var element = closest(args.target, 'tr');
|
|
9060
|
-
rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));
|
|
9061
|
-
if (rowElement.length > 0) {
|
|
9062
|
-
this.addRemoveClasses(rowElement, true, 'e-childborder');
|
|
9063
|
-
}
|
|
9292
|
+
this.dropPosition = 'middleSegment';
|
|
9064
9293
|
this.addLastRowborder(rowEle);
|
|
9065
9294
|
this.addFirstrowBorder(rowEle);
|
|
9066
|
-
this.dropPosition = 'middleSegment';
|
|
9067
9295
|
}
|
|
9068
9296
|
if (isBottomRowSegment && this.dropPosition !== 'Invalid') {
|
|
9069
9297
|
this.removeErrorElem();
|
|
@@ -9072,11 +9300,165 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9072
9300
|
this.dropPosition = 'bottomSegment';
|
|
9073
9301
|
this.addLastRowborder(rowEle);
|
|
9074
9302
|
this.removeFirstrowBorder(rowEle);
|
|
9075
|
-
|
|
9303
|
+
}
|
|
9304
|
+
if ((isTopSegment || isBottomRowSegment) && this.dropPosition !== 'Invalid') {
|
|
9305
|
+
isBorderNeed = this.updateBorderStatus(row, index);
|
|
9306
|
+
this.topOrBottomBorder(args.target, isBorderNeed);
|
|
9307
|
+
}
|
|
9308
|
+
else if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {
|
|
9309
|
+
var rowElement = [];
|
|
9310
|
+
var element = closest(args.target, 'tr');
|
|
9311
|
+
rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));
|
|
9312
|
+
isBorderNeed = this.updateBorderStatus(row, index);
|
|
9313
|
+
if (rowElement.length > 0 && isBorderNeed) {
|
|
9314
|
+
this.addRemoveClasses(rowElement, true, 'e-childborder');
|
|
9315
|
+
}
|
|
9076
9316
|
}
|
|
9077
9317
|
}
|
|
9078
9318
|
return this.dropPosition;
|
|
9079
9319
|
};
|
|
9320
|
+
/**
|
|
9321
|
+
* Updates the border status for a specified row and index.
|
|
9322
|
+
*
|
|
9323
|
+
* @private
|
|
9324
|
+
* @param {Element[]} row - The array of row elements to be updated.
|
|
9325
|
+
* @param {number} index - The index of the row element for which the border status is to be updated.
|
|
9326
|
+
* @returns {boolean} - Returns true if the border status was successfully updated, otherwise false.
|
|
9327
|
+
*/
|
|
9328
|
+
RowDD.prototype.updateBorderStatus = function (row, index) {
|
|
9329
|
+
var _this = this;
|
|
9330
|
+
var isBorderNeed = true;
|
|
9331
|
+
var rows = this.parent.grid.getRows();
|
|
9332
|
+
var childRows = [];
|
|
9333
|
+
var hasDetailTemplate = false;
|
|
9334
|
+
if (!isNullOrUndefined(this.parent.detailTemplate)) {
|
|
9335
|
+
rows = this.parent.getDataRows();
|
|
9336
|
+
hasDetailTemplate = true;
|
|
9337
|
+
}
|
|
9338
|
+
var treegridColumnIndex = this.parent.treeColumnIndex;
|
|
9339
|
+
var treeColIndex = this.parent.allowRowDragAndDrop ?
|
|
9340
|
+
(hasDetailTemplate ? treegridColumnIndex + 2 : treegridColumnIndex + 1) :
|
|
9341
|
+
(hasDetailTemplate ? treegridColumnIndex + 1 : treegridColumnIndex);
|
|
9342
|
+
if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
|
|
9343
|
+
treeColIndex = treegridColumnIndex;
|
|
9344
|
+
}
|
|
9345
|
+
var dragRows = row;
|
|
9346
|
+
var targetRow = [rows["" + index]];
|
|
9347
|
+
if (this.dropPosition === 'topSegment') {
|
|
9348
|
+
row.filter(function (e) {
|
|
9349
|
+
if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(targetRow[0]) ||
|
|
9350
|
+
isNullOrUndefined(targetRow[0].cells)) {
|
|
9351
|
+
return true;
|
|
9352
|
+
}
|
|
9353
|
+
var regex = /index(\d+)|level(\d+)/g;
|
|
9354
|
+
var parentIndexLevel = e === null || e === undefined ? undefined : e.cells["" + treeColIndex].className.match(regex);
|
|
9355
|
+
var dropIndexLevel = targetRow[0].cells["" + treeColIndex].className.match(regex);
|
|
9356
|
+
if (isNullOrUndefined(dropIndexLevel) || isNullOrUndefined(dropIndexLevel)) {
|
|
9357
|
+
return true;
|
|
9358
|
+
}
|
|
9359
|
+
var parentLevel = +parentIndexLevel[1].match(/\d+/)[0];
|
|
9360
|
+
var dropParentLevel = +dropIndexLevel[1].match(/\d+/)[0];
|
|
9361
|
+
var InDraggedRowIndex = false;
|
|
9362
|
+
if (parentLevel !== 0 && parentLevel !== dropParentLevel) {
|
|
9363
|
+
return true;
|
|
9364
|
+
}
|
|
9365
|
+
for (var i = 0; i < rows.length; i++) {
|
|
9366
|
+
if (rows[parseInt(i.toString(), 10)] === dragRows[0]) {
|
|
9367
|
+
InDraggedRowIndex = true;
|
|
9368
|
+
}
|
|
9369
|
+
if (InDraggedRowIndex && rows[parseInt(i.toString(), 10)] !== dragRows[0]) {
|
|
9370
|
+
var parentIndexLevelInRow = rows[parseInt(i.toString(), 10)].cells["" + treeColIndex].className.match(regex);
|
|
9371
|
+
var parentLevelInRow = +parentIndexLevelInRow[1].match(/\d+/)[0];
|
|
9372
|
+
if (parentLevelInRow !== parentLevel && parentLevelInRow > parentLevel) {
|
|
9373
|
+
childRows.push(rows[parseInt(i.toString(), 10)]);
|
|
9374
|
+
}
|
|
9375
|
+
else {
|
|
9376
|
+
break;
|
|
9377
|
+
}
|
|
9378
|
+
}
|
|
9379
|
+
}
|
|
9380
|
+
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))) {
|
|
9381
|
+
isBorderNeed = false;
|
|
9382
|
+
}
|
|
9383
|
+
return true;
|
|
9384
|
+
});
|
|
9385
|
+
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;
|
|
9386
|
+
}
|
|
9387
|
+
if (this.dropPosition === 'bottomSegment') {
|
|
9388
|
+
targetRow.filter(function (e) {
|
|
9389
|
+
if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(dragRows[0]) ||
|
|
9390
|
+
isNullOrUndefined(dragRows[0].cells)) {
|
|
9391
|
+
return true;
|
|
9392
|
+
}
|
|
9393
|
+
var regex = /index(\d+)|level(\d+)/g;
|
|
9394
|
+
var parentIndexLevel = e === null || e === undefined ? undefined : e.cells["" + treeColIndex].className.match(regex);
|
|
9395
|
+
var dragIndexLevel = dragRows[0].cells["" + treeColIndex].className.match(regex);
|
|
9396
|
+
if (isNullOrUndefined(dragIndexLevel) || isNullOrUndefined(parentIndexLevel)) {
|
|
9397
|
+
return true;
|
|
9398
|
+
}
|
|
9399
|
+
var parentLevel = +parentIndexLevel[1].match(/\d+/)[0];
|
|
9400
|
+
var dragParentLevel = +dragIndexLevel[1].match(/\d+/)[0];
|
|
9401
|
+
var InDraggedRowIndex = false;
|
|
9402
|
+
if (parentLevel !== 0 && parentLevel !== dragParentLevel) {
|
|
9403
|
+
return true;
|
|
9404
|
+
}
|
|
9405
|
+
for (var i = 0; i < rows.length; i++) {
|
|
9406
|
+
if (rows[parseInt(i.toString(), 10)] === targetRow[0]) {
|
|
9407
|
+
InDraggedRowIndex = true;
|
|
9408
|
+
}
|
|
9409
|
+
if (InDraggedRowIndex && rows[parseInt(i.toString(), 10)] !== targetRow[0]) {
|
|
9410
|
+
var parentIndexLevelInRow = rows[parseInt(i.toString(), 10)].cells["" + treeColIndex].className.match(regex);
|
|
9411
|
+
var parentLevelInRow = +parentIndexLevelInRow[1].match(/\d+/)[0];
|
|
9412
|
+
if (parentLevelInRow !== parentLevel && parentLevelInRow > parentLevel) {
|
|
9413
|
+
childRows.push(rows[parseInt(i.toString(), 10)]);
|
|
9414
|
+
}
|
|
9415
|
+
else {
|
|
9416
|
+
break;
|
|
9417
|
+
}
|
|
9418
|
+
}
|
|
9419
|
+
}
|
|
9420
|
+
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))) {
|
|
9421
|
+
isBorderNeed = false;
|
|
9422
|
+
}
|
|
9423
|
+
return true;
|
|
9424
|
+
});
|
|
9425
|
+
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;
|
|
9426
|
+
}
|
|
9427
|
+
if (this.dropPosition === 'middleSegment') {
|
|
9428
|
+
targetRow.filter(function (e) {
|
|
9429
|
+
if (isNullOrUndefined(e) || isNullOrUndefined(e.cells) || isNullOrUndefined(dragRows[0]) ||
|
|
9430
|
+
isNullOrUndefined(dragRows[0].cells)) {
|
|
9431
|
+
return true;
|
|
9432
|
+
}
|
|
9433
|
+
for (var i = 0; i < dragRows.length; i++) {
|
|
9434
|
+
var regex = /index(\d+)|level(\d+)/g;
|
|
9435
|
+
var dropActualIndex = targetRow[0].rowIndex;
|
|
9436
|
+
var dragIndexLevel = dragRows[parseInt(i.toString(), 10)].cells["" + treeColIndex].className.match(regex);
|
|
9437
|
+
if (!dragIndexLevel) {
|
|
9438
|
+
return true;
|
|
9439
|
+
}
|
|
9440
|
+
var dragIndex = parseInt(dragIndexLevel.find(function (item) { return item.includes('index'); }).match(/\d+/)[0] || '0', 10);
|
|
9441
|
+
if (hasDetailTemplate) {
|
|
9442
|
+
dropActualIndex = dropActualIndex / 2;
|
|
9443
|
+
}
|
|
9444
|
+
if (dragIndex === dropActualIndex && !_this.parent.rowDropSettings.targetID) {
|
|
9445
|
+
isBorderNeed = false;
|
|
9446
|
+
}
|
|
9447
|
+
else {
|
|
9448
|
+
isBorderNeed = true;
|
|
9449
|
+
break;
|
|
9450
|
+
}
|
|
9451
|
+
}
|
|
9452
|
+
if (!isBorderNeed) {
|
|
9453
|
+
_this.dropPosition = 'Invalid';
|
|
9454
|
+
_this.addErrorElem();
|
|
9455
|
+
}
|
|
9456
|
+
return isBorderNeed;
|
|
9457
|
+
});
|
|
9458
|
+
}
|
|
9459
|
+
this.canDrop = isBorderNeed;
|
|
9460
|
+
return isBorderNeed;
|
|
9461
|
+
};
|
|
9080
9462
|
/**
|
|
9081
9463
|
* Removes the visual border from all child rows within the TreeGrid.
|
|
9082
9464
|
*
|
|
@@ -9217,23 +9599,28 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9217
9599
|
* Applies drop border styles to row elements based on the current drop position ('topSegment' or 'bottomSegment').
|
|
9218
9600
|
*
|
|
9219
9601
|
* @param {Element} target - The target element where the drop action is taking place.
|
|
9602
|
+
* @param {boolean} [isBorderNeed=true] - Indicates whether a border is needed during the drop action. Defaults to `true`.
|
|
9220
9603
|
* @returns {void} No return value.
|
|
9221
9604
|
*/
|
|
9222
|
-
RowDD.prototype.topOrBottomBorder = function (target) {
|
|
9223
|
-
|
|
9605
|
+
RowDD.prototype.topOrBottomBorder = function (target, isBorderNeed) {
|
|
9606
|
+
if (isBorderNeed === void 0) { isBorderNeed = true; }
|
|
9224
9607
|
var element = closest(target, 'tr');
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9608
|
+
var rowElements = element ?
|
|
9609
|
+
Array.from(element.querySelectorAll('.e-rowcell, .e-rowdragdrop, .e-detailrowcollapse')) : [];
|
|
9610
|
+
if (!rowElements.length) {
|
|
9611
|
+
return;
|
|
9612
|
+
}
|
|
9613
|
+
var classAction = isBorderNeed ? this.addRemoveClasses.bind(this, rowElements, true) : this.addRemoveClasses.bind(this, rowElements, false, 'e-dragborder');
|
|
9614
|
+
if (this.dropPosition === 'topSegment') {
|
|
9615
|
+
classAction('e-droptop');
|
|
9616
|
+
var lastRowDragBorder = this.parent.element.querySelector('.e-lastrow-dragborder');
|
|
9617
|
+
if (lastRowDragBorder) {
|
|
9618
|
+
lastRowDragBorder.remove();
|
|
9235
9619
|
}
|
|
9236
9620
|
}
|
|
9621
|
+
if (this.dropPosition === 'bottomSegment') {
|
|
9622
|
+
classAction('e-dropbottom');
|
|
9623
|
+
}
|
|
9237
9624
|
};
|
|
9238
9625
|
/**
|
|
9239
9626
|
* Removes the drop border classes ('e-dropbottom' and 'e-droptop') from the parent element if present.
|
|
@@ -9298,18 +9685,29 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9298
9685
|
}
|
|
9299
9686
|
cloneElement.style.cursor = '';
|
|
9300
9687
|
var rowEle = args.target ? closest(args.target, 'tr') : null;
|
|
9301
|
-
var rowIdx =
|
|
9688
|
+
var rowIdx = -1;
|
|
9689
|
+
if (!isNullOrUndefined(this.parent.detailTemplate)) {
|
|
9690
|
+
rowIdx = rowEle ? this.parent.getDataRows().indexOf(rowEle) : -1;
|
|
9691
|
+
}
|
|
9692
|
+
else {
|
|
9693
|
+
rowIdx = rowEle ? rowEle.rowIndex : -1;
|
|
9694
|
+
}
|
|
9302
9695
|
if (rowIdx === -1) {
|
|
9303
9696
|
this.canDrop = false;
|
|
9304
9697
|
this.addErrorElem();
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
this.removeChildBorder();
|
|
9308
|
-
}
|
|
9698
|
+
this.removetopOrBottomBorder();
|
|
9699
|
+
this.removeChildBorder();
|
|
9309
9700
|
return;
|
|
9310
9701
|
}
|
|
9311
9702
|
var dragRecords = Array.isArray(args.data) ? args.data : [args.data];
|
|
9312
9703
|
var droppedRecord = tObj.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
|
|
9704
|
+
if (tObj.rowDropSettings.targetID) {
|
|
9705
|
+
var dropElement = parentsUntil(args.target, 'e-treegrid');
|
|
9706
|
+
if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID) {
|
|
9707
|
+
var srcControl = dropElement.ej2_instances[0];
|
|
9708
|
+
droppedRecord = srcControl.getCurrentViewRecords()[parseInt(rowIdx.toString(), 10)];
|
|
9709
|
+
}
|
|
9710
|
+
}
|
|
9313
9711
|
this.removeErrorElem();
|
|
9314
9712
|
this.canDrop = true;
|
|
9315
9713
|
this.ensuredropPosition(dragRecords, droppedRecord);
|
|
@@ -9341,13 +9739,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9341
9739
|
var parentItem = 'parentItem';
|
|
9342
9740
|
if (!tObj.rowDropSettings.targetID) {
|
|
9343
9741
|
if (parentsUntil(args.target, 'e-content') || (this.dropPosition === 'Invalid' || !this.canDrop)) {
|
|
9344
|
-
if (this.parent.element.querySelector('.e-errorelem')) {
|
|
9742
|
+
if (this.parent.element.querySelector('.e-errorelem') || !this.canDrop) {
|
|
9345
9743
|
this.dropPosition = 'Invalid';
|
|
9346
9744
|
}
|
|
9347
9745
|
setValue('dropPosition', this.dropPosition, args);
|
|
9348
9746
|
tObj.trigger(rowDrop, args);
|
|
9349
9747
|
if (!args.cancel) {
|
|
9350
|
-
if (!isCountRequired(this.parent) && this.dropPosition === 'Invalid') {
|
|
9748
|
+
if (!isCountRequired(this.parent) && (this.dropPosition === 'Invalid' && !this.canDrop)) {
|
|
9351
9749
|
return;
|
|
9352
9750
|
}
|
|
9353
9751
|
if (!isCountRequired(this.parent)) {
|
|
@@ -9364,9 +9762,15 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9364
9762
|
else {
|
|
9365
9763
|
if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&
|
|
9366
9764
|
parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {
|
|
9765
|
+
if (this.parent.element.querySelector('.e-errorelem') || !this.canDrop) {
|
|
9766
|
+
this.dropPosition = 'Invalid';
|
|
9767
|
+
}
|
|
9367
9768
|
setValue('dropPosition', this.dropPosition, args);
|
|
9368
9769
|
tObj.trigger(rowDrop, args);
|
|
9369
9770
|
if (!args.cancel && tObj.rowDropSettings.targetID) {
|
|
9771
|
+
if (this.dropPosition === 'Invalid' && !this.canDrop) {
|
|
9772
|
+
return;
|
|
9773
|
+
}
|
|
9370
9774
|
this.dragDropGrid(args);
|
|
9371
9775
|
if (tObj.isLocalData) {
|
|
9372
9776
|
tObj.flatData = this.orderToIndex(tObj.flatData);
|
|
@@ -9499,13 +9903,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9499
9903
|
}
|
|
9500
9904
|
};
|
|
9501
9905
|
/**
|
|
9502
|
-
* Retrieves the index of the target row based on its '
|
|
9906
|
+
* Retrieves the index of the target row based on its 'aria-rowindex' attribute.
|
|
9503
9907
|
*
|
|
9504
9908
|
* @param {Element} targetRow - The target row element from which to retrieve the index.
|
|
9505
9909
|
* @returns {number} - The index of the target row, or 0 if the targetRow is null or undefined.
|
|
9506
9910
|
*/
|
|
9507
9911
|
RowDD.prototype.getTargetIdx = function (targetRow) {
|
|
9508
|
-
return targetRow ? parseInt(targetRow.getAttribute('
|
|
9912
|
+
return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) - 1 : 0;
|
|
9509
9913
|
};
|
|
9510
9914
|
/**
|
|
9511
9915
|
* Retrieves the parent data of a given record during a row drag-and-drop operation.
|
|
@@ -9568,7 +9972,13 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
9568
9972
|
this.droppedRecord = tObj.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
9569
9973
|
}
|
|
9570
9974
|
else {
|
|
9571
|
-
this.
|
|
9975
|
+
if (!isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
|
|
9976
|
+
var rowsObject = this.parent.grid.getRowsObject();
|
|
9977
|
+
this.droppedRecord = rowsObject.length > 0 ? rowsObject[args.dropIndex].data : undefined;
|
|
9978
|
+
}
|
|
9979
|
+
else {
|
|
9980
|
+
this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
|
|
9981
|
+
}
|
|
9572
9982
|
}
|
|
9573
9983
|
}
|
|
9574
9984
|
var dragRecords = [];
|
|
@@ -10106,6 +10516,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
|
|
|
10106
10516
|
};
|
|
10107
10517
|
/**
|
|
10108
10518
|
* Cleans up resources, event listeners, and DOM elements when the TreeGrid component is destroyed.
|
|
10519
|
+
*
|
|
10109
10520
|
* @returns {void}
|
|
10110
10521
|
*/
|
|
10111
10522
|
RowDD.prototype.destroy = function () {
|
|
@@ -10159,7 +10570,7 @@ var __decorate$c = (undefined && undefined.__decorate) || function (decorators,
|
|
|
10159
10570
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10160
10571
|
};
|
|
10161
10572
|
/**
|
|
10162
|
-
* Configures the row
|
|
10573
|
+
* Configures the settings for row dragging and dropping within the TreeGrid, allowing for enhanced user interaction and data manipulation capabilities.
|
|
10163
10574
|
*/
|
|
10164
10575
|
var RowDropSettings = /** @__PURE__ @class */ (function (_super) {
|
|
10165
10576
|
__extends$e(RowDropSettings, _super);
|
|
@@ -10219,7 +10630,8 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
10219
10630
|
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
10220
10631
|
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
10221
10632
|
if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
10222
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
10633
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
|
|
10634
|
+
|| notifyArgs.virtualInfo.blockIndexes.length === 1) {
|
|
10223
10635
|
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
10224
10636
|
}
|
|
10225
10637
|
}
|
|
@@ -10228,7 +10640,7 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
10228
10640
|
}
|
|
10229
10641
|
}
|
|
10230
10642
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
10231
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
10643
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
10232
10644
|
return _super.prototype.generateRows.call(this, data, notifyArgs);
|
|
10233
10645
|
}
|
|
10234
10646
|
else {
|
|
@@ -10249,7 +10661,7 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
|
|
|
10249
10661
|
var clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',
|
|
10250
10662
|
'save', 'delete'].some(function (value) { return action === value; });
|
|
10251
10663
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
10252
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
10664
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
10253
10665
|
var model = 'model';
|
|
10254
10666
|
var currentPage = this["" + model].currentPage;
|
|
10255
10667
|
if (clear) {
|
|
@@ -11038,7 +11450,7 @@ var Page = /** @__PURE__ @class */ (function () {
|
|
|
11038
11450
|
return newResults;
|
|
11039
11451
|
};
|
|
11040
11452
|
Page.prototype.updatePageSize = function (pageingDetails) {
|
|
11041
|
-
var updateSize = pageingDetails.
|
|
11453
|
+
var updateSize = pageingDetails.count;
|
|
11042
11454
|
var gridPagerModule = this.parent.grid.pagerModule;
|
|
11043
11455
|
if (this.parent.pageSettings.pageSizes === true) {
|
|
11044
11456
|
if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {
|
|
@@ -11449,7 +11861,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
|
|
|
11449
11861
|
var cellElement = createElement('td', {
|
|
11450
11862
|
className: 'e-summary'
|
|
11451
11863
|
});
|
|
11452
|
-
if (this.parent.isReact) {
|
|
11864
|
+
if (this.parent.isReact && typeof (summaryColumn.footerTemplate) !== 'string') {
|
|
11453
11865
|
var renderReactTemplates = 'renderReactTemplates';
|
|
11454
11866
|
tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);
|
|
11455
11867
|
this.parent["" + renderReactTemplates]();
|
|
@@ -12071,7 +12483,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12071
12483
|
focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];
|
|
12072
12484
|
if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
|
|
12073
12485
|
var newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];
|
|
12074
|
-
var index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('
|
|
12486
|
+
var index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('aria-rowindex'), 10) - 1;
|
|
12075
12487
|
this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);
|
|
12076
12488
|
}
|
|
12077
12489
|
}
|
|
@@ -12100,7 +12512,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12100
12512
|
childs = findChildrenRecords(data);
|
|
12101
12513
|
uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');
|
|
12102
12514
|
}
|
|
12103
|
-
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('
|
|
12515
|
+
var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10) - 1;
|
|
12104
12516
|
if (childs.length) {
|
|
12105
12517
|
var totalCount = parentRowIndex + childs.length;
|
|
12106
12518
|
var firstChildIndex = parentRowIndex + 1;
|
|
@@ -12137,7 +12549,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12137
12549
|
BatchEdit.prototype.updateRowIndex = function () {
|
|
12138
12550
|
var rows = this.parent.grid.getDataRows();
|
|
12139
12551
|
for (var i = 0; i < rows.length; i++) {
|
|
12140
|
-
rows[parseInt(i.toString(), 10)].setAttribute('
|
|
12552
|
+
rows[parseInt(i.toString(), 10)].setAttribute('aria-rowindex', (i + 1).toString());
|
|
12141
12553
|
}
|
|
12142
12554
|
};
|
|
12143
12555
|
BatchEdit.prototype.updateChildCount = function (records) {
|
|
@@ -12266,7 +12678,7 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12266
12678
|
if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {
|
|
12267
12679
|
addRecords.reverse();
|
|
12268
12680
|
for (var i_1 = 0; i_1 < addRecords.length; i_1++) {
|
|
12269
|
-
var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i_1.toString(), 10)].getAttribute('
|
|
12681
|
+
var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i_1.toString(), 10)].getAttribute('aria-rowindex'), 10) - 1;
|
|
12270
12682
|
data.splice(index_1, 0, addRecords[parseInt(i_1.toString(), 10)]);
|
|
12271
12683
|
}
|
|
12272
12684
|
}
|
|
@@ -12406,8 +12818,15 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
|
|
|
12406
12818
|
BatchEdit.prototype.nextCellIndex = function (args) {
|
|
12407
12819
|
var index = 'index';
|
|
12408
12820
|
var rowIndex = 'rowIndex';
|
|
12821
|
+
var batchChanges = this.parent.getBatchChanges();
|
|
12822
|
+
var deletedRecords = batchChanges.deletedRecords;
|
|
12409
12823
|
if (this.parent.getSelectedRows().length) {
|
|
12410
|
-
|
|
12824
|
+
if (this.isAdd && deletedRecords.length > 0) {
|
|
12825
|
+
args["" + index] = this.parent.getSelectedRecords()[0]["" + index];
|
|
12826
|
+
}
|
|
12827
|
+
else {
|
|
12828
|
+
args["" + index] = this.parent.getSelectedRows()[0]["" + rowIndex];
|
|
12829
|
+
}
|
|
12411
12830
|
}
|
|
12412
12831
|
else {
|
|
12413
12832
|
args["" + index] = this.batchIndex;
|
|
@@ -12483,7 +12902,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
12483
12902
|
}
|
|
12484
12903
|
if (e.target.classList.contains('e-treegridcollapse') || e.target.classList.contains('e-treegridexpand')) {
|
|
12485
12904
|
var tr = parentsUntil(e.target, 'e-row');
|
|
12486
|
-
var rowIndex = tr && parseInt(tr.getAttribute('
|
|
12905
|
+
var rowIndex = tr && parseInt(tr.getAttribute('aria-rowindex'), 10) - 1;
|
|
12487
12906
|
if (!isNullOrUndefined(rowIndex) && rowIndex >= 0 && this.parent.allowPaging) {
|
|
12488
12907
|
/* eslint-disable-next-line */
|
|
12489
12908
|
this.parent.grid.getDataRows()[rowIndex].dataset.uid = this.parent.grid.contentModule.getRows()[rowIndex].uid;
|
|
@@ -12653,7 +13072,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
12653
13072
|
if (!(this.parent.grid.editSettings.allowEditing) || this.parent.grid.isEdit) {
|
|
12654
13073
|
return;
|
|
12655
13074
|
}
|
|
12656
|
-
var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('
|
|
13075
|
+
var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex') - 1);
|
|
12657
13076
|
if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&
|
|
12658
13077
|
this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||
|
|
12659
13078
|
target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {
|
|
@@ -12661,8 +13080,8 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
12661
13080
|
this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);
|
|
12662
13081
|
if (this.parent.enableVirtualization) {
|
|
12663
13082
|
var tr = parentsUntil(args.target, 'e-row');
|
|
12664
|
-
this.prevAriaRowIndex = tr.getAttribute('
|
|
12665
|
-
tr.setAttribute('
|
|
13083
|
+
this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');
|
|
13084
|
+
tr.setAttribute('aria-rowindex', (tr.rowIndex + 1) + '');
|
|
12666
13085
|
}
|
|
12667
13086
|
this.updateGridEditMode('Batch');
|
|
12668
13087
|
}
|
|
@@ -12706,7 +13125,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
12706
13125
|
var prom = args["" + promise];
|
|
12707
13126
|
delete args["" + promise];
|
|
12708
13127
|
if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
|
|
12709
|
-
args.row.setAttribute('
|
|
13128
|
+
args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
|
|
12710
13129
|
this.prevAriaRowIndex = undefined;
|
|
12711
13130
|
}
|
|
12712
13131
|
if (this.keyPress !== 'enter') {
|
|
@@ -13030,8 +13449,8 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13030
13449
|
}
|
|
13031
13450
|
}
|
|
13032
13451
|
var rows = this.parent.grid.getDataRows();
|
|
13033
|
-
var firstAriaIndex = rows.length ? +rows[0].getAttribute('
|
|
13034
|
-
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('
|
|
13452
|
+
var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') - 1 : 0;
|
|
13453
|
+
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
|
|
13035
13454
|
var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
|
|
13036
13455
|
var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
|
|
13037
13456
|
if (this.parent.editSettings.mode !== 'Dialog') {
|
|
@@ -13082,7 +13501,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13082
13501
|
if (isVirtualization) {
|
|
13083
13502
|
this.prevAriaRowIndex = '-1';
|
|
13084
13503
|
}
|
|
13085
|
-
if (!this.parent.enableVirtualization || this.parent.enableVirtualization
|
|
13504
|
+
if (!this.parent.enableVirtualization || this.parent.enableVirtualization) {
|
|
13086
13505
|
this.isScrollByFocus = true;
|
|
13087
13506
|
focussedElement.focus();
|
|
13088
13507
|
}
|
|
@@ -13178,7 +13597,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13178
13597
|
this.selectedIndex = this.parent.grid.selectedRowIndex;
|
|
13179
13598
|
}
|
|
13180
13599
|
if (this.parent.enableVirtualization) {
|
|
13181
|
-
var selector = '.e-row[
|
|
13600
|
+
var selector = '.e-row[aria-rowindex="' + (this.selectedIndex + 1) + '"]';
|
|
13182
13601
|
var row = void 0;
|
|
13183
13602
|
if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&
|
|
13184
13603
|
this.parent.editSettings.newRowPosition !== 'Bottom') {
|
|
@@ -13188,7 +13607,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13188
13607
|
}
|
|
13189
13608
|
else {
|
|
13190
13609
|
if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {
|
|
13191
|
-
selector = '.e-row[
|
|
13610
|
+
selector = '.e-row[aria-rowindex="' + (this.prevAriaRowIndex + 1) + '"]';
|
|
13192
13611
|
row = this.parent.getContent().querySelector(selector);
|
|
13193
13612
|
this.addRowIndex = row ? row.rowIndex : 0;
|
|
13194
13613
|
}
|
|
@@ -13281,7 +13700,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13281
13700
|
var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';
|
|
13282
13701
|
var rows = this.parent.getRows();
|
|
13283
13702
|
var firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
|
|
13284
|
-
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('
|
|
13703
|
+
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
|
|
13285
13704
|
var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
|
|
13286
13705
|
this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
|
|
13287
13706
|
if (currentData.length) {
|
|
@@ -13475,7 +13894,7 @@ var Edit = /** @__PURE__ @class */ (function () {
|
|
|
13475
13894
|
Edit.prototype.closeEdit = function () {
|
|
13476
13895
|
if (this.parent.enableVirtualization && this.parent.grid.editSettings.mode === 'Batch' && this.parent.grid.pageSettings.currentPage > 1) {
|
|
13477
13896
|
this.editedRowIndex = this.parent.grid.editModule.editModule['cellDetails'].rowIndex;
|
|
13478
|
-
this.parent.grid.editModule.editModule['cellDetails'].rowIndex = parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule['cellDetails'].rowIndex].getAttribute('
|
|
13897
|
+
this.parent.grid.editModule.editModule['cellDetails'].rowIndex = parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule['cellDetails'].rowIndex].getAttribute('aria-rowIndex'), 10) - 1;
|
|
13479
13898
|
}
|
|
13480
13899
|
this.parent.grid.editModule.closeEdit();
|
|
13481
13900
|
};
|
|
@@ -13643,6 +14062,11 @@ var __extends$g = (undefined && undefined.__extends) || (function () {
|
|
|
13643
14062
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13644
14063
|
};
|
|
13645
14064
|
})();
|
|
14065
|
+
/**
|
|
14066
|
+
* VirtualTreeContentRenderer
|
|
14067
|
+
*
|
|
14068
|
+
* @hidden
|
|
14069
|
+
*/
|
|
13646
14070
|
var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
13647
14071
|
__extends$g(VirtualTreeContentRenderer, _super);
|
|
13648
14072
|
function VirtualTreeContentRenderer(parent, locator) {
|
|
@@ -13664,23 +14088,45 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13664
14088
|
VirtualTreeContentRenderer.prototype.getModelGenerator = function () {
|
|
13665
14089
|
return new TreeVirtualRowModelGenerator(this.parent);
|
|
13666
14090
|
};
|
|
14091
|
+
/**
|
|
14092
|
+
* Retrieves the row element for a given row index.
|
|
14093
|
+
*
|
|
14094
|
+
* @param {number} index - The index of the row to retrieve.
|
|
14095
|
+
* @returns {Element} The row element at the specified index.
|
|
14096
|
+
*/
|
|
13667
14097
|
VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {
|
|
13668
14098
|
if (this.parent.enableVirtualization && this.parent.isFrozenGrid()) {
|
|
13669
14099
|
return this.getRowCollection(index, true);
|
|
13670
14100
|
}
|
|
13671
14101
|
var dataRows = this.parent.getDataRows();
|
|
13672
|
-
var targetRow = dataRows.find(function (e) { return parseInt(e.getAttribute('
|
|
14102
|
+
var targetRow = dataRows.find(function (e) { return parseInt(e.getAttribute('aria-rowindex'), 10) - 1 === index; });
|
|
13673
14103
|
if (!targetRow && this.parent.isEdit && this.parent.editSettings.mode === 'Batch') {
|
|
13674
14104
|
return index != null ? this.parent.getRows()[parseInt(index.toString(), 10)] : undefined;
|
|
13675
14105
|
}
|
|
13676
14106
|
return targetRow;
|
|
13677
14107
|
};
|
|
14108
|
+
/**
|
|
14109
|
+
* Retrieves the frozen right virtual row element by its index.
|
|
14110
|
+
*
|
|
14111
|
+
* @param {number} index - The index of the row to be retrieved.
|
|
14112
|
+
* @returns {Element} The DOM element representing the frozen right virtual row.
|
|
14113
|
+
*/
|
|
13678
14114
|
VirtualTreeContentRenderer.prototype.getFrozenRightVirtualRowByIndex = function (index) {
|
|
13679
14115
|
return this.getRowCollection(index, false, false, true);
|
|
13680
14116
|
};
|
|
14117
|
+
/**
|
|
14118
|
+
* Retrieves the row or record from the virtual tree grid based on the provided index.
|
|
14119
|
+
* Considers conditions such as frozen rows and pagination for accurate retrieval.
|
|
14120
|
+
*
|
|
14121
|
+
* @param {number} index - The index of the desired row or record.
|
|
14122
|
+
* @param {boolean} isMovable - Specifies if the content is movable.
|
|
14123
|
+
* @param {boolean} [isRowObject] - Optional. Determines if the return value should be a row object.
|
|
14124
|
+
* @param {boolean} [isFrozenRight] - Optional. Used for determining frozen right rows.
|
|
14125
|
+
* @returns {Element | Object} - The HTML element or row object.
|
|
14126
|
+
*/
|
|
13681
14127
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13682
14128
|
VirtualTreeContentRenderer.prototype.getRowCollection = function (index, isMovable, isRowObject, isFrozenRight) {
|
|
13683
|
-
var startIdx = parseInt(this.parent.getRows()[0].getAttribute(
|
|
14129
|
+
var startIdx = parseInt(this.parent.getRows()[0].getAttribute(ariaRowIndex), 10) - 1;
|
|
13684
14130
|
var rowCollection = this.parent.getDataRows();
|
|
13685
14131
|
var collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
|
|
13686
14132
|
var selectedRow = collection[index - startIdx];
|
|
@@ -13694,12 +14140,27 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13694
14140
|
this.parent.getRowsObject()[parseInt(index.toString(), 10)].data : selectedRow;
|
|
13695
14141
|
}
|
|
13696
14142
|
}
|
|
14143
|
+
if (selectedRow == null && index != null && this.parent.editSettings.mode === 'Batch' && this.parent.isEdit && isMovable) {
|
|
14144
|
+
selectedRow = rowCollection[parseInt(index.toString(), 10)];
|
|
14145
|
+
}
|
|
13697
14146
|
return selectedRow;
|
|
13698
14147
|
};
|
|
14148
|
+
/**
|
|
14149
|
+
* @hidden
|
|
14150
|
+
* @returns {void}
|
|
14151
|
+
*/
|
|
13699
14152
|
VirtualTreeContentRenderer.prototype.addEventListener = function () {
|
|
13700
14153
|
this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
|
|
13701
14154
|
this.parent.on(indexModifier, this.indexModifier, this);
|
|
13702
14155
|
};
|
|
14156
|
+
/**
|
|
14157
|
+
* Handles virtual scrolling actions based on the provided arguments.
|
|
14158
|
+
*
|
|
14159
|
+
* @param {Object} args - The argument object.
|
|
14160
|
+
* @param {boolean} args.setTop - Determines if the virtual scroll position should reset to top.
|
|
14161
|
+
* @param {boolean} args.isExpandCollapse - Determines if the action is part of an expand/collapse operation.
|
|
14162
|
+
* @returns {void}
|
|
14163
|
+
*/
|
|
13703
14164
|
VirtualTreeContentRenderer.prototype.virtualOtherAction = function (args) {
|
|
13704
14165
|
if (args.setTop) {
|
|
13705
14166
|
this.translateY = 0;
|
|
@@ -13710,10 +14171,22 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13710
14171
|
this.isExpandCollapse = true;
|
|
13711
14172
|
}
|
|
13712
14173
|
};
|
|
14174
|
+
/**
|
|
14175
|
+
* Modifies the index based on various conditions such as record addition, deletion, or data source changes.
|
|
14176
|
+
*
|
|
14177
|
+
* @private
|
|
14178
|
+
* @param {Object} args - Contains parameters for the current operation.
|
|
14179
|
+
* @param {number} args.startIndex - The starting index for the modification.
|
|
14180
|
+
* @param {number} args.endIndex - The ending index for the modification.
|
|
14181
|
+
* @param {number} args.count - The number of items affected in the operation.
|
|
14182
|
+
* @param {string} args.requestType - The type of request, such as 'insert', 'delete', or 'update'.
|
|
14183
|
+
* @returns {void}
|
|
14184
|
+
*/
|
|
13713
14185
|
VirtualTreeContentRenderer.prototype.indexModifier = function (args) {
|
|
13714
14186
|
var content = this.parent.getContent().querySelector('.e-content');
|
|
14187
|
+
var pageSize = this.parent.pageSettings.pageSize;
|
|
13715
14188
|
if ((this.recordAdded || args.requestType === 'delete' && this.endIndex > args.count - this.parent.pageSettings.pageSize) && this.startIndex > -1 && this.endIndex > -1) {
|
|
13716
|
-
if (this.endIndex > args.count -
|
|
14189
|
+
if (this.endIndex > args.count - pageSize) {
|
|
13717
14190
|
var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
|
|
13718
14191
|
var lastIndex = nextSetResIndex + this.parent.getRows().length;
|
|
13719
14192
|
if (lastIndex > args.count) {
|
|
@@ -13731,12 +14204,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13731
14204
|
}
|
|
13732
14205
|
if (this.isDataSourceChanged) {
|
|
13733
14206
|
this.startIndex = 0;
|
|
13734
|
-
this.endIndex =
|
|
14207
|
+
this.endIndex = pageSize - 1;
|
|
13735
14208
|
}
|
|
13736
|
-
if ((this.endIndex - this.startIndex !==
|
|
13737
|
-
(this.totalRecords >
|
|
14209
|
+
if ((this.endIndex - this.startIndex !== pageSize) &&
|
|
14210
|
+
(this.totalRecords > pageSize)
|
|
13738
14211
|
&& (this.endIndex === this.totalRecords)) {
|
|
13739
|
-
args.startIndex = this.endIndex -
|
|
14212
|
+
args.startIndex = this.endIndex - pageSize;
|
|
13740
14213
|
args.endIndex = this.endIndex;
|
|
13741
14214
|
}
|
|
13742
14215
|
else {
|
|
@@ -13744,6 +14217,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13744
14217
|
args.endIndex = this.endIndex;
|
|
13745
14218
|
}
|
|
13746
14219
|
};
|
|
14220
|
+
/**
|
|
14221
|
+
* Handles the addition or removal of event listeners for virtual scrolling in a TreeGrid.
|
|
14222
|
+
*
|
|
14223
|
+
* @param {string} action - The action to perform, either 'on' or 'off'.
|
|
14224
|
+
* @returns {void}
|
|
14225
|
+
*/
|
|
13747
14226
|
VirtualTreeContentRenderer.prototype.eventListener = function (action) {
|
|
13748
14227
|
var _this = this;
|
|
13749
14228
|
if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
@@ -13770,6 +14249,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13770
14249
|
this.parent.addEventListener('rowSelected', this.rowSelectedEvent.bind(this));
|
|
13771
14250
|
this.parent["" + action]('select-virtual-Row', this.toSelectVirtualRow, this);
|
|
13772
14251
|
this.parent.on('content-ready', this.fn, this);
|
|
14252
|
+
this.parent.addEventListener(actionBegin, this.handleActionBegin.bind(this));
|
|
13773
14253
|
this.parent.addEventListener(actionComplete, this.onActionComplete.bind(this));
|
|
13774
14254
|
this.parent["" + action]('virtual-scroll-edit-action-begin', this.beginEdit, this);
|
|
13775
14255
|
this.parent["" + action]('virtual-scroll-add-action-begin', this.beginAdd, this);
|
|
@@ -13780,15 +14260,30 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13780
14260
|
this.parent["" + action]('select-row-on-context-open', this.toSelectRowOnContextOpen, this);
|
|
13781
14261
|
this.parent["" + action]('refresh-virtual-editform-cells', this.refreshCell, this);
|
|
13782
14262
|
this.parent["" + action]('virtaul-cell-focus', this.cellFocus, this);
|
|
14263
|
+
this.parent["" + action]('virtual-scroll-edit', this.restoreEditState, this);
|
|
13783
14264
|
}
|
|
13784
14265
|
else {
|
|
13785
14266
|
_super.prototype.eventListener.call(this, 'on');
|
|
13786
14267
|
}
|
|
13787
14268
|
};
|
|
14269
|
+
/**
|
|
14270
|
+
* Handles cell focus transitions in a virtualized tree grid component
|
|
14271
|
+
* when a keyboard event is triggered.
|
|
14272
|
+
*
|
|
14273
|
+
* @param {KeyboardEventArgs} e - The keyboard event arguments that contain
|
|
14274
|
+
* information about the key action.
|
|
14275
|
+
* @returns {void}
|
|
14276
|
+
*/
|
|
13788
14277
|
VirtualTreeContentRenderer.prototype.cellFocus = function (e) {
|
|
13789
14278
|
var virtualCellFocus = 'virtualCellFocus';
|
|
13790
14279
|
_super.prototype["" + virtualCellFocus].call(this, e);
|
|
13791
14280
|
};
|
|
14281
|
+
/**
|
|
14282
|
+
* Handles the data ready event for the virtual tree grid content renderer.
|
|
14283
|
+
*
|
|
14284
|
+
* @param {NotifyArgs} [e] - The notification arguments that contain information about the data.
|
|
14285
|
+
* @returns {void}
|
|
14286
|
+
*/
|
|
13792
14287
|
VirtualTreeContentRenderer.prototype.onDataReady = function (e) {
|
|
13793
14288
|
_super.prototype.onDataReady.call(this, e);
|
|
13794
14289
|
if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
@@ -13813,6 +14308,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13813
14308
|
}
|
|
13814
14309
|
}
|
|
13815
14310
|
};
|
|
14311
|
+
/**
|
|
14312
|
+
* Renders the table for the virtual tree content. It sets up a new `TreeInterSectionObserver`
|
|
14313
|
+
* based on certain conditions regarding the data source and counting requirements.
|
|
14314
|
+
*
|
|
14315
|
+
* @returns {void}
|
|
14316
|
+
*/
|
|
13816
14317
|
VirtualTreeContentRenderer.prototype.renderTable = function () {
|
|
13817
14318
|
_super.prototype.renderTable.call(this);
|
|
13818
14319
|
if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
@@ -13822,6 +14323,17 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13822
14323
|
this.contents = this.getPanel().firstChild;
|
|
13823
14324
|
}
|
|
13824
14325
|
};
|
|
14326
|
+
/**
|
|
14327
|
+
* Calculates the translateY value for a virtual tree grid based on the scroll top, container height,
|
|
14328
|
+
* and additional virtual scrolling information. This method specifically handles logic for remote
|
|
14329
|
+
* data sources and ensures smooth scrolling with respect to expansion states.
|
|
14330
|
+
*
|
|
14331
|
+
* @param {number} sTop - The scroll top position.
|
|
14332
|
+
* @param {number} cHeight - The height of the container.
|
|
14333
|
+
* @param {VirtualInfo} [info] - Optional virtual scrolling information.
|
|
14334
|
+
* @param {boolean} [isOnenter] - Flag indicating if the scroll event is on enter.
|
|
14335
|
+
* @returns {number} The calculated translateY value.
|
|
14336
|
+
*/
|
|
13825
14337
|
VirtualTreeContentRenderer.prototype.getTranslateY = function (sTop, cHeight, info, isOnenter) {
|
|
13826
14338
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
13827
14339
|
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
@@ -13829,15 +14341,15 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13829
14341
|
this.isRemoteExpand = false;
|
|
13830
14342
|
return this.preTranslate;
|
|
13831
14343
|
}
|
|
13832
|
-
|
|
13833
|
-
this.preTranslate = _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);
|
|
13834
|
-
return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);
|
|
13835
|
-
}
|
|
13836
|
-
}
|
|
13837
|
-
else {
|
|
13838
|
-
return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);
|
|
14344
|
+
this.preTranslate = _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);
|
|
13839
14345
|
}
|
|
14346
|
+
return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);
|
|
13840
14347
|
};
|
|
14348
|
+
/**
|
|
14349
|
+
* Handles the dataBound event to calculate and set the initial row top position for the grid.
|
|
14350
|
+
*
|
|
14351
|
+
* @returns {void}
|
|
14352
|
+
*/
|
|
13841
14353
|
VirtualTreeContentRenderer.prototype.dataBoundEvent = function () {
|
|
13842
14354
|
var dataBoundEve = 'dataBound';
|
|
13843
14355
|
var initialRowTop = 'initialRowTop';
|
|
@@ -13854,11 +14366,27 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13854
14366
|
}
|
|
13855
14367
|
_super.prototype["" + dataBoundEve].call(this);
|
|
13856
14368
|
};
|
|
14369
|
+
/**
|
|
14370
|
+
* Handles the row selection event for virtual tree grid rows.
|
|
14371
|
+
* It invokes the base class's rowSelected method and notifies
|
|
14372
|
+
* the parent component about a virtual transformation change.
|
|
14373
|
+
*
|
|
14374
|
+
* @param {RowSelectEventArgs} args - The arguments related to the row selection event.
|
|
14375
|
+
* @returns {void} This method does not return a value.
|
|
14376
|
+
*/
|
|
13857
14377
|
VirtualTreeContentRenderer.prototype.rowSelectedEvent = function (args) {
|
|
13858
14378
|
var rowSelected = 'rowSelected';
|
|
13859
14379
|
_super.prototype["" + rowSelected].call(this, args);
|
|
13860
14380
|
this.parent.notify('virtualTransform', { requestType: 'transformChange' });
|
|
13861
14381
|
};
|
|
14382
|
+
/**
|
|
14383
|
+
* Handles virtual row selection in TreeGrid.
|
|
14384
|
+
*
|
|
14385
|
+
* @param {Object} args - The argument object containing the selected index.
|
|
14386
|
+
* @param {number} args.selectedIndex - The index of the row to be selected.
|
|
14387
|
+
*
|
|
14388
|
+
* @returns {void}
|
|
14389
|
+
*/
|
|
13862
14390
|
VirtualTreeContentRenderer.prototype.toSelectVirtualRow = function (args) {
|
|
13863
14391
|
if (this.parent.isEdit) {
|
|
13864
14392
|
return;
|
|
@@ -13881,9 +14409,20 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13881
14409
|
_super.prototype["" + selectVirtualRow].call(this, args);
|
|
13882
14410
|
}
|
|
13883
14411
|
};
|
|
14412
|
+
/**
|
|
14413
|
+
* Refreshes the cells for the given row object by regenerating them.
|
|
14414
|
+
*
|
|
14415
|
+
* @param {Row<Column>} rowObj - The row object for which the cells need to be refreshed.
|
|
14416
|
+
* @returns {void} This method does not return any value.
|
|
14417
|
+
*/
|
|
13884
14418
|
VirtualTreeContentRenderer.prototype.refreshCell = function (rowObj) {
|
|
13885
14419
|
rowObj.cells = this.generateCells();
|
|
13886
14420
|
};
|
|
14421
|
+
/**
|
|
14422
|
+
* Generates an array of cells for each column in the parent.
|
|
14423
|
+
*
|
|
14424
|
+
* @returns {Cell<Column>[]} An array of cells for the corresponding columns.
|
|
14425
|
+
*/
|
|
13887
14426
|
VirtualTreeContentRenderer.prototype.generateCells = function () {
|
|
13888
14427
|
var cells = [];
|
|
13889
14428
|
for (var i = 0; i < this.parent.columns.length; i++) {
|
|
@@ -13891,6 +14430,18 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13891
14430
|
}
|
|
13892
14431
|
return cells;
|
|
13893
14432
|
};
|
|
14433
|
+
/**
|
|
14434
|
+
* Generates a cell object with provided column and row configurations.
|
|
14435
|
+
*
|
|
14436
|
+
* @param {Column} col - The Column object which holds the column configuration.
|
|
14437
|
+
* @param {string} [rowId] - An optional string that represents the row ID.
|
|
14438
|
+
* @param {CellType} [cellType] - An optional CellType enum to specify the type of the cell.
|
|
14439
|
+
* @param {number} [colSpan] - An optional number to specify the column span of the cell.
|
|
14440
|
+
* @param {number} [oIndex] - An optional number for the order index of the cell.
|
|
14441
|
+
* @param {Object} [foreignKeyData] - An optional object for foreign key data associated with the column.
|
|
14442
|
+
*
|
|
14443
|
+
* @returns {Cell<Column>} Returns a newly created Cell object of type Column.
|
|
14444
|
+
*/
|
|
13894
14445
|
VirtualTreeContentRenderer.prototype.generateCell = function (col, rowId, cellType, colSpan, oIndex, foreignKeyData) {
|
|
13895
14446
|
var opt = {
|
|
13896
14447
|
'visible': col.visible,
|
|
@@ -13909,13 +14460,29 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13909
14460
|
}
|
|
13910
14461
|
return new Cell(opt);
|
|
13911
14462
|
};
|
|
14463
|
+
/**
|
|
14464
|
+
* Begins the edit operation for a specified row in the grid.
|
|
14465
|
+
* Updates the `editedRowIndex` and assigns row data to the event data.
|
|
14466
|
+
*
|
|
14467
|
+
* @param {{ data: Object, index: number }} e - An object containing the row data and index.
|
|
14468
|
+
* @param {Object} e.data - The data of the row to be edited.
|
|
14469
|
+
* @param {number} e.index - The index of the row to be edited.
|
|
14470
|
+
* @returns {void}
|
|
14471
|
+
*/
|
|
13912
14472
|
VirtualTreeContentRenderer.prototype.beginEdit = function (e) {
|
|
13913
14473
|
this['editedRowIndex'] = e.index;
|
|
13914
|
-
var selector = '.e-row[
|
|
14474
|
+
var selector = '.e-row[aria-rowindex="' + (e.index + 1) + '"]';
|
|
13915
14475
|
var index = this.parent.getContent().querySelector(selector).rowIndex;
|
|
13916
14476
|
var rowData = this.parent.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
13917
14477
|
e.data = rowData;
|
|
13918
14478
|
};
|
|
14479
|
+
/**
|
|
14480
|
+
* Begins the process of adding a new row in the tree grid.
|
|
14481
|
+
*
|
|
14482
|
+
* @param {Object} args - The arguments for adding a new row.
|
|
14483
|
+
* @param {boolean} args.startEdit - A flag indicating whether to start editing.
|
|
14484
|
+
* @returns {void}
|
|
14485
|
+
*/
|
|
13919
14486
|
VirtualTreeContentRenderer.prototype.beginAdd = function (args) {
|
|
13920
14487
|
var addAction = 'addActionBegin';
|
|
13921
14488
|
var isAdd = 'isAdd';
|
|
@@ -13925,8 +14492,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13925
14492
|
this.addRowIndex = addArgs.addRowIndex;
|
|
13926
14493
|
this.dataRowIndex = addArgs.dataRowIndex;
|
|
13927
14494
|
var rows = this.parent.getRows();
|
|
13928
|
-
var firstAriaIndex = rows.length ? +rows[0].getAttribute('
|
|
13929
|
-
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('
|
|
14495
|
+
var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') - 1 : 0;
|
|
14496
|
+
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') - 1 : 0;
|
|
13930
14497
|
var withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;
|
|
13931
14498
|
if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
|
|
13932
14499
|
this["" + isAdd] = true;
|
|
@@ -13936,10 +14503,21 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13936
14503
|
_super.prototype["" + addAction].call(this, args);
|
|
13937
14504
|
}
|
|
13938
14505
|
};
|
|
14506
|
+
/**
|
|
14507
|
+
* Restores the edit state of the tree grid content. This method calls the
|
|
14508
|
+
* base class method to handle the restoration logic.
|
|
14509
|
+
*
|
|
14510
|
+
* @returns {void} This method does not return any value.
|
|
14511
|
+
*/
|
|
13939
14512
|
VirtualTreeContentRenderer.prototype.restoreEditState = function () {
|
|
13940
14513
|
var restoreEdit = 'restoreEdit';
|
|
13941
14514
|
_super.prototype["" + restoreEdit].call(this);
|
|
13942
14515
|
};
|
|
14516
|
+
/**
|
|
14517
|
+
* Resets the edit state if certain conditions are met.
|
|
14518
|
+
*
|
|
14519
|
+
* @returns {void}
|
|
14520
|
+
*/
|
|
13943
14521
|
VirtualTreeContentRenderer.prototype.resetIseditValue = function () {
|
|
13944
14522
|
var resetIsEdit = 'resetIsedit';
|
|
13945
14523
|
var isAdd = 'isAdd';
|
|
@@ -13948,6 +14526,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13948
14526
|
_super.prototype["" + resetIsEdit].call(this);
|
|
13949
14527
|
}
|
|
13950
14528
|
};
|
|
14529
|
+
/**
|
|
14530
|
+
* Handles the successful editing operation when virtual scrolling is enabled.
|
|
14531
|
+
* Checks if a row has been added to the tree grid and sets the `recordAdded` flag accordingly.
|
|
14532
|
+
*
|
|
14533
|
+
* @returns {void}
|
|
14534
|
+
*/
|
|
13951
14535
|
VirtualTreeContentRenderer.prototype.virtualEditSuccess = function () {
|
|
13952
14536
|
var isAdd = 'isAdd';
|
|
13953
14537
|
var content = this.parent.getContent().querySelector('.e-content');
|
|
@@ -13955,14 +14539,33 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13955
14539
|
this.recordAdded = true;
|
|
13956
14540
|
}
|
|
13957
14541
|
};
|
|
14542
|
+
/**
|
|
14543
|
+
* Cancels the edit operation for the provided data.
|
|
14544
|
+
*
|
|
14545
|
+
* @param {Object} args - The arguments containing the data to cancel edit for.
|
|
14546
|
+
* @param {Object} args.data - The specific data object for which the edit operation needs to be canceled.
|
|
14547
|
+
* @returns {void}
|
|
14548
|
+
*/
|
|
13958
14549
|
VirtualTreeContentRenderer.prototype.cancelEdit = function (args) {
|
|
13959
14550
|
var editCancel = 'editCancel';
|
|
13960
14551
|
_super.prototype["" + editCancel].call(this, args);
|
|
13961
14552
|
};
|
|
14553
|
+
/**
|
|
14554
|
+
* Handles the action of selecting a row when the context menu is opened.
|
|
14555
|
+
*
|
|
14556
|
+
* @param {Object} args - An object containing related parameters.
|
|
14557
|
+
* @param {boolean} args.isOpen - A flag indicating whether the context menu is open.
|
|
14558
|
+
* @returns {void} This method does not return any value.
|
|
14559
|
+
*/
|
|
13962
14560
|
VirtualTreeContentRenderer.prototype.toSelectRowOnContextOpen = function (args) {
|
|
13963
14561
|
var selectRowOnContextOpen = 'selectRowOnContextOpen';
|
|
13964
14562
|
_super.prototype["" + selectRowOnContextOpen].call(this, args);
|
|
13965
14563
|
};
|
|
14564
|
+
/**
|
|
14565
|
+
* Restores a new row in the grid when necessary by adding it back to the content.
|
|
14566
|
+
*
|
|
14567
|
+
* @returns {void} This method does not return any value.
|
|
14568
|
+
*/
|
|
13966
14569
|
VirtualTreeContentRenderer.prototype.restoreNewRow = function () {
|
|
13967
14570
|
var isAdd = 'isAdd';
|
|
13968
14571
|
var content = this.parent.getContent().querySelector('.e-content');
|
|
@@ -13971,10 +14574,41 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13971
14574
|
this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
|
|
13972
14575
|
}
|
|
13973
14576
|
};
|
|
14577
|
+
/**
|
|
14578
|
+
* Retrieves virtual data for operations like adding or canceling rows in the grid.
|
|
14579
|
+
*
|
|
14580
|
+
* @param {Object} data - An object containing properties to determine the virtual data processing.
|
|
14581
|
+
* @param {Object} data.virtualData - The virtual data object to be processed.
|
|
14582
|
+
* @param {boolean} data.isAdd - A boolean indicating if the operation is an addition.
|
|
14583
|
+
* @param {boolean} data.isCancel - A boolean indicating if the operation is a cancellation.
|
|
14584
|
+
* @returns {void} This method does not return any value.
|
|
14585
|
+
*/
|
|
13974
14586
|
VirtualTreeContentRenderer.prototype.getData = function (data) {
|
|
13975
14587
|
var getVirtualData = 'getVirtualData';
|
|
13976
14588
|
_super.prototype["" + getVirtualData].call(this, data);
|
|
13977
14589
|
};
|
|
14590
|
+
/**
|
|
14591
|
+
* Initiates the beginning of an action within the tree grid component.
|
|
14592
|
+
* This method is invoked before any action is performed, allowing for
|
|
14593
|
+
* any necessary modifications or cancellations of the upcoming action.
|
|
14594
|
+
*
|
|
14595
|
+
* @param {NotifyArgs} args - The arguments associated with the action,
|
|
14596
|
+
* providing context and specifics about what is being commenced.
|
|
14597
|
+
* @returns {void}
|
|
14598
|
+
*/
|
|
14599
|
+
VirtualTreeContentRenderer.prototype.handleActionBegin = function (args) {
|
|
14600
|
+
var actionBegin = 'actionBegin';
|
|
14601
|
+
_super.prototype["" + actionBegin].call(this, args);
|
|
14602
|
+
};
|
|
14603
|
+
/**
|
|
14604
|
+
* Handles the completion of various actions, such as adding a new row.
|
|
14605
|
+
* Updates row positions and indexes based on the action completed.
|
|
14606
|
+
*
|
|
14607
|
+
* @param {NotifyArgs} args - An object containing the details of the completed action.
|
|
14608
|
+
* Specifically, it includes the `requestType` which determines the type
|
|
14609
|
+
* of action that was completed.
|
|
14610
|
+
* @returns {void} This method does not return any value.
|
|
14611
|
+
*/
|
|
13978
14612
|
VirtualTreeContentRenderer.prototype.onActionComplete = function (args) {
|
|
13979
14613
|
if (args.requestType === 'add') {
|
|
13980
14614
|
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
|
|
@@ -13986,6 +14620,19 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13986
14620
|
var actionComplete = 'actionComplete';
|
|
13987
14621
|
_super.prototype["" + actionComplete].call(this, args);
|
|
13988
14622
|
};
|
|
14623
|
+
/**
|
|
14624
|
+
* Creates a callback function to be executed during virtual scrolling actions.
|
|
14625
|
+
* This function handles the adjustment of virtual elements and rendering logic,
|
|
14626
|
+
* particularly optimizing for non-IE browsers, wheel events, and virtual masks.
|
|
14627
|
+
*
|
|
14628
|
+
* @returns {Function} A function that handles scrolling and adjusts table rendering.
|
|
14629
|
+
* @param {HTMLElement} element - The HTML element involved in the action.
|
|
14630
|
+
* @param {SentinelType} current - The type of sentinel indicating the scroll.
|
|
14631
|
+
* @param {string} direction - The scroll direction.
|
|
14632
|
+
* @param {Offsets} e - The offset values indicating the current scroll position.
|
|
14633
|
+
* @param {boolean} isWheel - Indicates if the scrolling was initiated by a mouse wheel.
|
|
14634
|
+
* @param {boolean} check - A boolean flag for additional control logic.
|
|
14635
|
+
*/
|
|
13989
14636
|
VirtualTreeContentRenderer.prototype.onEnteredAction = function () {
|
|
13990
14637
|
var _this = this;
|
|
13991
14638
|
return function (element, current, direction, e, isWheel, check) {
|
|
@@ -14028,8 +14675,17 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14028
14675
|
}
|
|
14029
14676
|
};
|
|
14030
14677
|
};
|
|
14678
|
+
/**
|
|
14679
|
+
* Handles scroll events to manage virtual scrolling and row rendering.
|
|
14680
|
+
* Adjusts view information, row indexes, and translates viewport positioning
|
|
14681
|
+
* based on the given scroll arguments.
|
|
14682
|
+
*
|
|
14683
|
+
* @param {ScrollArg} scrollArgs - Contains the scroll offsets, sentinel information, direction of scroll, and other related details.
|
|
14684
|
+
* @returns {void} - No return value. It adjusts scrolling state internally.
|
|
14685
|
+
*/
|
|
14031
14686
|
VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {
|
|
14032
14687
|
this['scrollAfterEdit']();
|
|
14688
|
+
this.shouldPreventScrolling(scrollArgs);
|
|
14033
14689
|
if (this.parent.root.enablePersistence) {
|
|
14034
14690
|
this.parent.root.scrollPosition = scrollArgs.offset;
|
|
14035
14691
|
}
|
|
@@ -14049,9 +14705,11 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14049
14705
|
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
|
|
14050
14706
|
var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
|
|
14051
14707
|
this.parent.element.getBoundingClientRect().height);
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14708
|
+
// Calculate the integer number of rows that are scrolled past plus the number of rows that fit within the visible height
|
|
14709
|
+
var scrolledRows = Math.floor(content.scrollTop / rowHeight);
|
|
14710
|
+
var visibleRows = Math.ceil(vHeight / rowHeight);
|
|
14711
|
+
// Calculate the index by subtracting the page size from the total rows taken into account
|
|
14712
|
+
var index = scrolledRows + visibleRows - this.parent.pageSettings.pageSize;
|
|
14055
14713
|
index = (index > 0) ? index : 0;
|
|
14056
14714
|
if (!isNullOrUndefined(this["" + selectedRowIndex]) && this["" + selectedRowIndex] !== -1 && index !== this["" + selectedRowIndex] &&
|
|
14057
14715
|
((this.parent.rowHeight * this.parent.pageSettings.pageSize) < content.scrollTop) && !this.parent.allowRowDragAndDrop) {
|
|
@@ -14128,20 +14786,19 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14128
14786
|
this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
|
|
14129
14787
|
this.startIndex = currentViewData[0]["" + indexValue] + (this.parent.pageSettings.pageSize / 2);
|
|
14130
14788
|
}
|
|
14131
|
-
if (this.parent.root.isSelfReference) {
|
|
14132
|
-
var selectedIndex = this.parent.root.selectedRowIndex;
|
|
14133
|
-
this.startIndex = selectedIndex !== -1 && selectedIndex !== this.startIndex ? this.startIndex - 1 : this.startIndex;
|
|
14134
|
-
}
|
|
14135
14789
|
if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
|
|
14136
14790
|
this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
|
|
14137
14791
|
}
|
|
14138
14792
|
else {
|
|
14139
14793
|
if (this.totalRecords === this.endIndex) {
|
|
14140
|
-
if (
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14794
|
+
if (this.totalRecords === this.endIndex) {
|
|
14795
|
+
if (this.parent.isEdit) {
|
|
14796
|
+
this.translateY = ((this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight))
|
|
14797
|
+
+ rowHeight;
|
|
14798
|
+
}
|
|
14799
|
+
else {
|
|
14800
|
+
this.translateY = (this.totalRecords * rowHeight) - (this.parent.pageSettings.pageSize * rowHeight);
|
|
14801
|
+
}
|
|
14145
14802
|
}
|
|
14146
14803
|
}
|
|
14147
14804
|
else {
|
|
@@ -14154,24 +14811,23 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14154
14811
|
}
|
|
14155
14812
|
}
|
|
14156
14813
|
}
|
|
14157
|
-
if (
|
|
14814
|
+
if (((downScroll && scrollArgs.direction !== 'up' && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
|
|
14158
14815
|
|| (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
|
|
14159
14816
|
((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
14160
14817
|
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
|
|
14161
14818
|
var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
|
|
14162
14819
|
this.previousInfo = viewInfo;
|
|
14163
|
-
if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
|
|
14820
|
+
if (this.prevInfo && viewInfo.event !== 'refresh-virtual-block' && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
|
|
14164
14821
|
|| ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
|
|
14165
14822
|
|| (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
|
|
14166
14823
|
&& this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
|
|
14167
14824
|
this.parent.removeMaskRow();
|
|
14168
|
-
this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });
|
|
14169
14825
|
if (Browser.isIE) {
|
|
14170
14826
|
this.parent.hideSpinner();
|
|
14171
14827
|
}
|
|
14172
14828
|
this.requestType = this.requestType === 'virtualscroll' ? this['empty'] : this.requestType;
|
|
14173
14829
|
if (info.axis === 'Y') {
|
|
14174
|
-
this
|
|
14830
|
+
this.restoreEditState();
|
|
14175
14831
|
}
|
|
14176
14832
|
return;
|
|
14177
14833
|
}
|
|
@@ -14199,9 +14855,32 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14199
14855
|
}
|
|
14200
14856
|
}
|
|
14201
14857
|
};
|
|
14858
|
+
/**
|
|
14859
|
+
* Prevents scrolling under specific conditions related to adding a new row.
|
|
14860
|
+
*
|
|
14861
|
+
* @param {ScrollArg} scrollArgs - The scroll event arguments containing offset details.
|
|
14862
|
+
* @returns {void}
|
|
14863
|
+
*/
|
|
14864
|
+
VirtualTreeContentRenderer.prototype.shouldPreventScrolling = function (scrollArgs) {
|
|
14865
|
+
var addedRow = this.parent.element.querySelector('.e-addedrow');
|
|
14866
|
+
if (addedRow && this.rowPosition !== 'Top' && this.rowPosition !== 'Bottom' && scrollArgs.offset.top !== 0) {
|
|
14867
|
+
this.parent.closeEdit();
|
|
14868
|
+
return;
|
|
14869
|
+
}
|
|
14870
|
+
};
|
|
14871
|
+
/**
|
|
14872
|
+
* Appends content to the target element. Handles dynamic adjustments for remote data sources,
|
|
14873
|
+
* frozen columns, and virtual scrolling.
|
|
14874
|
+
*
|
|
14875
|
+
* @param {HTMLElement} target - The target HTML element where content is to be appended.
|
|
14876
|
+
* @param {DocumentFragment} newChild - The new content as a DocumentFragment to append.
|
|
14877
|
+
* @param {NotifyArgs} e - Object containing information about the operation.
|
|
14878
|
+
* @returns {void}
|
|
14879
|
+
*/
|
|
14202
14880
|
VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {
|
|
14203
14881
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
14204
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
14882
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)
|
|
14883
|
+
|| (this.parent.isFrozenGrid() && (e.requestType === undefined || !isNullOrUndefined(e.virtualInfo) && (e.virtualInfo.direction === 'right' || e.virtualInfo.direction === 'left')))) {
|
|
14205
14884
|
if (getValue('isExpandCollapse', e)) {
|
|
14206
14885
|
this.isRemoteExpand = true;
|
|
14207
14886
|
}
|
|
@@ -14229,6 +14908,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14229
14908
|
target.appendChild(newChild);
|
|
14230
14909
|
var replace = 'replaceWith';
|
|
14231
14910
|
this.getTable().querySelector('tbody')["" + replace](target);
|
|
14911
|
+
if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'Y') {
|
|
14912
|
+
this.isExpandCollapse = false;
|
|
14913
|
+
}
|
|
14232
14914
|
if (!this.isExpandCollapse || this.translateY === 0) {
|
|
14233
14915
|
this.translateY = this.translateY < 0 ? 0 : this.translateY;
|
|
14234
14916
|
getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
|
|
@@ -14261,6 +14943,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14261
14943
|
_super.prototype["" + ensureSelectedRowPosition].call(this);
|
|
14262
14944
|
}
|
|
14263
14945
|
};
|
|
14946
|
+
/**
|
|
14947
|
+
* Unsubscribes all event listeners to prevent memory leaks.
|
|
14948
|
+
* This method is called when the component is being destroyed or when event listeners need to be cleaned up.
|
|
14949
|
+
*
|
|
14950
|
+
* @returns {void}
|
|
14951
|
+
*/
|
|
14264
14952
|
VirtualTreeContentRenderer.prototype.removeEventListener = function () {
|
|
14265
14953
|
if (this.parent.isDestroyed) {
|
|
14266
14954
|
return;
|
|
@@ -14281,6 +14969,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
14281
14969
|
this.parent.off('select-row-on-context-open', this.toSelectRowOnContextOpen);
|
|
14282
14970
|
this.parent.off('refresh-virtual-editform-cells', this.refreshCell);
|
|
14283
14971
|
this.parent.off('virtaul-cell-focus', this.cellFocus);
|
|
14972
|
+
this.parent.off('virtual-scroll-edit', this.restoreEditState);
|
|
14284
14973
|
};
|
|
14285
14974
|
return VirtualTreeContentRenderer;
|
|
14286
14975
|
}(VirtualContentRenderer));
|
|
@@ -14294,6 +14983,15 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
14294
14983
|
_this.timer = 0;
|
|
14295
14984
|
return _this;
|
|
14296
14985
|
}
|
|
14986
|
+
/**
|
|
14987
|
+
* Sets up observers to monitor scroll events on a given container
|
|
14988
|
+
* and its movable companion within a virtual grid setup.
|
|
14989
|
+
*
|
|
14990
|
+
* @param {Function} callback - Function to call when a scroll event is detected.
|
|
14991
|
+
* @param {Function} onEnterCallback - Function to call when a specific event, like entering a region, is detected.
|
|
14992
|
+
* @param {IGrid} instance - The grid instance that requires observation.
|
|
14993
|
+
* @returns {void}
|
|
14994
|
+
*/
|
|
14297
14995
|
TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback, instance) {
|
|
14298
14996
|
var containerRect = 'containerRect';
|
|
14299
14997
|
_super.prototype["" + containerRect] = getValue('options', this).container.getBoundingClientRect();
|
|
@@ -14304,9 +15002,23 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
|
|
|
14304
15002
|
EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback, instance), this);
|
|
14305
15003
|
}
|
|
14306
15004
|
};
|
|
15005
|
+
/**
|
|
15006
|
+
* Clears the last known position.
|
|
15007
|
+
*
|
|
15008
|
+
* @returns {void} No value is returned from this function.
|
|
15009
|
+
*/
|
|
14307
15010
|
TreeInterSectionObserver.prototype.clear = function () {
|
|
14308
15011
|
this.lastPos = null;
|
|
14309
15012
|
};
|
|
15013
|
+
/**
|
|
15014
|
+
* Handles virtual scrolling events and manages scroll direction and debouncing for rendering updates.
|
|
15015
|
+
*
|
|
15016
|
+
* @private
|
|
15017
|
+
* @param {Function} callback - Function to call on scroll end.
|
|
15018
|
+
* @param {Function} onEnterCallback - Function to call on entering a virtual scrolling area.
|
|
15019
|
+
* @param {IGrid} instance - The grid instance on which virtual scrolling is being implemented.
|
|
15020
|
+
* @returns {Function} - A function that processes scroll events.
|
|
15021
|
+
*/
|
|
14310
15022
|
TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback, instance) {
|
|
14311
15023
|
var _this = this;
|
|
14312
15024
|
var delay = Browser.info.name === 'chrome' ? 200 : 100;
|
|
@@ -14417,9 +15129,6 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14417
15129
|
Grid.Inject(TreeVirtual);
|
|
14418
15130
|
this.addEventListener();
|
|
14419
15131
|
}
|
|
14420
|
-
VirtualScroll.prototype.returnVisualData = function (args) {
|
|
14421
|
-
args.data = this.visualData;
|
|
14422
|
-
};
|
|
14423
15132
|
/**
|
|
14424
15133
|
* For internal use only - Get the module name.
|
|
14425
15134
|
*
|
|
@@ -14453,28 +15162,58 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14453
15162
|
this.parent.off(pagingActions, this.virtualPageAction);
|
|
14454
15163
|
this.parent.off(destroy, this.destroy);
|
|
14455
15164
|
};
|
|
15165
|
+
/**
|
|
15166
|
+
* Handles the virtual child collapse or expand action in a tree grid.
|
|
15167
|
+
*
|
|
15168
|
+
* @param {object} row - Object containing information about the collapse/expand action.
|
|
15169
|
+
* @param {string} row.action - The type of action, either "collapse" or "expand".
|
|
15170
|
+
* @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
|
|
15171
|
+
* @param {ITreeData} row.record - The tree data record associated with the row.
|
|
15172
|
+
* @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
|
|
15173
|
+
*
|
|
15174
|
+
* @returns {void} No return value as the function executes a procedure.
|
|
15175
|
+
*/
|
|
14456
15176
|
VirtualScroll.prototype.collapseExpandVirtualchilds = function (row) {
|
|
14457
15177
|
this.parent.grid.notify(virtualActionArgs, { isExpandCollapse: true });
|
|
14458
15178
|
this.expandCollapseRec = row.record;
|
|
14459
15179
|
row.record.expanded = row.action === 'collapse' ? false : true;
|
|
14460
|
-
|
|
15180
|
+
this.parent.flatData.map(function (e) { return e.expanded = e.uniqueID === row.record.uniqueID &&
|
|
15181
|
+
e.expanded !== row.record.expanded ? row.record.expanded : e.expanded; });
|
|
15182
|
+
var actionDetails = {
|
|
14461
15183
|
result: this.parent.flatData,
|
|
14462
15184
|
row: row.row,
|
|
14463
15185
|
action: row.action,
|
|
14464
15186
|
record: row.record,
|
|
14465
15187
|
count: this.parent.flatData.length
|
|
14466
15188
|
};
|
|
14467
|
-
|
|
14468
|
-
|
|
15189
|
+
this.handleSelection();
|
|
15190
|
+
var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
15191
|
+
getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: requestType });
|
|
15192
|
+
};
|
|
15193
|
+
/**
|
|
15194
|
+
* Handles selection logic for the TreeGrid component.
|
|
15195
|
+
*
|
|
15196
|
+
* @returns {void}
|
|
15197
|
+
*/
|
|
15198
|
+
VirtualScroll.prototype.handleSelection = function () {
|
|
15199
|
+
if ((this.parent.selectionSettings.mode === 'Cell' ||
|
|
15200
|
+
(this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection))) {
|
|
14469
15201
|
this.parent.grid.clearSelection();
|
|
14470
15202
|
}
|
|
14471
15203
|
if (getValue('isCollapseAll', this.parent) && this.parent.selectionSettings.persistSelection && this.parent.getSelectedRecords().length > 0) {
|
|
14472
15204
|
this.prevSelectedRecord = this.parent.getSelectedRecords();
|
|
14473
15205
|
this.parent.grid.clearSelection();
|
|
14474
15206
|
}
|
|
14475
|
-
var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
14476
|
-
getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
|
|
14477
15207
|
};
|
|
15208
|
+
/**
|
|
15209
|
+
* Handles the action related to virtual scrolling with paging details.
|
|
15210
|
+
*
|
|
15211
|
+
* @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
|
|
15212
|
+
* @param {ITreeData[]} pageingDetails.result - The result data to be handled.
|
|
15213
|
+
* @param {number} pageingDetails.count - The count of results.
|
|
15214
|
+
* @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
|
|
15215
|
+
* @returns {void}
|
|
15216
|
+
*/
|
|
14478
15217
|
VirtualScroll.prototype.virtualPageAction = function (pageingDetails) {
|
|
14479
15218
|
var _this = this;
|
|
14480
15219
|
var dm = new DataManager(pageingDetails.result);
|
|
@@ -14505,7 +15244,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14505
15244
|
if (requestType === 'filtering' || requestType === 'collapseAll' || requestType === 'searching' || (requestType === 'refresh' && getValue('isExpandAll', this.parent)) ||
|
|
14506
15245
|
(requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length && isNullOrUndefined(this.expandCollapseRec))) {
|
|
14507
15246
|
startIndex = 0;
|
|
14508
|
-
endIndex = this.parent.grid.pageSettings.pageSize
|
|
15247
|
+
endIndex = this.parent.grid.pageSettings.pageSize;
|
|
14509
15248
|
this.parent.grid.getContent().firstElementChild.scrollTop = 0;
|
|
14510
15249
|
this.parent.grid.notify(virtualActionArgs, { setTop: true });
|
|
14511
15250
|
}
|
|
@@ -14545,10 +15284,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14545
15284
|
sIndex = sIndex > 0 ? sIndex : 0;
|
|
14546
15285
|
endIndex = visualData.length;
|
|
14547
15286
|
if (endIndex - startIndex < resourceCount) {
|
|
14548
|
-
var newRowsCount = sIndex - startIndex;
|
|
14549
15287
|
startIndex = sIndex;
|
|
14550
15288
|
if (visualData.indexOf(this.expandCollapseRec) > visualData.length - resourceCount / 2) {
|
|
14551
|
-
var newTranslateY =
|
|
15289
|
+
var newTranslateY = startIndex * this.parent.grid.getRowHeight();
|
|
14552
15290
|
this.parent.grid.contentModule['translateY'] = newTranslateY;
|
|
14553
15291
|
this.parent.grid.contentModule.virtualEle.adjustTable(0, newTranslateY);
|
|
14554
15292
|
}
|
|
@@ -14571,7 +15309,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14571
15309
|
if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {
|
|
14572
15310
|
startIndex = 0;
|
|
14573
15311
|
}
|
|
14574
|
-
else if (!this.parent['isExpandAll']) {
|
|
15312
|
+
else if (!this.parent['isExpandAll'] && this.parent.grid.contentModule['translateY'] === 0) {
|
|
14575
15313
|
startIndex = this.prevstartIndex === -1 ? 0 : this.prevstartIndex;
|
|
14576
15314
|
}
|
|
14577
15315
|
}
|
|
@@ -14598,6 +15336,26 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14598
15336
|
VirtualScroll.prototype.destroy = function () {
|
|
14599
15337
|
this.removeEventListener();
|
|
14600
15338
|
};
|
|
15339
|
+
/**
|
|
15340
|
+
* Updates the row selection when the header checkbox is clicked and the number of selected rows
|
|
15341
|
+
* does not match the current view data length.
|
|
15342
|
+
*
|
|
15343
|
+
* @param {RowDeselectEventArgs} args - The arguments containing details of the row deselection event.
|
|
15344
|
+
* @returns {void} - This method does not return a value.
|
|
15345
|
+
*/
|
|
15346
|
+
VirtualScroll.prototype.updateSelection = function (args) {
|
|
15347
|
+
if (args.isHeaderCheckboxClicked &&
|
|
15348
|
+
this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length) {
|
|
15349
|
+
var updateRowSelection = 'updateRowSelection';
|
|
15350
|
+
for (var i = 0; i < this.parent.getRows().length; i++) {
|
|
15351
|
+
if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
15352
|
+
this.parent.grid.selectionModule["" + updateRowSelection](this.parent.getRows()[parseInt(i.toString(), 10)],
|
|
15353
|
+
// eslint-disable-next-line max-len
|
|
15354
|
+
this.parent.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
|
|
15355
|
+
}
|
|
15356
|
+
}
|
|
15357
|
+
}
|
|
15358
|
+
};
|
|
14601
15359
|
return VirtualScroll;
|
|
14602
15360
|
}());
|
|
14603
15361
|
var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
|
|
@@ -15096,5 +15854,5 @@ var InfiniteScroll = /** @__PURE__ @class */ (function () {
|
|
|
15096
15854
|
return InfiniteScroll;
|
|
15097
15855
|
}());
|
|
15098
15856
|
|
|
15099
|
-
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,
|
|
15857
|
+
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 };
|
|
15100
15858
|
//# sourceMappingURL=ej2-treegrid.es5.js.map
|