@syncfusion/ej2-treegrid 29.2.8 → 30.1.38
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/.eslintrc.json +2 -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 +254 -140
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +314 -169
- 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 +5 -5
- package/src/treegrid/actions/batch-edit.d.ts +1 -0
- package/src/treegrid/actions/batch-edit.js +57 -29
- package/src/treegrid/actions/clipboard.js +5 -8
- package/src/treegrid/actions/crud-actions.js +3 -1
- package/src/treegrid/actions/detail-row.js +7 -8
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +26 -11
- package/src/treegrid/actions/filter.js +2 -5
- package/src/treegrid/actions/rowdragdrop.js +7 -13
- package/src/treegrid/actions/selection.js +7 -0
- package/src/treegrid/actions/summary.js +2 -16
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +34 -14
- package/src/treegrid/base/treegrid-model.d.ts +7 -0
- package/src/treegrid/base/treegrid.d.ts +7 -0
- package/src/treegrid/base/treegrid.js +86 -52
- package/src/treegrid/renderer/virtual-row-model-generator.js +13 -5
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +64 -6
- package/styles/bds-lite.css +30 -0
- package/styles/bds.css +30 -0
- package/styles/bootstrap-dark-lite.css +30 -0
- package/styles/bootstrap-dark.css +30 -0
- package/styles/bootstrap-lite.css +30 -0
- package/styles/bootstrap.css +30 -0
- package/styles/bootstrap4-lite.css +30 -0
- package/styles/bootstrap4.css +30 -0
- package/styles/bootstrap5-dark-lite.css +30 -0
- package/styles/bootstrap5-dark.css +30 -0
- package/styles/bootstrap5-lite.css +30 -0
- package/styles/bootstrap5.3-lite.css +30 -0
- package/styles/bootstrap5.3.css +30 -0
- package/styles/bootstrap5.css +30 -0
- package/styles/fabric-dark-lite.css +30 -0
- package/styles/fabric-dark.css +30 -0
- package/styles/fabric-lite.css +30 -0
- package/styles/fabric.css +30 -0
- package/styles/fluent-dark-lite.css +30 -0
- package/styles/fluent-dark.css +30 -0
- package/styles/fluent-lite.css +30 -0
- package/styles/fluent.css +30 -0
- package/styles/fluent2-lite.css +30 -0
- package/styles/fluent2.css +30 -3
- package/styles/highcontrast-light-lite.css +30 -0
- package/styles/highcontrast-light.css +30 -0
- package/styles/highcontrast-lite.css +30 -0
- package/styles/highcontrast.css +30 -0
- package/styles/material-dark-lite.css +30 -0
- package/styles/material-dark.css +30 -0
- package/styles/material-lite.css +30 -0
- package/styles/material.css +30 -0
- package/styles/material3-dark-lite.css +30 -0
- package/styles/material3-dark.css +30 -0
- package/styles/material3-lite.css +30 -0
- package/styles/material3.css +30 -0
- package/styles/tailwind-dark-lite.css +30 -0
- package/styles/tailwind-dark.css +30 -0
- package/styles/tailwind-lite.css +30 -0
- package/styles/tailwind.css +30 -0
- package/styles/tailwind3-lite.css +30 -0
- package/styles/tailwind3.css +30 -0
- package/styles/treegrid/_bigger.scss +66 -66
- package/styles/treegrid/_layout.scss +39 -0
- package/styles/treegrid/bds.css +30 -0
- package/styles/treegrid/bootstrap-dark.css +30 -0
- package/styles/treegrid/bootstrap.css +30 -0
- package/styles/treegrid/bootstrap4.css +30 -0
- package/styles/treegrid/bootstrap5-dark.css +30 -0
- package/styles/treegrid/bootstrap5.3.css +30 -0
- package/styles/treegrid/bootstrap5.css +30 -0
- package/styles/treegrid/fabric-dark.css +30 -0
- package/styles/treegrid/fabric.css +30 -0
- package/styles/treegrid/fluent-dark.css +30 -0
- package/styles/treegrid/fluent.css +30 -0
- package/styles/treegrid/fluent2.css +30 -3
- package/styles/treegrid/highcontrast-light.css +30 -0
- package/styles/treegrid/highcontrast.css +30 -0
- package/styles/treegrid/material-dark.css +30 -0
- package/styles/treegrid/material.css +30 -0
- package/styles/treegrid/material3-dark.css +30 -0
- package/styles/treegrid/material3.css +30 -0
- package/styles/treegrid/tailwind-dark.css +30 -0
- package/styles/treegrid/tailwind.css +30 -0
- package/styles/treegrid/tailwind3.css +30 -0
|
@@ -247,6 +247,15 @@ var DataManipulation = /** @class */ (function () {
|
|
|
247
247
|
if (parentRec) {
|
|
248
248
|
records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
|
|
249
249
|
}
|
|
250
|
+
else {
|
|
251
|
+
var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + _this.parent.idMapping] === parentID_1; });
|
|
252
|
+
if (isNullOrUndefined(parentRec_1["" + this_1.parent.parentIdMapping])) {
|
|
253
|
+
records[parseInt(rec.toString(), 10)].level = 1;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
records[parseInt(rec.toString(), 10)].level = parentRec_1.level + 1;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
250
259
|
}
|
|
251
260
|
else {
|
|
252
261
|
records[parseInt(rec.toString(), 10)].level = 0;
|
|
@@ -348,33 +357,33 @@ var DataManipulation = /** @class */ (function () {
|
|
|
348
357
|
var _this = this;
|
|
349
358
|
var args = { row: rowDetails.parentRow, data: rowDetails.record };
|
|
350
359
|
var dm = this.parent.dataSource;
|
|
351
|
-
var
|
|
352
|
-
var clonequries =
|
|
353
|
-
|
|
354
|
-
|
|
360
|
+
var query = this.parent.grid.getDataModule().generateQuery();
|
|
361
|
+
var clonequries = query.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
|
|
362
|
+
query.queries = clonequries;
|
|
363
|
+
query.isCountRequired = true;
|
|
355
364
|
var idMappingValue = parseInt(rowDetails.record[this.parent.idMapping], 10);
|
|
356
365
|
if (isNaN(idMappingValue)) {
|
|
357
366
|
idMappingValue = rowDetails.record[this.parent.idMapping].toString();
|
|
358
367
|
}
|
|
359
368
|
if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
360
|
-
|
|
369
|
+
query.take(this.parent.grid.pageSettings.pageSize);
|
|
361
370
|
var expandDetail = [];
|
|
362
371
|
expandDetail.push('ExpandingAction', idMappingValue.toString());
|
|
363
|
-
|
|
372
|
+
query.expand(expandDetail);
|
|
364
373
|
}
|
|
365
374
|
else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
|
|
366
|
-
|
|
375
|
+
query.take(this.parent.grid.pageSettings.pageSize);
|
|
367
376
|
var expandDetail = [];
|
|
368
377
|
expandDetail.push('CollapsingAction', idMappingValue.toString());
|
|
369
|
-
|
|
378
|
+
query.expand(expandDetail);
|
|
370
379
|
}
|
|
371
|
-
|
|
380
|
+
query.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
|
|
372
381
|
if (rowDetails.action === 'remoteExpand' && this.parent.grid.filterSettings && this.parent.grid.filterSettings.columns.length) {
|
|
373
382
|
var filterqry = this.parent.grid.getDataModule().generateQuery().queries.filter(function (e) { return e.fn !== 'onPage' && typeof e.e.predicates !== 'undefined'; });
|
|
374
|
-
|
|
383
|
+
query.queries.push(filterqry[0]);
|
|
375
384
|
}
|
|
376
385
|
showSpinner(this.parent.element);
|
|
377
|
-
dm.executeQuery(
|
|
386
|
+
dm.executeQuery(query).then(function (e) {
|
|
378
387
|
var remoteExpandedData = 'remoteExpandedData';
|
|
379
388
|
var remoteCollapsedData = 'remoteCollapsedData';
|
|
380
389
|
var level = 'level';
|
|
@@ -437,7 +446,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
437
446
|
else {
|
|
438
447
|
rowDetails.record.childRecords = result;
|
|
439
448
|
}
|
|
440
|
-
|
|
449
|
+
var _loop_2 = function (r) {
|
|
441
450
|
var record = result[parseInt(r.toString(), 10)];
|
|
442
451
|
if (_this.parent.enableVirtualization && record["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
|
|
443
452
|
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
@@ -547,8 +556,18 @@ var DataManipulation = /** @class */ (function () {
|
|
|
547
556
|
record.expanded = false;
|
|
548
557
|
}
|
|
549
558
|
}
|
|
550
|
-
datas.
|
|
559
|
+
var exists = datas.some(function (data) { return data["" + _this.parent.idMapping] === record[_this.parent.idMapping]; });
|
|
560
|
+
if (!exists) {
|
|
561
|
+
datas.splice(inx + r + 1, 0, record);
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
for (var r = 0; r < result.length; r++) {
|
|
565
|
+
_loop_2(r);
|
|
551
566
|
}
|
|
567
|
+
var localIdMapping = _this.parent.idMapping;
|
|
568
|
+
datas.sort(function (firstRecord, secondRecord) {
|
|
569
|
+
return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
|
|
570
|
+
});
|
|
552
571
|
setValue('result', datas, e);
|
|
553
572
|
setValue('action', 'beforecontentrender', e);
|
|
554
573
|
_this.parent.trigger(events.actionComplete, e);
|
|
@@ -591,7 +610,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
591
610
|
var contentModule = getValue('grid.contentModule', this.parent);
|
|
592
611
|
var currentInfo = getValue('currentInfo', contentModule);
|
|
593
612
|
var prevInfo = getValue('prevInfo', contentModule);
|
|
594
|
-
if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
|
|
613
|
+
if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page
|
|
614
|
+
&& !this.parent.loadChildOnDemand) {
|
|
595
615
|
this.parent.grid.pageSettings.currentPage = prevInfo.page;
|
|
596
616
|
}
|
|
597
617
|
};
|
|
@@ -481,6 +481,13 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
481
481
|
*/
|
|
482
482
|
enableImmutableMode?: boolean;
|
|
483
483
|
|
|
484
|
+
/**
|
|
485
|
+
* Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
|
|
486
|
+
*
|
|
487
|
+
* @default false
|
|
488
|
+
*/
|
|
489
|
+
enableStickyHeader?: boolean;
|
|
490
|
+
|
|
484
491
|
/**
|
|
485
492
|
* Defines the scrollable height of the TreeGrid content.
|
|
486
493
|
*
|
|
@@ -615,6 +615,12 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
615
615
|
* @default false
|
|
616
616
|
*/
|
|
617
617
|
enableImmutableMode: boolean;
|
|
618
|
+
/**
|
|
619
|
+
* Enables the sticky header feature, which keeps the column headers visible while scrolling the Tree Grid content or the entire document.
|
|
620
|
+
*
|
|
621
|
+
* @default false
|
|
622
|
+
*/
|
|
623
|
+
enableStickyHeader: boolean;
|
|
618
624
|
/**
|
|
619
625
|
* Defines the scrollable height of the TreeGrid content.
|
|
620
626
|
*
|
|
@@ -1317,6 +1323,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1317
1323
|
private lastRowBorder;
|
|
1318
1324
|
private isPixelHeight;
|
|
1319
1325
|
private extendedGridDataBoundEvent;
|
|
1326
|
+
private lastRowBorderEventListener;
|
|
1320
1327
|
private objectEqualityChecker;
|
|
1321
1328
|
private bindCallBackEvents;
|
|
1322
1329
|
private extendedGridEditEvents;
|
|
@@ -432,7 +432,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
432
432
|
parentTarget = target.parentElement;
|
|
433
433
|
if (!isNullOrUndefined(parentTarget)) {
|
|
434
434
|
var cellIndex = parentTarget.cellIndex;
|
|
435
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
435
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
436
436
|
parentTarget = target;
|
|
437
437
|
}
|
|
438
438
|
summaryElement = this.findnextRowElement(parentTarget);
|
|
@@ -440,8 +440,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
440
440
|
var cellIndex_1 = target.cellIndex;
|
|
441
441
|
var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
|
|
442
442
|
if (!isNullOrUndefined(row_1) && !this.grid.isEdit) {
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
444
|
+
focusedCells.forEach(function (cell) {
|
|
445
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
446
|
+
});
|
|
447
|
+
addClass([row_1], ['e-focused', 'e-focus']);
|
|
445
448
|
}
|
|
446
449
|
}
|
|
447
450
|
else {
|
|
@@ -461,7 +464,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
461
464
|
parentTarget = target.parentElement;
|
|
462
465
|
if (!isNullOrUndefined(parentTarget)) {
|
|
463
466
|
var cellIndex = parentTarget.cellIndex;
|
|
464
|
-
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
467
|
+
if (cellIndex && this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
465
468
|
parentTarget = target;
|
|
466
469
|
}
|
|
467
470
|
summaryElement = this.findPreviousRowElement(parentTarget);
|
|
@@ -470,8 +473,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
470
473
|
if (!isNullOrUndefined(cellIndex_2)) {
|
|
471
474
|
var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
|
|
472
475
|
if (!isNullOrUndefined(row_2) && !this.grid.isEdit) {
|
|
473
|
-
|
|
474
|
-
|
|
476
|
+
var focusedCells = this.grid.getContent().querySelectorAll('.e-rowcell.e-focused, .e-rowcell.e-focus');
|
|
477
|
+
focusedCells.forEach(function (cell) {
|
|
478
|
+
removeClass([cell], ['e-focused', 'e-focus']);
|
|
479
|
+
});
|
|
480
|
+
addClass([row_2], ['e-focused', 'e-focus']);
|
|
475
481
|
}
|
|
476
482
|
}
|
|
477
483
|
}
|
|
@@ -838,11 +844,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
838
844
|
var destroyTemplate = 'destroyTemplate';
|
|
839
845
|
var destroyTemplateFn = this.grid["" + destroyTemplate];
|
|
840
846
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
841
|
-
this.grid["" + destroyTemplate] = function (args, index) {
|
|
847
|
+
this.grid["" + destroyTemplate] = function (args, index, callback) {
|
|
842
848
|
destroyTemplateFn.apply(_this.grid);
|
|
843
849
|
var portals = 'portals';
|
|
844
850
|
if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
|
|
845
|
-
_this.clearTemplate(args, index);
|
|
851
|
+
_this.clearTemplate(args, index, callback);
|
|
852
|
+
}
|
|
853
|
+
else if (!isNullOrUndefined(callback)) {
|
|
854
|
+
callback();
|
|
846
855
|
}
|
|
847
856
|
};
|
|
848
857
|
};
|
|
@@ -938,18 +947,24 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
938
947
|
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
|
|
939
948
|
};
|
|
940
949
|
TreeGrid.prototype.convertTreeData = function (data) {
|
|
941
|
-
var _this = this;
|
|
942
950
|
if (isCountRequired(this)) {
|
|
943
951
|
data = getValue('result', data);
|
|
944
952
|
}
|
|
945
953
|
if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {
|
|
946
954
|
this.flatData = data;
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
955
|
+
var _loop_1 = function (i, len) {
|
|
956
|
+
var rowData = this_1.flatData[parseInt(i.toString(), 10)];
|
|
957
|
+
setValue('uniqueIDCollection.' + rowData['uniqueID'], rowData, this_1);
|
|
958
|
+
if (rowData.level === 0 && !this_1.parentData.some(function (record) {
|
|
959
|
+
return record.uniqueID === rowData.uniqueID;
|
|
960
|
+
})) {
|
|
961
|
+
this_1.parentData.push(rowData);
|
|
951
962
|
}
|
|
952
|
-
}
|
|
963
|
+
};
|
|
964
|
+
var this_1 = this;
|
|
965
|
+
for (var i = 0, len = this.flatData.length; i < len; i++) {
|
|
966
|
+
_loop_1(i, len);
|
|
967
|
+
}
|
|
953
968
|
}
|
|
954
969
|
else {
|
|
955
970
|
if (isCountRequired(this)) {
|
|
@@ -1039,6 +1054,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1039
1054
|
this.grid["" + isJsComponent] = true;
|
|
1040
1055
|
var enableHtmlSanitizer = 'enableHtmlSanitizer';
|
|
1041
1056
|
this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
|
|
1057
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
1058
|
+
var isTreeGrid = 'isTreeGrid';
|
|
1059
|
+
this.grid["" + isTreeGrid] = true;
|
|
1042
1060
|
};
|
|
1043
1061
|
TreeGrid.prototype.triggerEvents = function (args) {
|
|
1044
1062
|
this.trigger(getObject('name', args), args);
|
|
@@ -1176,6 +1194,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1176
1194
|
TreeGrid.prototype.extendedGridDataBoundEvent = function () {
|
|
1177
1195
|
var _this = this;
|
|
1178
1196
|
this.grid.dataBound = function (args) {
|
|
1197
|
+
_this.lastRowBorderEventListener();
|
|
1179
1198
|
_this.updateRowTemplate();
|
|
1180
1199
|
_this.updateColumnModel();
|
|
1181
1200
|
_this.updateAltRow(_this.getRows());
|
|
@@ -1268,6 +1287,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1268
1287
|
}
|
|
1269
1288
|
};
|
|
1270
1289
|
};
|
|
1290
|
+
TreeGrid.prototype.lastRowBorderEventListener = function () {
|
|
1291
|
+
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
1292
|
+
};
|
|
1271
1293
|
TreeGrid.prototype.bindCallBackEvents = function () {
|
|
1272
1294
|
var _this = this;
|
|
1273
1295
|
this.grid.toolbarClick = function (args) {
|
|
@@ -1435,6 +1457,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1435
1457
|
if (args.requestType === 'sorting' && args.target && args.target.parentElement &&
|
|
1436
1458
|
args.target.parentElement.classList.contains('e-hierarchycheckbox')) {
|
|
1437
1459
|
args.cancel = true;
|
|
1460
|
+
return;
|
|
1438
1461
|
}
|
|
1439
1462
|
var requestType = getObject('requestType', args);
|
|
1440
1463
|
if (requestType === 'reorder') {
|
|
@@ -1625,6 +1648,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1625
1648
|
* @returns {void}
|
|
1626
1649
|
*/
|
|
1627
1650
|
TreeGrid.prototype.autoGenerateColumns = function () {
|
|
1651
|
+
var _this = this;
|
|
1628
1652
|
if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {
|
|
1629
1653
|
this.columns = [];
|
|
1630
1654
|
// if (this.dataSource instanceof DataManager) {
|
|
@@ -1633,11 +1657,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1633
1657
|
var record = this.dataSource[0];
|
|
1634
1658
|
// }
|
|
1635
1659
|
var keys = Object.keys(record);
|
|
1636
|
-
|
|
1637
|
-
if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
1638
|
-
this.columns.push(keys[parseInt(i.toString(), 10)]);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1660
|
+
this.columns = keys.filter(function (key) { return [_this.childMapping, _this.parentIdMapping].indexOf(key) === -1; });
|
|
1641
1661
|
}
|
|
1642
1662
|
};
|
|
1643
1663
|
TreeGrid.prototype.getGridEditSettings = function () {
|
|
@@ -1791,8 +1811,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1791
1811
|
gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
|
|
1792
1812
|
}
|
|
1793
1813
|
else {
|
|
1794
|
-
|
|
1795
|
-
|
|
1814
|
+
var columnProps = Object.keys(column[parseInt(i.toString(), 10)]);
|
|
1815
|
+
for (var j = 0; j < columnProps.length; j++) {
|
|
1816
|
+
var prop = columnProps[parseInt(j.toString(), 10)];
|
|
1796
1817
|
if (index === this.treeColumnIndex && prop === 'template') {
|
|
1797
1818
|
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1798
1819
|
}
|
|
@@ -1963,6 +1984,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1963
1984
|
break;
|
|
1964
1985
|
case 'rowHeight':
|
|
1965
1986
|
this.grid.rowHeight = this.rowHeight;
|
|
1987
|
+
this.refresh();
|
|
1966
1988
|
break;
|
|
1967
1989
|
case 'height':
|
|
1968
1990
|
if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {
|
|
@@ -2038,6 +2060,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2038
2060
|
case 'columnMenuItems':
|
|
2039
2061
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
2040
2062
|
break;
|
|
2063
|
+
case 'enableStickyHeader':
|
|
2064
|
+
this.grid.enableStickyHeader = this.enableStickyHeader;
|
|
2065
|
+
break;
|
|
2041
2066
|
case 'editSettings':
|
|
2042
2067
|
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
|
|
2043
2068
|
(newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
|
|
@@ -2189,7 +2214,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2189
2214
|
var checkedTarget = this.grid.getHeaderContent().querySelector('.e-checkselectall');
|
|
2190
2215
|
var checkedLen = this.grid.getSelectedRowIndexes().length;
|
|
2191
2216
|
var totalRecords = this.getCurrentViewRecords().length;
|
|
2192
|
-
if (checkedLen === totalRecords) {
|
|
2217
|
+
if (totalRecords > 0 && checkedLen === totalRecords) {
|
|
2193
2218
|
var spanEle = checkedTarget.nextElementSibling;
|
|
2194
2219
|
removeClass([spanEle], ['e-stop', 'e-uncheck']);
|
|
2195
2220
|
addClass([spanEle], ['e-check']);
|
|
@@ -2925,14 +2950,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2925
2950
|
* @returns {Column[]} - Returns an array of visible column objects.
|
|
2926
2951
|
*/
|
|
2927
2952
|
TreeGrid.prototype.getVisibleColumns = function () {
|
|
2928
|
-
|
|
2929
|
-
for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {
|
|
2930
|
-
var col = _a[_i];
|
|
2931
|
-
if (col.visible) {
|
|
2932
|
-
cols.push(col);
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
return cols;
|
|
2953
|
+
return this.columnModel.filter(function (col) { return col.visible; });
|
|
2936
2954
|
};
|
|
2937
2955
|
/**
|
|
2938
2956
|
* Displays a loading spinner overlay across the TreeGrid for any data action or long-running process.
|
|
@@ -3060,17 +3078,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3060
3078
|
TreeGrid.prototype.getTreeColumn = function () {
|
|
3061
3079
|
var columnModel = 'columnModel';
|
|
3062
3080
|
var treeColumn = this["" + columnModel][this.treeColumnIndex];
|
|
3063
|
-
var treeIndex;
|
|
3064
3081
|
var updatedCols = this.getColumns();
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
}
|
|
3082
|
+
var treeColumnField = getObject('field', treeColumn);
|
|
3083
|
+
var treeIndex = updatedCols.findIndex(function (col) {
|
|
3084
|
+
return getObject('field', col) === treeColumnField;
|
|
3085
|
+
});
|
|
3086
|
+
if (!isNullOrUndefined(treeIndex)) {
|
|
3087
|
+
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
3072
3088
|
}
|
|
3073
|
-
this.setProperties({ treeColumnIndex: treeIndex }, true);
|
|
3074
3089
|
};
|
|
3075
3090
|
/**
|
|
3076
3091
|
* Refreshes the header section of the TreeGrid to reflect any structural or data changes.
|
|
@@ -3393,14 +3408,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3393
3408
|
};
|
|
3394
3409
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
3395
3410
|
if (isPaging === void 0) { isPaging = false; }
|
|
3396
|
-
var
|
|
3411
|
+
var _loop_2 = function (i) {
|
|
3397
3412
|
if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
|
|
3398
3413
|
var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
|
|
3399
|
-
var parentItem =
|
|
3414
|
+
var parentItem = this_2.flatData.filter(function (e) {
|
|
3400
3415
|
return e.uniqueID === puniqueID_1;
|
|
3401
3416
|
});
|
|
3402
|
-
if (isRemoteData(
|
|
3403
|
-
parentItem =
|
|
3417
|
+
if (isRemoteData(this_2)) {
|
|
3418
|
+
parentItem = this_2.getCurrentViewRecords().filter(function (e) {
|
|
3404
3419
|
return e.uniqueID === puniqueID_1;
|
|
3405
3420
|
});
|
|
3406
3421
|
}
|
|
@@ -3409,7 +3424,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3409
3424
|
parentItem[0].expanded = true;
|
|
3410
3425
|
}
|
|
3411
3426
|
else {
|
|
3412
|
-
if (!getExpandStatus(
|
|
3427
|
+
if (!getExpandStatus(this_2, parentItem[0], this_2.parentData)) {
|
|
3413
3428
|
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
3414
3429
|
record.push(parentItem[0]);
|
|
3415
3430
|
}
|
|
@@ -3417,12 +3432,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3417
3432
|
}
|
|
3418
3433
|
}
|
|
3419
3434
|
if (!isPaging) {
|
|
3420
|
-
|
|
3435
|
+
this_2.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
|
|
3421
3436
|
}
|
|
3422
3437
|
};
|
|
3423
|
-
var
|
|
3438
|
+
var this_2 = this;
|
|
3424
3439
|
for (var i = 0; i < record.length; i++) {
|
|
3425
|
-
|
|
3440
|
+
_loop_2(i);
|
|
3426
3441
|
}
|
|
3427
3442
|
if (isPaging) {
|
|
3428
3443
|
this.expandRow(null, record, key, level);
|
|
@@ -3526,8 +3541,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3526
3541
|
if (this.editSettings.mode === 'Batch') {
|
|
3527
3542
|
var obj = 'dialogObj';
|
|
3528
3543
|
var showDialog = 'showDialog';
|
|
3529
|
-
|
|
3530
|
-
|
|
3544
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
3545
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
3546
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
3547
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
3548
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
3549
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
3531
3550
|
var dialogObj = this.grid.editModule["" + obj];
|
|
3532
3551
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
3533
3552
|
return;
|
|
@@ -3553,8 +3572,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3553
3572
|
if (this.editSettings.mode === 'Batch') {
|
|
3554
3573
|
var obj = 'dialogObj';
|
|
3555
3574
|
var showDialog = 'showDialog';
|
|
3556
|
-
|
|
3557
|
-
|
|
3575
|
+
var changes = this.getBatchChanges ? this.getBatchChanges() : {};
|
|
3576
|
+
var changed = Array.isArray(changes.changedRecords) ? changes.changedRecords : [];
|
|
3577
|
+
var deleted = Array.isArray(changes.deletedRecords) ? changes.deletedRecords : [];
|
|
3578
|
+
var added = Array.isArray(changes.addedRecords) ? changes.addedRecords : [];
|
|
3579
|
+
var hasChanges = changed.length > 0 || deleted.length > 0 || added.length > 0;
|
|
3580
|
+
if (hasChanges && this.editSettings.showConfirmDialog) {
|
|
3558
3581
|
var dialogObj = this.grid.editModule["" + obj];
|
|
3559
3582
|
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
3560
3583
|
return;
|
|
@@ -3844,6 +3867,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3844
3867
|
TreeGrid.prototype.remoteExpand = function (action, row, record) {
|
|
3845
3868
|
var gridRows = this.getRows();
|
|
3846
3869
|
var fetchRemoteChildData = 'fetchRemoteChildData';
|
|
3870
|
+
var requestType = getValue('isCollapseAll', this) ? 'collapseAll' : 'refresh';
|
|
3871
|
+
this.grid.contentModule.requestType = requestType;
|
|
3847
3872
|
if (this.rowTemplate) {
|
|
3848
3873
|
var rows_1 = this.getContentTable().rows;
|
|
3849
3874
|
gridRows = [].slice.call(rows_1);
|
|
@@ -3918,6 +3943,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3918
3943
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
|
|
3919
3944
|
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
|
|
3920
3945
|
}
|
|
3946
|
+
if (this.detailTemplate) {
|
|
3947
|
+
gridRows.forEach(function (row) {
|
|
3948
|
+
if (row.classList.contains('e-detailrow') && row.style.display === 'none') {
|
|
3949
|
+
row.style.display = '';
|
|
3950
|
+
}
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3921
3953
|
var detailrows = gridRows.filter(function (r) {
|
|
3922
3954
|
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
3923
3955
|
});
|
|
@@ -4082,7 +4114,6 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
4082
4114
|
TreeGrid.prototype.addListener = function () {
|
|
4083
4115
|
this.on('updateResults', this.updateResultModel, this);
|
|
4084
4116
|
this.grid.on('initial-end', this.afterGridRender, this);
|
|
4085
|
-
this.grid.on('last-rowcell-border-updated', this.lastRowCellBorderUpdated, this);
|
|
4086
4117
|
};
|
|
4087
4118
|
TreeGrid.prototype.updateResultModel = function (returnResult) {
|
|
4088
4119
|
this.dataResults = returnResult;
|
|
@@ -4675,6 +4706,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
4675
4706
|
__decorate([
|
|
4676
4707
|
Property(false)
|
|
4677
4708
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
4709
|
+
__decorate([
|
|
4710
|
+
Property(false)
|
|
4711
|
+
], TreeGrid.prototype, "enableStickyHeader", void 0);
|
|
4678
4712
|
__decorate([
|
|
4679
4713
|
Property('auto')
|
|
4680
4714
|
], TreeGrid.prototype, "height", void 0);
|
|
@@ -39,10 +39,15 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
39
39
|
};
|
|
40
40
|
TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
|
|
41
41
|
var info = this.getDataInfo();
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
if (notifyArgs.requestType === 'refresh' && notifyArgs.isExpandCollapse) {
|
|
43
|
+
notifyArgs.virtualInfo = this['prevInfo'];
|
|
44
|
+
}
|
|
45
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo) && !(this.parent.root.loadChildOnDemand && isRemoteData(this.parent.root))) {
|
|
46
|
+
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
47
|
+
if ((!isRemoteData(this.parent.root) || isCountRequired(this.parent))
|
|
48
|
+
|| notifyArgs.virtualInfo.blockIndexes.length === 1) {
|
|
49
|
+
notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
53
|
notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);
|
|
@@ -83,7 +88,10 @@ var TreeVirtualRowModelGenerator = /** @class */ (function (_super) {
|
|
|
83
88
|
else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&
|
|
84
89
|
this.cache[parseInt(currentPage.toString(), 10)].length >
|
|
85
90
|
(this.parent.contentModule).getBlockSize()) {
|
|
86
|
-
|
|
91
|
+
if (this.cache[parseInt(currentPage.toString(), 10)].length > (this.parent.contentModule).getBlockSize()) {
|
|
92
|
+
this.cache[parseInt(currentPage.toString(), 10)] =
|
|
93
|
+
this.cache[parseInt(currentPage.toString(), 10)].slice(0, (this.parent.contentModule).getBlockSize());
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
else {
|
|
@@ -197,6 +197,7 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
197
197
|
* @returns {void} This method does not return any value.
|
|
198
198
|
*/
|
|
199
199
|
private restoreEditState;
|
|
200
|
+
private SetVirtualPageQury;
|
|
200
201
|
/**
|
|
201
202
|
* Resets the edit state if certain conditions are met.
|
|
202
203
|
*
|