@syncfusion/ej2-treegrid 21.2.5 → 21.2.8
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/CHANGELOG.md +18 -0
- 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 +34 -8
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +34 -8
- 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 +7 -7
- package/src/treegrid/actions/edit.js +1 -1
- package/src/treegrid/actions/virtual-scroll.js +1 -1
- package/src/treegrid/base/data.js +17 -1
- package/src/treegrid/base/treegrid-model.d.ts +3 -0
- package/src/treegrid/base/treegrid.d.ts +3 -0
- package/src/treegrid/base/treegrid.js +10 -3
- package/src/treegrid/enum.d.ts +2 -0
- package/src/treegrid/models/filter-settings-model.d.ts +1 -0
- package/src/treegrid/models/filter-settings.d.ts +1 -0
- package/src/treegrid/models/selection-settings-model.d.ts +2 -0
- package/src/treegrid/models/selection-settings.d.ts +2 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +5 -2
|
@@ -2334,7 +2334,18 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
result = resultChildData;
|
|
2336
2336
|
}
|
|
2337
|
-
|
|
2337
|
+
if (_this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
2338
|
+
rowDetails.record.childRecords = [];
|
|
2339
|
+
for (var i = 0; i < result.length; i++) {
|
|
2340
|
+
if (rowDetails.record['' + _this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + _this.parent.idMapping] &&
|
|
2341
|
+
rowDetails.record['' + _this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
|
|
2342
|
+
rowDetails.record.childRecords.push(result[parseInt(i.toString(), 10)]);
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
else {
|
|
2347
|
+
rowDetails.record.childRecords = result;
|
|
2348
|
+
}
|
|
2338
2349
|
for (var r = 0; r < result.length; r++) {
|
|
2339
2350
|
if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
|
|
2340
2351
|
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
@@ -2352,6 +2363,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2352
2363
|
if (result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
2353
2364
|
result[parseInt(r.toString(), 10)].level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
|
|
2354
2365
|
var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
|
|
2366
|
+
delete parentData.childRecords;
|
|
2355
2367
|
result[parseInt(r.toString(), 10)].parentItem = parentData;
|
|
2356
2368
|
result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
|
|
2357
2369
|
}
|
|
@@ -2363,6 +2375,10 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
|
|
|
2363
2375
|
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
2364
2376
|
if (isNullOrUndefined(result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping])) {
|
|
2365
2377
|
result[parseInt(r.toString(), 10)].level = 0;
|
|
2378
|
+
if (rowDetails.action === 'remoteExpand') {
|
|
2379
|
+
result[parseInt(r.toString(), 10)].childRecords = [];
|
|
2380
|
+
result[parseInt(r.toString(), 10)].childRecords = rowDetails.record.childRecords;
|
|
2381
|
+
}
|
|
2366
2382
|
}
|
|
2367
2383
|
else {
|
|
2368
2384
|
result[parseInt(r.toString(), 10)].level = rowDetails.record.level;
|
|
@@ -6174,7 +6190,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6174
6190
|
record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
|
|
6175
6191
|
}
|
|
6176
6192
|
else {
|
|
6177
|
-
|
|
6193
|
+
if (this.enableVirtualization && this.isCollapseAll) {
|
|
6194
|
+
record = this.grid.getCurrentViewRecords()[row.rowIndex];
|
|
6195
|
+
}
|
|
6196
|
+
else {
|
|
6197
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
6198
|
+
}
|
|
6178
6199
|
}
|
|
6179
6200
|
}
|
|
6180
6201
|
return record;
|
|
@@ -6404,7 +6425,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6404
6425
|
if (rows.length) {
|
|
6405
6426
|
for (var i = 0; i < rows.length; i++) {
|
|
6406
6427
|
if (action === 'collapse') {
|
|
6407
|
-
this.
|
|
6428
|
+
if (!isNullOrUndefined(this.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex])) {
|
|
6429
|
+
this.collapseRow(rows[parseInt(i.toString(), 10)]);
|
|
6430
|
+
}
|
|
6408
6431
|
}
|
|
6409
6432
|
else {
|
|
6410
6433
|
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
@@ -6852,7 +6875,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
|
|
|
6852
6875
|
}
|
|
6853
6876
|
}
|
|
6854
6877
|
if (cRow.length && childRecord.expanded) {
|
|
6855
|
-
this.collapseRemoteChild({ record: childRecord, rows: cRow },
|
|
6878
|
+
this.collapseRemoteChild({ record: childRecord, rows: cRow }, false);
|
|
6856
6879
|
}
|
|
6857
6880
|
}
|
|
6858
6881
|
}
|
|
@@ -12074,7 +12097,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
|
|
|
12074
12097
|
index = index + batchChildCount;
|
|
12075
12098
|
}
|
|
12076
12099
|
}
|
|
12077
|
-
else {
|
|
12100
|
+
else if (!this.parent.enableVirtualization) {
|
|
12078
12101
|
index += findChildrenRecords(records[parseInt(index.toString(), 10)]).length;
|
|
12079
12102
|
}
|
|
12080
12103
|
}
|
|
@@ -13045,7 +13068,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13045
13068
|
this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
|
|
13046
13069
|
}
|
|
13047
13070
|
if (currentViewData.length && (currentViewData[0]["" + indexValue] >= this.parent.pageSettings.pageSize / 2) &&
|
|
13048
|
-
((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
|
|
13071
|
+
((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
|
|
13049
13072
|
this.startIndex = currentViewData[0]["" + indexValue] - (this.parent.pageSettings.pageSize / 2);
|
|
13050
13073
|
this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
|
|
13051
13074
|
}
|
|
@@ -13086,8 +13109,11 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
|
|
|
13086
13109
|
}
|
|
13087
13110
|
this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
|
|
13088
13111
|
this.endIndex = lastIndex;
|
|
13112
|
+
if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords && (this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
|
|
13113
|
+
this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
|
|
13114
|
+
}
|
|
13089
13115
|
if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
|
|
13090
|
-
((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2))) {
|
|
13116
|
+
((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
|
|
13091
13117
|
this.startIndex = currentViewData[0]["" + indexValue] + (this.parent.pageSettings.pageSize / 2);
|
|
13092
13118
|
}
|
|
13093
13119
|
if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
|
|
@@ -13438,7 +13464,7 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
|
|
|
13438
13464
|
this.parent.grid.getContent().firstElementChild.scrollTop = 0;
|
|
13439
13465
|
this.parent.grid.notify(virtualActionArgs, { setTop: true });
|
|
13440
13466
|
}
|
|
13441
|
-
if (requestType === 'save'
|
|
13467
|
+
if (requestType === 'save') {
|
|
13442
13468
|
endIndex = counts.count;
|
|
13443
13469
|
}
|
|
13444
13470
|
//if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
|