@syncfusion/ej2-treegrid 33.1.46 → 33.1.49
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/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 +77 -77
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +77 -81
- 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 +2 -2
- package/src/treegrid/actions/filter.js +0 -20
- package/src/treegrid/actions/rowdragdrop.js +42 -29
- package/src/treegrid/actions/virtual-scroll.d.ts +1 -0
- package/src/treegrid/actions/virtual-scroll.js +34 -23
- package/src/treegrid/renderer/render.js +0 -10
- package/src/treegrid/renderer/virtual-tree-content-render.js +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 33.1.
|
|
3
|
+
* version : 33.1.49
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-treegrid",
|
|
3
|
-
"version": "33.1.
|
|
3
|
+
"version": "33.1.49",
|
|
4
4
|
"description": "Essential JS 2 TreeGrid Component",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@syncfusion/ej2-base": "~33.1.45",
|
|
12
12
|
"@syncfusion/ej2-data": "~33.1.45",
|
|
13
|
-
"@syncfusion/ej2-grids": "~33.1.
|
|
13
|
+
"@syncfusion/ej2-grids": "~33.1.49",
|
|
14
14
|
"@syncfusion/ej2-popups": "~33.1.44"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getObject, Filter as GridFilter, Grid } from '@syncfusion/ej2-grids';
|
|
2
2
|
import { isNullOrUndefined, setValue, getValue } from '@syncfusion/ej2-base';
|
|
3
|
-
import { getExpandStatus } from '../utils';
|
|
4
3
|
import { getParentData } from '../utils';
|
|
5
4
|
/**
|
|
6
5
|
* TreeGrid Filter module will handle filtering action
|
|
@@ -98,25 +97,6 @@ var Filter = /** @class */ (function () {
|
|
|
98
97
|
if (this.flatFilteredData.length > 0 && this.isHierarchyFilter) {
|
|
99
98
|
this.updateFilterLevel();
|
|
100
99
|
}
|
|
101
|
-
var _loop_1 = function (i) {
|
|
102
|
-
var record = this_1.filteredResult[parseInt(i.toString(), 10)];
|
|
103
|
-
if (!isNullOrUndefined(record.parentItem)) {
|
|
104
|
-
var parentUID_1 = record.parentItem.uniqueID;
|
|
105
|
-
var parentPresent = this_1.filteredResult.some(function (r) {
|
|
106
|
-
return !isNullOrUndefined(r.uniqueID) && r.uniqueID === parentUID_1;
|
|
107
|
-
});
|
|
108
|
-
if (parentPresent) {
|
|
109
|
-
record.isCollapsedChild = !getExpandStatus(this_1.parent, record, this_1.parent.parentData);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
record.isCollapsedChild = false;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
var this_1 = this;
|
|
117
|
-
for (var i = 0; i < this.filteredResult.length; i++) {
|
|
118
|
-
_loop_1(i);
|
|
119
|
-
}
|
|
120
100
|
this.parent.notify('updateAction', { result: this.filteredResult });
|
|
121
101
|
};
|
|
122
102
|
Filter.prototype.updateParentFilteredRecord = function (record) {
|
|
@@ -576,7 +576,7 @@ var RowDD = /** @class */ (function () {
|
|
|
576
576
|
this.removeLastrowBorder(rowEle);
|
|
577
577
|
for (var i = 0; i < args.rows.length; i++) {
|
|
578
578
|
if (!isNullOrUndefined(rowEle) && rowEle.getAttribute('data-uid') === args.rows[parseInt(i.toString(), 10)].getAttribute('data-uid')
|
|
579
|
-
|| !parentsUntil(args.target, 'e-gridcontent')) {
|
|
579
|
+
|| !parentsUntil(args.target, 'e-gridcontent') || rowEle.classList.contains('e-summaryrow')) {
|
|
580
580
|
this.dropPosition = 'Invalid';
|
|
581
581
|
this.addErrorElem();
|
|
582
582
|
if (isNullOrUndefined(this.parent.rowDropSettings.targetID)) {
|
|
@@ -1088,8 +1088,10 @@ var RowDD = /** @class */ (function () {
|
|
|
1088
1088
|
RowDD.prototype.rowDropped = function (args) {
|
|
1089
1089
|
if (!isNullOrUndefined(this.parent.aggregates[0]) && this.parent.aggregates[0].showChildSummary) {
|
|
1090
1090
|
var records = this.parent.grid.getCurrentViewRecords();
|
|
1091
|
-
args.fromIndex
|
|
1092
|
-
|
|
1091
|
+
if (!isNullOrUndefined(records[records[args.fromIndex].index]) && !isNullOrUndefined(records[records[args.dropIndex].index])) {
|
|
1092
|
+
args.fromIndex = records[args.fromIndex].index;
|
|
1093
|
+
args.dropIndex = records[args.dropIndex].index;
|
|
1094
|
+
}
|
|
1093
1095
|
}
|
|
1094
1096
|
var tObj = this.parent;
|
|
1095
1097
|
var parentItem = 'parentItem';
|
|
@@ -1614,14 +1616,16 @@ var RowDD = /** @class */ (function () {
|
|
|
1614
1616
|
else {
|
|
1615
1617
|
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1616
1618
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1619
|
+
if (!isNullOrUndefined(currentRecord)) {
|
|
1620
|
+
count++;
|
|
1621
|
+
tObj.flatData.splice(count, 0, currentRecord);
|
|
1622
|
+
setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);
|
|
1623
|
+
if (tObj.parentIdMapping) {
|
|
1624
|
+
this.treeData.splice(count, 0, currentRecord.taskData);
|
|
1625
|
+
}
|
|
1626
|
+
if (currentRecord.hasChildRecords) {
|
|
1627
|
+
count = this.updateChildRecord(currentRecord, count);
|
|
1628
|
+
}
|
|
1625
1629
|
}
|
|
1626
1630
|
}
|
|
1627
1631
|
return count;
|
|
@@ -1648,17 +1652,19 @@ var RowDD = /** @class */ (function () {
|
|
|
1648
1652
|
else {
|
|
1649
1653
|
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1650
1654
|
}
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
parentData
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1655
|
+
if (!isNullOrUndefined(currentRecord)) {
|
|
1656
|
+
var parentData = void 0;
|
|
1657
|
+
if (record.parentItem) {
|
|
1658
|
+
parentData = getParentData(this.parent, record.parentItem.uniqueID);
|
|
1659
|
+
}
|
|
1660
|
+
if (isNullOrUndefined(parentData) && !isNullOrUndefined(record.parentItem)) {
|
|
1661
|
+
parentData = record.parentItem;
|
|
1662
|
+
}
|
|
1663
|
+
currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;
|
|
1664
|
+
if (currentRecord.hasChildRecords) {
|
|
1665
|
+
level--;
|
|
1666
|
+
level = this.updateChildRecordLevel(currentRecord, level);
|
|
1667
|
+
}
|
|
1662
1668
|
}
|
|
1663
1669
|
}
|
|
1664
1670
|
return level;
|
|
@@ -1788,22 +1794,29 @@ var RowDD = /** @class */ (function () {
|
|
|
1788
1794
|
treeGridData = this.parent.dataSource;
|
|
1789
1795
|
}
|
|
1790
1796
|
for (var i_2 = 0; i_2 < treeGridData.length; i_2++) {
|
|
1791
|
-
if (
|
|
1792
|
-
|
|
1797
|
+
if (!isNullOrUndefined(currentRecord.taskData)) {
|
|
1798
|
+
if (treeGridData[parseInt(i_2.toString(), 10)][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {
|
|
1799
|
+
idx = i_2;
|
|
1800
|
+
break;
|
|
1801
|
+
}
|
|
1793
1802
|
}
|
|
1794
1803
|
}
|
|
1795
1804
|
for (var i_3 = 0; i_3 < this.treeGridData.length; i_3++) {
|
|
1796
|
-
if (
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1805
|
+
if (!isNullOrUndefined(currentRecord.taskData)) {
|
|
1806
|
+
if (this.treeGridData[parseInt(i_3.toString(), 10)][this.parent.idMapping]
|
|
1807
|
+
=== currentRecord.taskData[this.parent.idMapping]) {
|
|
1808
|
+
idz = i_3;
|
|
1809
|
+
break;
|
|
1810
|
+
}
|
|
1800
1811
|
}
|
|
1801
1812
|
}
|
|
1802
1813
|
if (idx !== -1 && !isNullOrUndefined(idx)) {
|
|
1803
1814
|
dataSource.splice(idx, 1);
|
|
1815
|
+
idx = -1;
|
|
1804
1816
|
}
|
|
1805
1817
|
if (idz !== -1 && !isNullOrUndefined(idz)) {
|
|
1806
1818
|
this.treeGridData.splice(idz, 1);
|
|
1819
|
+
idz = -1;
|
|
1807
1820
|
}
|
|
1808
1821
|
if (currentRecord.hasChildRecords) {
|
|
1809
1822
|
this.removeChildItem(currentRecord);
|
|
@@ -1824,7 +1837,7 @@ var RowDD = /** @class */ (function () {
|
|
|
1824
1837
|
}
|
|
1825
1838
|
for (var i = 0; i < record.childRecords.length; i++) {
|
|
1826
1839
|
currentRecord = record.childRecords[parseInt(i.toString(), 10)];
|
|
1827
|
-
count
|
|
1840
|
+
count = currentRecord.isSummaryRow ? count : count + 1;
|
|
1828
1841
|
if (currentRecord.hasChildRecords) {
|
|
1829
1842
|
count = this.getChildCount(currentRecord, count);
|
|
1830
1843
|
}
|
|
@@ -135,7 +135,13 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
135
135
|
var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
|
|
136
136
|
this.parent.filterSettings.hierarchyMode === 'None';
|
|
137
137
|
var visualData = isFiltering && isFlatHierarchy
|
|
138
|
-
? parents
|
|
138
|
+
? parents.filter(function (e) {
|
|
139
|
+
if (isNullOrUndefined(e.parentItem)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
var hasParentInFilteredList = parents.some(function (p) { return p.uniqueID === e.parentItem.uniqueID; });
|
|
143
|
+
return hasParentInFilteredList ? getExpandStatus(_this.parent, e, parents) : true;
|
|
144
|
+
})
|
|
139
145
|
: parents.filter(function (e) { return getExpandStatus(_this.parent, e, parents); });
|
|
140
146
|
this.visualData = visualData;
|
|
141
147
|
pageingDetails.count = visualData.length;
|
|
@@ -191,28 +197,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
191
197
|
endIndex = startIndex + this.parent.grid.pageSettings.pageSize;
|
|
192
198
|
}
|
|
193
199
|
if (!isNullOrUndefined(this.expandCollapseRec)) {
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (tempdata.length < resourceCount && sIndex >= 0 && startIndex !== 0) {
|
|
198
|
-
sIndex = visualData.length - resourceCount;
|
|
199
|
-
sIndex = sIndex > 0 ? sIndex : 0;
|
|
200
|
-
endIndex = visualData.length;
|
|
201
|
-
if (endIndex - startIndex < resourceCount) {
|
|
202
|
-
var newRowsCount = sIndex - startIndex;
|
|
203
|
-
startIndex = sIndex;
|
|
204
|
-
if (visualData.indexOf(this.expandCollapseRec) > visualData.length - resourceCount / 2) {
|
|
205
|
-
var newTranslateY = startIndex * this.parent.grid.getRowHeight();
|
|
206
|
-
this.parent.grid.contentModule['translateY'] = newTranslateY;
|
|
207
|
-
this.parent.grid.contentModule.virtualEle.adjustTable(0, newTranslateY);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
else if (getValue('isCollapseAll', this.parent)) {
|
|
212
|
-
startIndex = 0;
|
|
213
|
-
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|
|
214
|
-
this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
|
|
215
|
-
}
|
|
200
|
+
var result = this.adjustRangeForExpandCollapse(startIndex, endIndex, visualData);
|
|
201
|
+
startIndex = result.startIndex;
|
|
202
|
+
endIndex = result.endIndex;
|
|
216
203
|
}
|
|
217
204
|
//}
|
|
218
205
|
if (this.prevrequestType === 'collapseAll' && pageingDetails.actionArgs.requestType === 'virtualscroll'
|
|
@@ -243,6 +230,30 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
243
230
|
}
|
|
244
231
|
this.parent.notify('updateAction', pageingDetails);
|
|
245
232
|
};
|
|
233
|
+
VirtualScroll.prototype.adjustRangeForExpandCollapse = function (startIndex, endIndex, visualData) {
|
|
234
|
+
var pageSize = this.parent.grid.pageSettings.pageSize;
|
|
235
|
+
var expandedRecordIndex = visualData.indexOf(this.expandCollapseRec);
|
|
236
|
+
var pageWindowRecords = visualData.slice(expandedRecordIndex, expandedRecordIndex + pageSize);
|
|
237
|
+
if (pageWindowRecords.length < pageSize && expandedRecordIndex >= 0 && startIndex !== 0) {
|
|
238
|
+
var startForLastPage = visualData.length - pageSize;
|
|
239
|
+
startForLastPage = startForLastPage > 0 ? startForLastPage : 0;
|
|
240
|
+
endIndex = visualData.length;
|
|
241
|
+
if (endIndex - startIndex < pageSize) {
|
|
242
|
+
startIndex = startForLastPage;
|
|
243
|
+
if (expandedRecordIndex > visualData.length - pageSize / 2) {
|
|
244
|
+
var viewportTranslateY = startIndex * this.parent.grid.getRowHeight();
|
|
245
|
+
this.parent.grid.contentModule['translateY'] = viewportTranslateY;
|
|
246
|
+
this.parent.grid.contentModule.virtualEle.adjustTable(0, viewportTranslateY);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
else if (getValue('isCollapseAll', this.parent)) {
|
|
251
|
+
startIndex = 0;
|
|
252
|
+
endIndex = this.parent.grid.pageSettings.pageSize - 1;
|
|
253
|
+
this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
|
|
254
|
+
}
|
|
255
|
+
return { startIndex: startIndex, endIndex: endIndex };
|
|
256
|
+
};
|
|
246
257
|
/**
|
|
247
258
|
* To destroy the virtualScroll module
|
|
248
259
|
*
|
|
@@ -32,16 +32,6 @@ var Render = /** @class */ (function () {
|
|
|
32
32
|
}
|
|
33
33
|
var data = args.data;
|
|
34
34
|
var parentData = data.parentItem;
|
|
35
|
-
if (!isNullOrUndefined(parentData) && data.isCollapsedChild && !isNullOrUndefined(args.row)) {
|
|
36
|
-
this.parent['toggleRowVisibility'](args.row, 'e-childrow-hidden');
|
|
37
|
-
var rowsObj = this.parent.grid.getRowsObject();
|
|
38
|
-
if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
|
|
39
|
-
var row = rowsObj.filter(function (e) { return e.uid === args.row.getAttribute('data-uid'); })[0];
|
|
40
|
-
if (row) {
|
|
41
|
-
row.visible = false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
35
|
if (!isNullOrUndefined(data.parentItem) && !isFilterChildHierarchy(this.parent) &&
|
|
46
36
|
(!(this.parent.allowPaging && !(this.parent.pageSettings.pageSizeMode === 'Root')) ||
|
|
47
37
|
(isRemoteData(this.parent) && !isOffline(this.parent)))) {
|
|
@@ -713,7 +713,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
713
713
|
this.parent.root.scrollPosition = scrollArgs.offset;
|
|
714
714
|
}
|
|
715
715
|
var info = scrollArgs.sentinel;
|
|
716
|
-
var rowHeight = this.parent.getRowHeight();
|
|
716
|
+
var rowHeight = parseInt(this.parent.getRowHeight().toString(), 10);
|
|
717
717
|
var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
|
|
718
718
|
var content;
|
|
719
719
|
if (!isNullOrUndefined(this.parent.contentModule)) {
|