@syncfusion/ej2-treegrid 20.1.55 → 20.1.56-97113
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 +16 -1
- package/CHANGELOG.md +15 -32
- package/README.md +64 -51
- package/dist/ej2-treegrid.min.js +1 -0
- package/dist/ej2-treegrid.umd.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +2046 -1076
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +2131 -1113
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -10
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/helpers/e2e/index.js +8 -6
- package/helpers/e2e/treegridhelper.js +82 -65
- package/package.json +64 -64
- package/src/treegrid/actions/batch-edit.js +115 -87
- package/src/treegrid/actions/clipboard.d.ts +3 -2
- package/src/treegrid/actions/clipboard.js +37 -35
- package/src/treegrid/actions/context-menu.js +53 -1
- package/src/treegrid/actions/crud-actions.js +67 -56
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +168 -115
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -16
- package/src/treegrid/actions/freeze-column.d.ts +1 -0
- package/src/treegrid/actions/freeze-column.js +48 -11
- package/src/treegrid/actions/infinite-scroll.js +25 -22
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.d.ts +1 -0
- package/src/treegrid/actions/page.js +21 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +142 -86
- package/src/treegrid/actions/selection.d.ts +1 -0
- package/src/treegrid/actions/selection.js +71 -39
- package/src/treegrid/actions/sort.js +17 -5
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +45 -43
- package/src/treegrid/actions/virtual-scroll.js +7 -4
- package/src/treegrid/base/constant.d.ts +30 -0
- package/src/treegrid/base/constant.js +30 -0
- package/src/treegrid/base/data.d.ts +1 -0
- package/src/treegrid/base/data.js +257 -57
- package/src/treegrid/base/treegrid-model.d.ts +50 -34
- package/src/treegrid/base/treegrid.d.ts +57 -35
- package/src/treegrid/base/treegrid.js +363 -200
- package/src/treegrid/enum.d.ts +8 -2
- package/src/treegrid/enum.js +2 -0
- package/src/treegrid/models/column.d.ts +6 -6
- package/src/treegrid/models/column.js +9 -9
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/loading-indicator-model.d.ts +20 -0
- package/src/treegrid/models/loading-indicator.d.ts +17 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.d.ts +4 -4
- package/src/treegrid/renderer/render.js +33 -24
- package/src/treegrid/renderer/virtual-row-model-generator.js +15 -6
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -2
- package/src/treegrid/renderer/virtual-tree-content-render.js +224 -106
- package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
- package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
- package/src/treegrid/utils.js +13 -12
- package/styles/bootstrap-dark.css +14 -1
- package/styles/bootstrap.css +14 -1
- package/styles/bootstrap4.css +14 -1
- package/styles/bootstrap5-dark.css +16 -2
- package/styles/bootstrap5.css +16 -2
- package/styles/fabric-dark.css +14 -1
- package/styles/fabric.css +14 -1
- package/styles/fluent-dark.css +15 -2
- package/styles/fluent.css +15 -2
- package/styles/highcontrast-light.css +14 -1
- package/styles/highcontrast.css +14 -1
- package/styles/material-dark.css +14 -1
- package/styles/material.css +14 -1
- package/styles/tailwind-dark.css +14 -1
- package/styles/tailwind.css +14 -1
- package/styles/treegrid/_all.scss +1 -1
- package/styles/treegrid/_bootstrap-dark-definition.scss +1 -1
- package/styles/treegrid/_bootstrap-definition.scss +1 -2
- package/styles/treegrid/_bootstrap4-definition.scss +0 -1
- package/styles/treegrid/_bootstrap5-definition.scss +0 -1
- package/styles/treegrid/_fabric-dark-definition.scss +1 -2
- package/styles/treegrid/_fabric-definition.scss +1 -2
- package/styles/treegrid/_fluent-definition.scss +0 -1
- package/styles/treegrid/_fusionnew-definition.scss +28 -0
- package/styles/treegrid/_highcontrast-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_icons.scss +12 -1
- package/styles/treegrid/_layout.scss +4 -4
- package/styles/treegrid/_material-definition.scss +0 -1
- package/styles/treegrid/_material3-definition.scss +28 -0
- package/styles/treegrid/_tailwind-definition.scss +0 -1
- package/styles/treegrid/_theme.scss +1 -0
- package/styles/treegrid/bootstrap-dark.css +14 -1
- package/styles/treegrid/bootstrap.css +14 -1
- package/styles/treegrid/bootstrap4.css +14 -1
- package/styles/treegrid/bootstrap5-dark.css +16 -2
- package/styles/treegrid/bootstrap5.css +16 -2
- package/styles/treegrid/fabric-dark.css +14 -1
- package/styles/treegrid/fabric.css +14 -1
- package/styles/treegrid/fluent-dark.css +15 -2
- package/styles/treegrid/fluent.css +15 -2
- package/styles/treegrid/highcontrast-light.css +14 -1
- package/styles/treegrid/highcontrast.css +14 -1
- package/styles/treegrid/icons/_bootstrap-dark.scss +12 -1
- package/styles/treegrid/icons/_bootstrap.scss +12 -1
- package/styles/treegrid/icons/_bootstrap4.scss +12 -1
- package/styles/treegrid/icons/_bootstrap5.scss +11 -0
- package/styles/treegrid/icons/_fabric-dark.scss +12 -1
- package/styles/treegrid/icons/_fabric.scss +12 -1
- package/styles/treegrid/icons/_fluent.scss +11 -0
- package/styles/treegrid/icons/_fusionnew.scss +26 -0
- package/styles/treegrid/icons/_highcontrast-light.scss +12 -1
- package/styles/treegrid/icons/_highcontrast.scss +11 -0
- package/styles/treegrid/icons/_material-dark.scss +12 -1
- package/styles/treegrid/icons/_material.scss +11 -0
- package/styles/treegrid/icons/_material3.scss +26 -0
- package/styles/treegrid/icons/_tailwind-dark.scss +11 -0
- package/styles/treegrid/icons/_tailwind.scss +11 -0
- package/styles/treegrid/material-dark.css +14 -1
- package/styles/treegrid/material.css +14 -1
- package/styles/treegrid/tailwind-dark.css +14 -1
- package/styles/treegrid/tailwind.css +14 -1
|
@@ -17,11 +17,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
17
17
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
18
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
19
|
};
|
|
20
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend } from '@syncfusion/ej2-base';
|
|
20
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend, merge } from '@syncfusion/ej2-base';
|
|
21
21
|
import { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';
|
|
22
22
|
import { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';
|
|
23
23
|
import { Column } from '../models/column';
|
|
24
24
|
import { RowDropSettings, getUid } from '@syncfusion/ej2-grids';
|
|
25
|
+
import { LoadingIndicator } from '../models/loading-indicator';
|
|
25
26
|
import { FilterSettings } from '../models/filter-settings';
|
|
26
27
|
import { TextWrapSettings } from '../models/textwrap-settings';
|
|
27
28
|
import { Logger as TreeLogger } from '../actions/logger';
|
|
@@ -47,6 +48,7 @@ import { SortSettings } from '../models/sort-settings';
|
|
|
47
48
|
import { isHidden, getExpandStatus } from '../utils';
|
|
48
49
|
import { editAction } from '../actions/crud-actions';
|
|
49
50
|
import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';
|
|
51
|
+
import * as literals from '../base/constant';
|
|
50
52
|
/**
|
|
51
53
|
* Represents the TreeGrid component.
|
|
52
54
|
* ```html
|
|
@@ -76,9 +78,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
76
78
|
var isEqual = true;
|
|
77
79
|
var excludeKeys = ['Children', 'childRecords', 'taskData', 'uniqueID', 'parentItem', 'parentUniqueID', 'index'];
|
|
78
80
|
for (var i = 0; i < keys.length; i++) {
|
|
79
|
-
if (old[keys[i]] !== current[keys[i
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
if (old[keys[parseInt(i.toString(), 10)]] !== current[keys[parseInt(i.toString(), 10)]] &&
|
|
82
|
+
excludeKeys.indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
83
|
+
var isDate = old[keys[parseInt(i.toString(), 10)]] instanceof Date &&
|
|
84
|
+
current[keys[parseInt(i.toString(), 10)]] instanceof Date;
|
|
85
|
+
if (!isDate || (old[keys[parseInt(i.toString(), 10)]].getTime() !==
|
|
86
|
+
current[keys[parseInt(i.toString(), 10)]].getTime())) {
|
|
82
87
|
isEqual = false;
|
|
83
88
|
break;
|
|
84
89
|
}
|
|
@@ -93,7 +98,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
93
98
|
TreeGrid_1.Inject(TreeGridSelection);
|
|
94
99
|
setValue('mergePersistData', _this.mergePersistTreeGridData, _this);
|
|
95
100
|
var logger = 'Logger';
|
|
96
|
-
if (!isNullOrUndefined(_this.injectedModules[logger])) {
|
|
101
|
+
if (!isNullOrUndefined(_this.injectedModules["" + logger])) {
|
|
97
102
|
Grid.Inject(Logger);
|
|
98
103
|
}
|
|
99
104
|
_this.grid = new Grid();
|
|
@@ -285,17 +290,21 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
285
290
|
case 'ctrlShiftUpArrow':
|
|
286
291
|
target = e.target;
|
|
287
292
|
column = target.closest('.e-rowcell');
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
293
|
+
if (!isNullOrUndefined(column)) {
|
|
294
|
+
row = column.closest('tr');
|
|
295
|
+
if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridexpand')[0]))) {
|
|
296
|
+
this.expandCollapseRequest(row.querySelector('.e-treegridexpand'));
|
|
297
|
+
}
|
|
291
298
|
}
|
|
292
299
|
break;
|
|
293
300
|
case 'ctrlShiftDownArrow':
|
|
294
301
|
target = e.target;
|
|
295
302
|
column = target.closest('.e-rowcell');
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
303
|
+
if (!isNullOrUndefined(column)) {
|
|
304
|
+
row = column.closest('tr');
|
|
305
|
+
if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridcollapse')[0]))) {
|
|
306
|
+
this.expandCollapseRequest(row.querySelector('.e-treegridcollapse'));
|
|
307
|
+
}
|
|
299
308
|
}
|
|
300
309
|
break;
|
|
301
310
|
case 'downArrow':
|
|
@@ -306,7 +315,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
306
315
|
var rowIndex = summaryElement.rowIndex;
|
|
307
316
|
this.selectRow(rowIndex);
|
|
308
317
|
var cellIndex = e.target.cellIndex;
|
|
309
|
-
var row_1 = summaryElement.children[cellIndex];
|
|
318
|
+
var row_1 = summaryElement.children[parseInt(cellIndex.toString(), 10)];
|
|
310
319
|
addClass([row_1], 'e-focused');
|
|
311
320
|
addClass([row_1], 'e-focus');
|
|
312
321
|
}
|
|
@@ -323,7 +332,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
323
332
|
var rIndex = summaryElement.rowIndex;
|
|
324
333
|
this.selectRow(rIndex);
|
|
325
334
|
var cIndex = e.target.cellIndex;
|
|
326
|
-
var rows = summaryElement.children[cIndex];
|
|
335
|
+
var rows = summaryElement.children[parseInt(cIndex.toString(), 10)];
|
|
327
336
|
addClass([rows], 'e-focused');
|
|
328
337
|
addClass([rows], 'e-focus');
|
|
329
338
|
}
|
|
@@ -355,6 +364,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
355
364
|
TreeGrid.prototype.initProperties = function () {
|
|
356
365
|
this.defaultLocale = {};
|
|
357
366
|
this.flatData = [];
|
|
367
|
+
this.infiniteScrollData = [];
|
|
368
|
+
this.remoteCollapsedData = [];
|
|
369
|
+
this.remoteExpandedData = [];
|
|
358
370
|
this.parentData = [];
|
|
359
371
|
this.columnModel = [];
|
|
360
372
|
this.isExpandAll = false;
|
|
@@ -398,7 +410,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
398
410
|
TreeGrid.prototype.requiredModules = function () {
|
|
399
411
|
var modules = [];
|
|
400
412
|
var splitFrozenCount = 'splitFrozenCount';
|
|
401
|
-
this.grid[splitFrozenCount](this.getGridColumns(this.columns));
|
|
413
|
+
this.grid["" + splitFrozenCount](this.getGridColumns(this.columns));
|
|
402
414
|
if (this.isDestroyed) {
|
|
403
415
|
return modules;
|
|
404
416
|
}
|
|
@@ -448,8 +460,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
448
460
|
member: 'ExcelExport', args: [this]
|
|
449
461
|
});
|
|
450
462
|
}
|
|
463
|
+
var freezePresent = this.injectedModules.filter(function (e) {
|
|
464
|
+
return e.prototype.getModuleName() === 'freeze';
|
|
465
|
+
});
|
|
451
466
|
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
452
|
-
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
|
|
467
|
+
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || freezePresent.length) {
|
|
453
468
|
modules.push({
|
|
454
469
|
member: 'freeze', args: [this]
|
|
455
470
|
});
|
|
@@ -479,7 +494,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
479
494
|
};
|
|
480
495
|
TreeGrid.prototype.extendRequiredModules = function (modules) {
|
|
481
496
|
var IsRowDDInjected = this.injectedModules.filter(function (e) {
|
|
482
|
-
return e.
|
|
497
|
+
return e.prototype.getModuleName() === 'rowDragAndDrop';
|
|
483
498
|
});
|
|
484
499
|
if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
|
|
485
500
|
if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
|
|
@@ -605,14 +620,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
605
620
|
var modules = [];
|
|
606
621
|
modules = gridRequiredModules.apply(this);
|
|
607
622
|
for (var i = 0; i < modules.length; i++) {
|
|
608
|
-
if (modules[i].member === 'virtualscroll') {
|
|
609
|
-
modules[i].member = 'treeVirtualScroll';
|
|
623
|
+
if (modules[parseInt(i.toString(), 10)].member === 'virtualscroll') {
|
|
624
|
+
modules[parseInt(i.toString(), 10)].member = 'treeVirtualScroll';
|
|
610
625
|
}
|
|
611
626
|
}
|
|
612
627
|
return modules;
|
|
613
628
|
};
|
|
614
629
|
var root = 'root';
|
|
615
|
-
this.grid[root] = this[root] ? this[root] : this;
|
|
630
|
+
this.grid["" + root] = this["" + root] ? this["" + root] : this;
|
|
616
631
|
this.grid.appendTo(gridContainer);
|
|
617
632
|
if (this.isIndentEnabled) {
|
|
618
633
|
this.refreshToolbarItems();
|
|
@@ -620,12 +635,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
620
635
|
this.wireEvents();
|
|
621
636
|
this.renderComplete();
|
|
622
637
|
var destroyTemplate = 'destroyTemplate';
|
|
623
|
-
var destroyTemplateFn = this.grid[destroyTemplate];
|
|
638
|
+
var destroyTemplateFn = this.grid["" + destroyTemplate];
|
|
624
639
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
625
|
-
this.grid[destroyTemplate] = function (args, index) {
|
|
640
|
+
this.grid["" + destroyTemplate] = function (args, index) {
|
|
626
641
|
destroyTemplateFn.apply(_this.grid);
|
|
627
642
|
var portals = 'portals';
|
|
628
|
-
if (!(_this.isReact && isNullOrUndefined(_this[portals]))) {
|
|
643
|
+
if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
|
|
629
644
|
_this.clearTemplate(args, index);
|
|
630
645
|
}
|
|
631
646
|
};
|
|
@@ -643,7 +658,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
643
658
|
if (!isNullOrUndefined(this.grid.clipboardModule)) {
|
|
644
659
|
this.grid.clipboardModule.destroy();
|
|
645
660
|
}
|
|
646
|
-
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);
|
|
661
|
+
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
|
|
647
662
|
};
|
|
648
663
|
TreeGrid.prototype.convertTreeData = function (data) {
|
|
649
664
|
var _this = this;
|
|
@@ -697,6 +712,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
697
712
|
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
698
713
|
this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
|
|
699
714
|
this.grid.infiniteScrollSettings = this.infiniteScrollSettings;
|
|
715
|
+
this.grid.enableVirtualMaskRow = this.enableVirtualMaskRow;
|
|
716
|
+
this.grid.loadingIndicator = this.loadingIndicator;
|
|
700
717
|
this.grid.width = this.width;
|
|
701
718
|
this.grid.height = this.height;
|
|
702
719
|
this.grid.enableAltRow = this.enableAltRow;
|
|
@@ -733,30 +750,38 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
733
750
|
this.grid.frozenColumns = this.frozenColumns;
|
|
734
751
|
this.grid.clipMode = getActualProperties(this.clipMode);
|
|
735
752
|
var templateInstance = 'templateDotnetInstance';
|
|
736
|
-
this.grid[templateInstance] = this[templateInstance];
|
|
753
|
+
this.grid["" + templateInstance] = this["" + templateInstance];
|
|
737
754
|
var isJsComponent = 'isJsComponent';
|
|
738
|
-
this.grid[isJsComponent] = true;
|
|
755
|
+
this.grid["" + isJsComponent] = true;
|
|
739
756
|
};
|
|
740
757
|
TreeGrid.prototype.triggerEvents = function (args) {
|
|
741
758
|
this.trigger(getObject('name', args), args);
|
|
742
759
|
};
|
|
760
|
+
TreeGrid.prototype.IsExpandCollapseClicked = function (args) {
|
|
761
|
+
if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
|
|
762
|
+
|| args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
|
|
763
|
+
&& (!isNullOrUndefined(args.data) && args.data['hasChildRecords'])) {
|
|
764
|
+
args.cancel = true;
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
};
|
|
743
768
|
TreeGrid.prototype.bindGridEvents = function () {
|
|
744
769
|
var _this = this;
|
|
745
770
|
this.grid.rowSelecting = function (args) {
|
|
746
|
-
|
|
747
|
-
|| args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
|
|
748
|
-
args.cancel = true;
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
771
|
+
_this.IsExpandCollapseClicked(args);
|
|
751
772
|
_this.trigger(events.rowSelecting, args);
|
|
752
773
|
};
|
|
774
|
+
this.grid.rowDeselecting = function (args) {
|
|
775
|
+
_this.IsExpandCollapseClicked(args);
|
|
776
|
+
_this.trigger(events.rowDeselecting, args);
|
|
777
|
+
};
|
|
753
778
|
this.grid.rowSelected = function (args) {
|
|
754
779
|
if (_this.enableVirtualization && args.isHeaderCheckboxClicked &&
|
|
755
780
|
_this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
|
|
756
781
|
var updateRowSelection = 'updateRowSelection';
|
|
757
782
|
for (var i = 0; i < _this.getRows().length; i++) {
|
|
758
|
-
if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
759
|
-
_this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
|
|
783
|
+
if (_this.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
784
|
+
_this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(i.toString(), 10)], _this.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
|
|
760
785
|
}
|
|
761
786
|
}
|
|
762
787
|
}
|
|
@@ -792,7 +817,6 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
792
817
|
this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);
|
|
793
818
|
this.grid.dataSourceChanged = this.triggerEvents.bind(this);
|
|
794
819
|
this.grid.recordDoubleClick = this.triggerEvents.bind(this);
|
|
795
|
-
this.grid.rowDeselecting = this.triggerEvents.bind(this);
|
|
796
820
|
this.grid.cellDeselected = this.triggerEvents.bind(this);
|
|
797
821
|
this.grid.cellDeselecting = this.triggerEvents.bind(this);
|
|
798
822
|
this.grid.columnMenuOpen = this.triggerEvents.bind(this);
|
|
@@ -809,8 +833,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
809
833
|
this.grid.beforePaste = function (args) {
|
|
810
834
|
var rows = _this.getRows();
|
|
811
835
|
var rowIndex = 'rowIndex';
|
|
812
|
-
while (rows[args[rowIndex]].classList.contains('e-summaryrow')) {
|
|
813
|
-
args[rowIndex]++;
|
|
836
|
+
while (rows[args["" + rowIndex]].classList.contains('e-summaryrow')) {
|
|
837
|
+
args["" + rowIndex]++;
|
|
814
838
|
}
|
|
815
839
|
_this.trigger(events.beforePaste, args);
|
|
816
840
|
};
|
|
@@ -818,7 +842,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
818
842
|
_this.grid.on('initial-end', _this.afterGridRender, _this);
|
|
819
843
|
if (!isNullOrUndefined(_this.loggerModule)) {
|
|
820
844
|
var loggerModule = 'loggerModule';
|
|
821
|
-
_this.loggerModule = _this.grid[loggerModule] = new TreeLogger(_this.grid);
|
|
845
|
+
_this.loggerModule = _this.grid["" + loggerModule] = new TreeLogger(_this.grid);
|
|
822
846
|
}
|
|
823
847
|
};
|
|
824
848
|
this.grid.printComplete = this.triggerEvents.bind(this);
|
|
@@ -833,10 +857,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
833
857
|
TreeGrid.prototype.lastRowBorder = function (visiblerow, isAddBorder) {
|
|
834
858
|
for (var j = 0; j < visiblerow.cells.length; j++) {
|
|
835
859
|
if (isAddBorder) {
|
|
836
|
-
addClass([visiblerow.cells[j]], 'e-lastrowcell');
|
|
860
|
+
addClass([visiblerow.cells[parseInt(j.toString(), 10)]], 'e-lastrowcell');
|
|
837
861
|
}
|
|
838
862
|
else {
|
|
839
|
-
removeClass([visiblerow.cells[j]], 'e-lastrowcell');
|
|
863
|
+
removeClass([visiblerow.cells[parseInt(j.toString(), 10)]], 'e-lastrowcell');
|
|
840
864
|
}
|
|
841
865
|
}
|
|
842
866
|
};
|
|
@@ -865,22 +889,22 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
865
889
|
var rows = _this.getContentTable().rows;
|
|
866
890
|
var totalRows = [].slice.call(rows);
|
|
867
891
|
for (var i = totalRows.length - 1; i > 0; i--) {
|
|
868
|
-
if (!isHidden(totalRows[i])) {
|
|
869
|
-
if (totalRows[i].nextElementSibling) {
|
|
870
|
-
_this.lastRowBorder(totalRows[i], true);
|
|
892
|
+
if (!isHidden(totalRows[parseInt(i.toString(), 10)])) {
|
|
893
|
+
if (totalRows[parseInt(i.toString(), 10)].nextElementSibling) {
|
|
894
|
+
_this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], true);
|
|
871
895
|
}
|
|
872
896
|
break;
|
|
873
897
|
}
|
|
874
898
|
}
|
|
875
899
|
}
|
|
876
900
|
var action = 'action';
|
|
877
|
-
if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {
|
|
901
|
+
if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults["" + action] === 'expand' || _this.dataResults["" + action] === 'collapse')) {
|
|
878
902
|
var refreshPersistSelection = 'refreshPersistSelection';
|
|
879
|
-
_this.grid.selectionModule[refreshPersistSelection]();
|
|
903
|
+
_this.grid.selectionModule["" + refreshPersistSelection]();
|
|
880
904
|
if (_this.grid.selectionSettings.type === 'Single') {
|
|
881
905
|
var updateRowSelection = 'updateRowSelection';
|
|
882
906
|
var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);
|
|
883
|
-
_this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);
|
|
907
|
+
_this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
|
|
884
908
|
}
|
|
885
909
|
}
|
|
886
910
|
_this.trigger(events.dataBound, args);
|
|
@@ -898,7 +922,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
898
922
|
else if (treeGrid.flatData.length === 0 && isOffline(treeGrid) && treeGrid.dataSource instanceof DataManager) {
|
|
899
923
|
var dm = treeGrid.dataSource;
|
|
900
924
|
treeGrid.dataModule.convertToFlatData(dm.dataSource.json);
|
|
901
|
-
args.result = treeGrid.grid.dataSource[dataSource].json = treeGrid.flatData;
|
|
925
|
+
args.result = treeGrid.grid.dataSource["" + dataSource].json = treeGrid.flatData;
|
|
902
926
|
}
|
|
903
927
|
if (!isRemoteData(treeGrid) && !isCountRequired(this) && !isNullOrUndefined(treeGrid.dataSource)) {
|
|
904
928
|
if (this.isPrinting) {
|
|
@@ -973,6 +997,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
973
997
|
_this.grid.dataSource = { result: _this.flatData, count: getValue('count', _this.grid.dataSource) };
|
|
974
998
|
}
|
|
975
999
|
else {
|
|
1000
|
+
if (args.action.requestType !== 'infiniteScroll') {
|
|
1001
|
+
_this.infiniteScrollData = [];
|
|
1002
|
+
}
|
|
976
1003
|
_this.trigger(events.dataStateChange, args);
|
|
977
1004
|
}
|
|
978
1005
|
};
|
|
@@ -999,7 +1026,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
999
1026
|
this.grid.cellEdit = function (args) {
|
|
1000
1027
|
var prom = 'promise';
|
|
1001
1028
|
var promise = new Deferred();
|
|
1002
|
-
args[prom] = promise;
|
|
1029
|
+
args["" + prom] = promise;
|
|
1003
1030
|
_this.notify(events.cellEdit, args);
|
|
1004
1031
|
return promise;
|
|
1005
1032
|
};
|
|
@@ -1048,17 +1075,17 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1048
1075
|
this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);
|
|
1049
1076
|
}
|
|
1050
1077
|
if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {
|
|
1051
|
-
this.grid.dataSource[dataSource].json = extendArray(this.dataSource[dataSource].json);
|
|
1052
|
-
this.grid.dataSource[ready] = this.dataSource.ready;
|
|
1078
|
+
this.grid.dataSource["" + dataSource].json = extendArray(this.dataSource["" + dataSource].json);
|
|
1079
|
+
this.grid.dataSource["" + ready] = this.dataSource.ready;
|
|
1053
1080
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1054
1081
|
var proxy_1 = this;
|
|
1055
|
-
if (!isNullOrUndefined(this.grid.dataSource[ready])) {
|
|
1056
|
-
this.grid.dataSource[ready].then(function (e) {
|
|
1082
|
+
if (!isNullOrUndefined(this.grid.dataSource["" + ready])) {
|
|
1083
|
+
this.grid.dataSource["" + ready].then(function (e) {
|
|
1057
1084
|
var dm = proxy_1.grid.dataSource;
|
|
1058
|
-
dm[dataSource].offline = true;
|
|
1059
|
-
dm[isDataAvailable] = true;
|
|
1060
|
-
dm[dataSource].json = e.result;
|
|
1061
|
-
dm[adaptor] = new JsonAdaptor();
|
|
1085
|
+
dm["" + dataSource].offline = true;
|
|
1086
|
+
dm["" + isDataAvailable] = true;
|
|
1087
|
+
dm["" + dataSource].json = e.result;
|
|
1088
|
+
dm["" + adaptor] = new JsonAdaptor();
|
|
1062
1089
|
});
|
|
1063
1090
|
}
|
|
1064
1091
|
}
|
|
@@ -1074,9 +1101,21 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1074
1101
|
if (requestType === 'reorder') {
|
|
1075
1102
|
_this.notify('getColumnIndex', {});
|
|
1076
1103
|
}
|
|
1104
|
+
if (isRemoteData(_this) && _this.enableVirtualization) {
|
|
1105
|
+
if (args.requestType === 'virtualscroll') {
|
|
1106
|
+
_this.query.expand('VirtualScrollingAction');
|
|
1107
|
+
_this.showSpinner();
|
|
1108
|
+
}
|
|
1109
|
+
else if (args.requestType === 'searching' && args.searchString === '') {
|
|
1110
|
+
_this.query.expand('ClearSearchingAction');
|
|
1111
|
+
}
|
|
1112
|
+
else if (args.action === 'clearFilter') {
|
|
1113
|
+
_this.query.expand('ClearFilteringAction');
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1077
1116
|
_this.notify('actionBegin', { editAction: args });
|
|
1078
1117
|
if (!isRemoteData(_this) && !isNullOrUndefined(_this.filterModule) && !isCountRequired(_this)
|
|
1079
|
-
&& (_this.grid.filterSettings.columns.length === 0
|
|
1118
|
+
&& (_this.grid.filterSettings.columns.length === 0 && _this.grid.searchSettings.key.length === 0)) {
|
|
1080
1119
|
_this.notify('clearFilters', { flatData: _this.grid.dataSource });
|
|
1081
1120
|
_this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
|
|
1082
1121
|
if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
|
|
@@ -1116,6 +1155,19 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1116
1155
|
if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
|
|
1117
1156
|
_this.grid.refresh();
|
|
1118
1157
|
}
|
|
1158
|
+
if (args.action === 'filter') {
|
|
1159
|
+
if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
|
|
1160
|
+
_this.expandAll();
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
if (args.requestType === 'searching') {
|
|
1164
|
+
if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
|
|
1165
|
+
_this.expandAll();
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
if (args.action === 'clearFilter' && _this.enableCollapseAll) {
|
|
1169
|
+
_this.collapseAll();
|
|
1170
|
+
}
|
|
1119
1171
|
if (_this.action === 'indenting' || _this.action === 'outdenting') {
|
|
1120
1172
|
_this.action = _this.action === 'indenting' ? 'indented' : 'outdented';
|
|
1121
1173
|
var selectedItem_1 = [_this.selectedRecords];
|
|
@@ -1138,6 +1190,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1138
1190
|
_this.selectedRecords = _this.selectedRows = _this.modifiedRecords = [];
|
|
1139
1191
|
}
|
|
1140
1192
|
else {
|
|
1193
|
+
if (_this.grid.isFrozenGrid() && _this.enableVirtualization && args['tableName'] === 'movable') {
|
|
1194
|
+
var movableContent = _this.grid.element.querySelector('.' + literals.movableContent);
|
|
1195
|
+
var frozenContent = _this.grid.element.querySelector('.' + literals.frozenContent);
|
|
1196
|
+
movableContent.style.height = frozenContent.style.height = 'auto';
|
|
1197
|
+
}
|
|
1141
1198
|
_this.trigger(events.actionComplete, args);
|
|
1142
1199
|
}
|
|
1143
1200
|
};
|
|
@@ -1220,7 +1277,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1220
1277
|
this.bindGridEvents();
|
|
1221
1278
|
setValue('registeredTemplate', this.registeredTemplate, this.grid);
|
|
1222
1279
|
var ref = 'viewContainerRef';
|
|
1223
|
-
setValue('viewContainerRef', this[ref], this.grid);
|
|
1280
|
+
setValue('viewContainerRef', this["" + ref], this.grid);
|
|
1224
1281
|
};
|
|
1225
1282
|
/**
|
|
1226
1283
|
* AutoGenerate TreeGrid columns from first record
|
|
@@ -1238,8 +1295,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1238
1295
|
// }
|
|
1239
1296
|
var keys = Object.keys(record);
|
|
1240
1297
|
for (var i = 0; i < keys.length; i++) {
|
|
1241
|
-
if ([this.childMapping, this.parentIdMapping].indexOf(keys[i]) === -1) {
|
|
1242
|
-
this.columns.push(keys[i]);
|
|
1298
|
+
if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
1299
|
+
this.columns.push(keys[parseInt(i.toString(), 10)]);
|
|
1243
1300
|
}
|
|
1244
1301
|
}
|
|
1245
1302
|
}
|
|
@@ -1256,7 +1313,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1256
1313
|
edit.template = this.editSettings.template;
|
|
1257
1314
|
edit.showDeleteConfirmDialog = this.editSettings.showDeleteConfirmDialog;
|
|
1258
1315
|
edit.allowNextRowEdit = this.editSettings.allowNextRowEdit;
|
|
1259
|
-
edit[guid] = this.editSettings[guid];
|
|
1316
|
+
edit["" + guid] = this.editSettings["" + guid];
|
|
1260
1317
|
edit.dialog = this.editSettings.dialog;
|
|
1261
1318
|
switch (this.editSettings.mode) {
|
|
1262
1319
|
case 'Dialog':
|
|
@@ -1285,15 +1342,25 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1285
1342
|
if (this.contextMenuItems) {
|
|
1286
1343
|
var items = [];
|
|
1287
1344
|
for (var i = 0; i < this.contextMenuItems.length; i++) {
|
|
1288
|
-
switch (this.contextMenuItems[i]) {
|
|
1345
|
+
switch (this.contextMenuItems[parseInt(i.toString(), 10)]) {
|
|
1289
1346
|
case 'AddRow':
|
|
1290
1347
|
case ContextMenuItems.AddRow:
|
|
1291
1348
|
items.push({ text: this.l10n.getConstant('AddRow'),
|
|
1292
1349
|
target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',
|
|
1293
1350
|
items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });
|
|
1294
1351
|
break;
|
|
1352
|
+
case 'Indent':
|
|
1353
|
+
case ContextMenuItems.RowIndent:
|
|
1354
|
+
items.push({ text: this.l10n.getConstant('RowIndent'),
|
|
1355
|
+
target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });
|
|
1356
|
+
break;
|
|
1357
|
+
case 'Outdent':
|
|
1358
|
+
case ContextMenuItems.RowOutdent:
|
|
1359
|
+
items.push({ text: this.l10n.getConstant('RowOutdent'),
|
|
1360
|
+
target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
|
|
1361
|
+
break;
|
|
1295
1362
|
default:
|
|
1296
|
-
items.push(this.contextMenuItems[i]);
|
|
1363
|
+
items.push(this.contextMenuItems[parseInt(i.toString(), 10)]);
|
|
1297
1364
|
}
|
|
1298
1365
|
}
|
|
1299
1366
|
return items;
|
|
@@ -1310,10 +1377,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1310
1377
|
*/
|
|
1311
1378
|
TreeGrid.prototype.getGridToolbar = function () {
|
|
1312
1379
|
if (this.toolbar) {
|
|
1380
|
+
this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);
|
|
1313
1381
|
var items = [];
|
|
1314
1382
|
var tooltipText = void 0;
|
|
1315
1383
|
for (var i = 0; i < this.toolbar.length; i++) {
|
|
1316
|
-
switch (this.toolbar[i]) {
|
|
1384
|
+
switch (this.toolbar[parseInt(i.toString(), 10)]) {
|
|
1317
1385
|
case 'Search':
|
|
1318
1386
|
case ToolbarItem.Search:
|
|
1319
1387
|
items.push('Search');
|
|
@@ -1352,7 +1420,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1352
1420
|
});
|
|
1353
1421
|
break;
|
|
1354
1422
|
default:
|
|
1355
|
-
items.push(this.toolbar[i]);
|
|
1423
|
+
items.push(this.toolbar[parseInt(i.toString(), 10)]);
|
|
1356
1424
|
}
|
|
1357
1425
|
}
|
|
1358
1426
|
return items;
|
|
@@ -1371,32 +1439,37 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1371
1439
|
}
|
|
1372
1440
|
var treeGridColumn;
|
|
1373
1441
|
var gridColumn;
|
|
1374
|
-
|
|
1442
|
+
if (this.columnModel.length === 0) {
|
|
1443
|
+
index = index === 0 ? -1 : index;
|
|
1444
|
+
}
|
|
1375
1445
|
var gridColumnCollection = [];
|
|
1376
1446
|
for (var i = 0; i < column.length; i++) {
|
|
1377
1447
|
index = index + 1;
|
|
1378
|
-
var treeColumn = this.grid.getColumnByUid(column[i].uid);
|
|
1448
|
+
var treeColumn = this.grid.getColumnByUid(column[parseInt(i.toString(), 10)].uid);
|
|
1379
1449
|
gridColumn = treeColumn ? treeColumn : {};
|
|
1380
1450
|
treeGridColumn = {};
|
|
1381
|
-
if (typeof this.columns[i] === 'string') {
|
|
1382
|
-
gridColumn.field = treeGridColumn.field = this.columns[i];
|
|
1451
|
+
if (typeof this.columns[parseInt(i.toString(), 10)] === 'string') {
|
|
1452
|
+
gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
|
|
1383
1453
|
}
|
|
1384
1454
|
else {
|
|
1385
|
-
for (var _i = 0, _a = Object.keys(column[i]); _i < _a.length; _i++) {
|
|
1455
|
+
for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
|
|
1386
1456
|
var prop = _a[_i];
|
|
1387
1457
|
if (index === this.treeColumnIndex && prop === 'template') {
|
|
1388
|
-
treeGridColumn[prop] = column[i][prop];
|
|
1458
|
+
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1459
|
+
}
|
|
1460
|
+
else if (prop === 'columns' && !isNullOrUndefined(column[parseInt(i.toString(), 10)]["" + prop])) {
|
|
1461
|
+
gridColumn["" + prop] = this.getGridColumns(column[parseInt(i.toString(), 10)]["" + prop], false, this.columnModel.length - 1);
|
|
1462
|
+
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1389
1463
|
}
|
|
1390
|
-
else if (
|
|
1391
|
-
gridColumn[prop] =
|
|
1392
|
-
treeGridColumn[prop] = column[i][prop];
|
|
1464
|
+
else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {
|
|
1465
|
+
gridColumn["" + prop] = treeGridColumn["" + prop] = treeColumn["" + prop];
|
|
1393
1466
|
}
|
|
1394
1467
|
else if (!(treeColumn) || prop !== 'sortComparer') {
|
|
1395
|
-
gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
|
|
1468
|
+
gridColumn["" + prop] = treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1396
1469
|
}
|
|
1397
1470
|
}
|
|
1398
1471
|
}
|
|
1399
|
-
if (!treeGridColumn[stackedColumn]) {
|
|
1472
|
+
if (!treeGridColumn["" + stackedColumn]) {
|
|
1400
1473
|
this.columnModel.push(new Column(treeGridColumn));
|
|
1401
1474
|
}
|
|
1402
1475
|
gridColumnCollection.push(gridColumn);
|
|
@@ -1516,7 +1589,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1516
1589
|
this.grid.query = this.query;
|
|
1517
1590
|
break;
|
|
1518
1591
|
case 'enableCollapseAll':
|
|
1519
|
-
if (newProp[prop]) {
|
|
1592
|
+
if (newProp["" + prop]) {
|
|
1520
1593
|
this.collapseAll();
|
|
1521
1594
|
}
|
|
1522
1595
|
else {
|
|
@@ -1555,6 +1628,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1555
1628
|
break;
|
|
1556
1629
|
case 'locale':
|
|
1557
1630
|
this.grid.locale = this.locale;
|
|
1631
|
+
this.TreeGridLocale();
|
|
1632
|
+
this.grid.toolbar = this.getGridToolbar();
|
|
1633
|
+
this.grid.contextMenuItems = this.getContextMenu();
|
|
1558
1634
|
break;
|
|
1559
1635
|
case 'selectedRowIndex':
|
|
1560
1636
|
this.grid.selectedRowIndex = this.selectedRowIndex;
|
|
@@ -1612,8 +1688,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1612
1688
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
1613
1689
|
break;
|
|
1614
1690
|
case 'editSettings':
|
|
1615
|
-
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[prop].mode &&
|
|
1616
|
-
(newProp[prop].mode === 'Cell' || newProp[prop].mode === 'Row')) {
|
|
1691
|
+
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
|
|
1692
|
+
(newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
|
|
1617
1693
|
this.grid.closeEdit();
|
|
1618
1694
|
}
|
|
1619
1695
|
this.grid.editSettings = this.getGridEditSettings();
|
|
@@ -1660,8 +1736,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1660
1736
|
'pagerModule', 'keyboardModule', 'columnMenuModule', 'contextMenuModule', 'editModule', 'virtualScrollModule',
|
|
1661
1737
|
'selectionModule', 'detailRow', 'rowDragAndDropModule', 'freezeModule'];
|
|
1662
1738
|
for (var i = 0; i < modules.length; i++) {
|
|
1663
|
-
if (this[modules[i]]) {
|
|
1664
|
-
this[modules[i]] = null;
|
|
1739
|
+
if (this[modules[parseInt(i.toString(), 10)]]) {
|
|
1740
|
+
this[modules[parseInt(i.toString(), 10)]] = null;
|
|
1665
1741
|
}
|
|
1666
1742
|
}
|
|
1667
1743
|
this.element.innerHTML = '';
|
|
@@ -1704,10 +1780,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1704
1780
|
var ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',
|
|
1705
1781
|
'commandTemplate', 'commands', 'dataSource'];
|
|
1706
1782
|
for (var i = 0; i < keyEntity.length; i++) {
|
|
1707
|
-
var currentObject = this[keyEntity[i]];
|
|
1708
|
-
for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
1709
|
-
var objVal = val[k];
|
|
1710
|
-
delete currentObject[objVal];
|
|
1783
|
+
var currentObject = this[keyEntity[parseInt(i.toString(), 10)]];
|
|
1784
|
+
for (var k = 0, val = ignoreOnPersist[keyEntity[parseInt(i.toString(), 10)]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
1785
|
+
var objVal = val[parseInt(k.toString(), 10)];
|
|
1786
|
+
delete currentObject["" + objVal];
|
|
1711
1787
|
}
|
|
1712
1788
|
}
|
|
1713
1789
|
this.ignoreInArrays(ignoreOnColumn, this.columns);
|
|
@@ -1715,18 +1791,18 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1715
1791
|
};
|
|
1716
1792
|
TreeGrid.prototype.ignoreInArrays = function (ignoreOnColumn, columns) {
|
|
1717
1793
|
for (var i = 0; i < columns.length; i++) {
|
|
1718
|
-
if (columns[i].columns) {
|
|
1719
|
-
this.ignoreInColumn(ignoreOnColumn, columns[i]);
|
|
1720
|
-
this.ignoreInArrays(ignoreOnColumn, columns[i].columns);
|
|
1794
|
+
if (columns[parseInt(i.toString(), 10)].columns) {
|
|
1795
|
+
this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);
|
|
1796
|
+
this.ignoreInArrays(ignoreOnColumn, columns[parseInt(i.toString(), 10)].columns);
|
|
1721
1797
|
}
|
|
1722
1798
|
else {
|
|
1723
|
-
this.ignoreInColumn(ignoreOnColumn, columns[i]);
|
|
1799
|
+
this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);
|
|
1724
1800
|
}
|
|
1725
1801
|
}
|
|
1726
1802
|
};
|
|
1727
1803
|
TreeGrid.prototype.ignoreInColumn = function (ignoreOnColumn, column) {
|
|
1728
1804
|
for (var i = 0; i < ignoreOnColumn.length; i++) {
|
|
1729
|
-
delete column[ignoreOnColumn[i]];
|
|
1805
|
+
delete column[ignoreOnColumn[parseInt(i.toString(), 10)]];
|
|
1730
1806
|
column.filter = {};
|
|
1731
1807
|
}
|
|
1732
1808
|
};
|
|
@@ -1770,7 +1846,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1770
1846
|
TreeGrid.prototype.addRecord = function (data, index, position) {
|
|
1771
1847
|
if (this.editModule) {
|
|
1772
1848
|
var isAddedRowByMethod = 'isAddedRowByMethod';
|
|
1773
|
-
this.editModule[isAddedRowByMethod] = true;
|
|
1849
|
+
this.editModule["" + isAddedRowByMethod] = true;
|
|
1774
1850
|
this.editModule.addRecord(data, index, position);
|
|
1775
1851
|
}
|
|
1776
1852
|
};
|
|
@@ -1817,7 +1893,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1817
1893
|
TreeGrid.prototype.updateRow = function (index, data) {
|
|
1818
1894
|
if (this.grid.editModule) {
|
|
1819
1895
|
if (!isNullOrUndefined(index)) {
|
|
1820
|
-
var griddata = this.grid.getCurrentViewRecords()[index];
|
|
1896
|
+
var griddata = this.grid.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
1821
1897
|
extend(griddata, data);
|
|
1822
1898
|
this.grid.editModule.updateRow(index, griddata);
|
|
1823
1899
|
}
|
|
@@ -1927,7 +2003,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1927
2003
|
TreeGrid.prototype.setCellValue = function (key, field, value) {
|
|
1928
2004
|
this.grid.setCellValue(key, field, value);
|
|
1929
2005
|
var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
|
|
1930
|
-
var record = this.getCurrentViewRecords()[rowIndex];
|
|
2006
|
+
var record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
|
|
1931
2007
|
if (!isNullOrUndefined(record)) {
|
|
1932
2008
|
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
|
|
1933
2009
|
}
|
|
@@ -1946,7 +2022,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1946
2022
|
var level = 0;
|
|
1947
2023
|
var record = {};
|
|
1948
2024
|
currentRecords.some(function (value) {
|
|
1949
|
-
if (value[primaryKey] === key) {
|
|
2025
|
+
if (value["" + primaryKey] === key) {
|
|
1950
2026
|
record = value;
|
|
1951
2027
|
return true;
|
|
1952
2028
|
}
|
|
@@ -1967,7 +2043,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1967
2043
|
rowData.expanded = record.expanded;
|
|
1968
2044
|
this.grid.setRowData(key, rowData);
|
|
1969
2045
|
var visibleRecords = this.getVisibleRecords();
|
|
1970
|
-
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
|
|
2046
|
+
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])["" + primaryKey]) {
|
|
1971
2047
|
var table = this.getContentTable();
|
|
1972
2048
|
var sHeight = table.scrollHeight;
|
|
1973
2049
|
var clientHeight = this.getContent().clientHeight;
|
|
@@ -2030,7 +2106,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2030
2106
|
var Columns = this.initialRender ? this.grid.columns : this.columns;
|
|
2031
2107
|
var columnModel = 'columnModel';
|
|
2032
2108
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2033
|
-
Columns = this.grid[columnModel];
|
|
2109
|
+
Columns = this.grid["" + columnModel];
|
|
2034
2110
|
}
|
|
2035
2111
|
return iterateArrayOrObject(Columns, function (item) {
|
|
2036
2112
|
if (item.uid === uid) {
|
|
@@ -2123,7 +2199,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2123
2199
|
};
|
|
2124
2200
|
TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {
|
|
2125
2201
|
var columnModel = 'columnModel';
|
|
2126
|
-
var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {
|
|
2202
|
+
var index = iterateArrayOrObject(this.grid["" + columnModel], function (item, index) {
|
|
2127
2203
|
if (item.uid === uid) {
|
|
2128
2204
|
return index;
|
|
2129
2205
|
}
|
|
@@ -2164,25 +2240,25 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2164
2240
|
this.columnModel = [];
|
|
2165
2241
|
for (var i = 0; i < gridColumns.length; i++) {
|
|
2166
2242
|
gridColumn = {};
|
|
2167
|
-
for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {
|
|
2243
|
+
for (var _i = 0, _a = Object.keys(gridColumns[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
|
|
2168
2244
|
var prop = _a[_i];
|
|
2169
|
-
gridColumn[prop] = gridColumns[i][prop];
|
|
2245
|
+
gridColumn["" + prop] = gridColumns[parseInt(i.toString(), 10)]["" + prop];
|
|
2170
2246
|
}
|
|
2171
2247
|
this.columnModel.push(new Column(gridColumn));
|
|
2172
|
-
if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2173
|
-
this.columnModel[i].template = temp;
|
|
2248
|
+
if (field === this.columnModel[parseInt(i.toString(), 10)].field && this.columnModel[parseInt(i.toString(), 10)].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2249
|
+
this.columnModel[parseInt(i.toString(), 10)].template = temp;
|
|
2174
2250
|
}
|
|
2175
2251
|
}
|
|
2176
2252
|
}
|
|
2177
|
-
var
|
|
2178
|
-
this[
|
|
2253
|
+
var deepMerge = 'deepMerge';
|
|
2254
|
+
this["" + deepMerge] = ['columns']; // Workaround for blazor updateModel
|
|
2179
2255
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2180
2256
|
this.stackedHeader = true;
|
|
2181
2257
|
}
|
|
2182
2258
|
if (!this.stackedHeader) {
|
|
2183
|
-
this.
|
|
2259
|
+
merge(this.columns, this.columnModel);
|
|
2184
2260
|
}
|
|
2185
|
-
this[
|
|
2261
|
+
this["" + deepMerge] = undefined; // Workaround for blazor updateModel
|
|
2186
2262
|
return this.columnModel;
|
|
2187
2263
|
};
|
|
2188
2264
|
/**
|
|
@@ -2195,11 +2271,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2195
2271
|
};
|
|
2196
2272
|
TreeGrid.prototype.mergePersistTreeGridData = function () {
|
|
2197
2273
|
var persist1 = 'mergePersistGridData';
|
|
2198
|
-
this.grid[persist1].apply(this);
|
|
2274
|
+
this.grid["" + persist1].apply(this);
|
|
2199
2275
|
};
|
|
2200
2276
|
TreeGrid.prototype.mergeColumns = function (storedColumn, columns) {
|
|
2201
2277
|
var persist2 = 'mergeColumns';
|
|
2202
|
-
this.grid[persist2].apply(this, [storedColumn, columns]);
|
|
2278
|
+
this.grid["" + persist2].apply(this, [storedColumn, columns]);
|
|
2203
2279
|
};
|
|
2204
2280
|
TreeGrid.prototype.updateTreeGridModel = function () {
|
|
2205
2281
|
this.setProperties({ filterSettings: getObject('properties', this.grid.filterSettings) }, true);
|
|
@@ -2224,8 +2300,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2224
2300
|
var dRows = [];
|
|
2225
2301
|
var rows = this.grid.getDataRows();
|
|
2226
2302
|
for (var i = 0, len = rows.length; i < len; i++) {
|
|
2227
|
-
if (!rows[i].classList.contains('e-summaryrow')) {
|
|
2228
|
-
dRows.push(rows[i]);
|
|
2303
|
+
if (!rows[parseInt(i.toString(), 10)].classList.contains('e-summaryrow')) {
|
|
2304
|
+
dRows.push(rows[parseInt(i.toString(), 10)]);
|
|
2229
2305
|
}
|
|
2230
2306
|
}
|
|
2231
2307
|
return dRows;
|
|
@@ -2361,9 +2437,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2361
2437
|
var currentViewRecords = this.getCurrentViewRecords();
|
|
2362
2438
|
if (!this.allowPaging) {
|
|
2363
2439
|
for (var i = 0; i < currentViewRecords.length; i++) {
|
|
2364
|
-
visibleRecords.push(currentViewRecords[i]);
|
|
2365
|
-
if (!currentViewRecords[i].expanded) {
|
|
2366
|
-
i += findChildrenRecords(currentViewRecords[i]).length;
|
|
2440
|
+
visibleRecords.push(currentViewRecords[parseInt(i.toString(), 10)]);
|
|
2441
|
+
if (!currentViewRecords[parseInt(i.toString(), 10)].expanded) {
|
|
2442
|
+
i += findChildrenRecords(currentViewRecords[parseInt(i.toString(), 10)]).length;
|
|
2367
2443
|
}
|
|
2368
2444
|
}
|
|
2369
2445
|
}
|
|
@@ -2423,10 +2499,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2423
2499
|
if (this.editSettings.mode === 'Batch') {
|
|
2424
2500
|
var obj = 'dialogObj';
|
|
2425
2501
|
var showDialog = 'showDialog';
|
|
2426
|
-
if (this.getBatchChanges()[this.changedRecords].length ||
|
|
2427
|
-
this.getBatchChanges()[this.
|
|
2428
|
-
var dialogObj = this.grid.editModule[obj];
|
|
2429
|
-
this.grid.editModule[showDialog]('CancelEdit', dialogObj);
|
|
2502
|
+
if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
|
|
2503
|
+
this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
|
|
2504
|
+
var dialogObj = this.grid.editModule["" + obj];
|
|
2505
|
+
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
2430
2506
|
this.targetElement = target;
|
|
2431
2507
|
return;
|
|
2432
2508
|
}
|
|
@@ -2442,16 +2518,20 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2442
2518
|
}
|
|
2443
2519
|
}
|
|
2444
2520
|
else {
|
|
2445
|
-
var
|
|
2446
|
-
var record =
|
|
2521
|
+
var rowInfo_1 = this.grid.getRowInfo(target);
|
|
2522
|
+
var record = rowInfo_1.rowData;
|
|
2523
|
+
if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {
|
|
2524
|
+
var freezeRows = 'freezeRows';
|
|
2525
|
+
record = this.grid.contentModule["" + freezeRows].filter(function (e) { return e.uid === rowInfo_1.row.getAttribute('data-uid'); })[0].data;
|
|
2526
|
+
}
|
|
2447
2527
|
if (this.enableImmutableMode) {
|
|
2448
|
-
record = this.getCurrentViewRecords()[
|
|
2528
|
+
record = this.getCurrentViewRecords()[rowInfo_1.rowIndex];
|
|
2449
2529
|
}
|
|
2450
2530
|
if (target.classList.contains('e-treegridexpand')) {
|
|
2451
|
-
this.collapseRow(
|
|
2531
|
+
this.collapseRow(rowInfo_1.row, record);
|
|
2452
2532
|
}
|
|
2453
2533
|
else {
|
|
2454
|
-
this.expandRow(
|
|
2534
|
+
this.expandRow(rowInfo_1.row, record);
|
|
2455
2535
|
}
|
|
2456
2536
|
}
|
|
2457
2537
|
};
|
|
@@ -2478,7 +2558,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2478
2558
|
_this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
2479
2559
|
}
|
|
2480
2560
|
var children = 'Children';
|
|
2481
|
-
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
|
|
2561
|
+
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record["" + children]))) {
|
|
2482
2562
|
var collapseArgs = { data: record, row: row };
|
|
2483
2563
|
_this.setHeightForFrozenContent();
|
|
2484
2564
|
if (!isNullOrUndefined(_this.expandStateMapping)) {
|
|
@@ -2499,7 +2579,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2499
2579
|
});
|
|
2500
2580
|
records.unshift(record);
|
|
2501
2581
|
for (var i = 0; i < records.length; i++) {
|
|
2502
|
-
this.expandCollapse(action, null, records[i]);
|
|
2582
|
+
this.expandCollapse(action, null, records[parseInt(i.toString(), 10)]);
|
|
2503
2583
|
}
|
|
2504
2584
|
};
|
|
2505
2585
|
TreeGrid.prototype.setHeightForFrozenContent = function () {
|
|
@@ -2517,10 +2597,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2517
2597
|
}
|
|
2518
2598
|
else if (isNullOrUndefined(record)) {
|
|
2519
2599
|
if (this.detailTemplate) {
|
|
2520
|
-
record = this.grid.getCurrentViewRecords()[row.getAttribute('
|
|
2600
|
+
record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
|
|
2521
2601
|
}
|
|
2522
2602
|
else {
|
|
2523
|
-
record = this.grid.getCurrentViewRecords()[row.
|
|
2603
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
2524
2604
|
}
|
|
2525
2605
|
}
|
|
2526
2606
|
return record;
|
|
@@ -2565,12 +2645,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2565
2645
|
var totalRecords = record;
|
|
2566
2646
|
if (totalRecords.length) {
|
|
2567
2647
|
for (var i = 0; i < totalRecords.length; i++) {
|
|
2568
|
-
totalRecords[i][this.expandStateMapping] = state;
|
|
2569
|
-
editAction({ value: totalRecords[i], action: 'edit' }, this, this.isSelfReference, totalRecords[i].index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2648
|
+
totalRecords[parseInt(i.toString(), 10)][this.expandStateMapping] = state;
|
|
2649
|
+
editAction({ value: totalRecords[parseInt(i.toString(), 10)], action: 'edit' }, this, this.isSelfReference, totalRecords[parseInt(i.toString(), 10)].index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2570
2650
|
}
|
|
2571
2651
|
}
|
|
2572
2652
|
else {
|
|
2573
|
-
record[this.expandStateMapping] = state;
|
|
2653
|
+
record["" + this.expandStateMapping] = state;
|
|
2574
2654
|
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2575
2655
|
}
|
|
2576
2656
|
};
|
|
@@ -2608,8 +2688,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2608
2688
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
2609
2689
|
if (isPaging === void 0) { isPaging = false; }
|
|
2610
2690
|
var _loop_1 = function (i) {
|
|
2611
|
-
if (!isNullOrUndefined(record[i].parentItem)) {
|
|
2612
|
-
var puniqueID_1 = record[i].parentItem.uniqueID;
|
|
2691
|
+
if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
|
|
2692
|
+
var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
|
|
2613
2693
|
var parentItem = this_1.flatData.filter(function (e) {
|
|
2614
2694
|
return e.uniqueID === puniqueID_1;
|
|
2615
2695
|
});
|
|
@@ -2631,7 +2711,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2631
2711
|
}
|
|
2632
2712
|
}
|
|
2633
2713
|
if (!isPaging) {
|
|
2634
|
-
this_1.expandRow(null, record[i], key, level);
|
|
2714
|
+
this_1.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
|
|
2635
2715
|
}
|
|
2636
2716
|
};
|
|
2637
2717
|
var this_1 = this;
|
|
@@ -2689,7 +2769,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2689
2769
|
var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
|
|
2690
2770
|
if (!isNullOrUndefined(primaryKeyField)) {
|
|
2691
2771
|
var rec = dataSource.filter(function (e) {
|
|
2692
|
-
return e[primaryKeyField].toString() === key.toString();
|
|
2772
|
+
return e["" + primaryKeyField].toString() === key.toString();
|
|
2693
2773
|
});
|
|
2694
2774
|
if (action === 'Expand') {
|
|
2695
2775
|
this.expandAction(rec, key, null);
|
|
@@ -2706,14 +2786,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2706
2786
|
}
|
|
2707
2787
|
else {
|
|
2708
2788
|
for (var i = 0; i < record.length; i++) {
|
|
2709
|
-
this.collapseRow(null, record[i], key);
|
|
2789
|
+
this.collapseRow(null, record[parseInt(i.toString(), 10)], key);
|
|
2710
2790
|
}
|
|
2711
2791
|
}
|
|
2712
2792
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
2713
2793
|
&& this.parentData.length === this.getRows().length) {
|
|
2714
2794
|
var endIndex = 'endIndex';
|
|
2715
2795
|
this.grid.contentModule.startIndex = -1;
|
|
2716
|
-
this.grid.contentModule[endIndex] = -1;
|
|
2796
|
+
this.grid.contentModule["" + endIndex] = -1;
|
|
2717
2797
|
}
|
|
2718
2798
|
};
|
|
2719
2799
|
/**
|
|
@@ -2748,11 +2828,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2748
2828
|
}
|
|
2749
2829
|
});
|
|
2750
2830
|
if (rows.length) {
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2831
|
+
for (var i = 0; i < rows.length; i++) {
|
|
2832
|
+
if (action === 'collapse') {
|
|
2833
|
+
this.collapseRow(rows[parseInt(i.toString(), 10)]);
|
|
2834
|
+
}
|
|
2835
|
+
else {
|
|
2836
|
+
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
2837
|
+
}
|
|
2756
2838
|
}
|
|
2757
2839
|
}
|
|
2758
2840
|
else if (this.allowPaging) {
|
|
@@ -2765,10 +2847,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2765
2847
|
else {
|
|
2766
2848
|
for (var i = 0; i < rows.length; i++) {
|
|
2767
2849
|
if (action === 'collapse') {
|
|
2768
|
-
this.collapseRow(rows[i]);
|
|
2850
|
+
this.collapseRow(rows[parseInt(i.toString(), 10)]);
|
|
2769
2851
|
}
|
|
2770
2852
|
else {
|
|
2771
|
-
this.expandRow(rows[i]);
|
|
2853
|
+
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
2772
2854
|
}
|
|
2773
2855
|
}
|
|
2774
2856
|
}
|
|
@@ -2781,7 +2863,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2781
2863
|
return e.parentUniqueID === record.uniqueID;
|
|
2782
2864
|
});
|
|
2783
2865
|
var targetEle;
|
|
2784
|
-
if (!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) {
|
|
2866
|
+
if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
|
|
2785
2867
|
this.updateChildOnDemand(expandingArgs);
|
|
2786
2868
|
}
|
|
2787
2869
|
var gridRows = this.getRows();
|
|
@@ -2792,10 +2874,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2792
2874
|
var rowIndex;
|
|
2793
2875
|
if (isNullOrUndefined(row)) {
|
|
2794
2876
|
rowIndex = this.getCurrentViewRecords().indexOf(record);
|
|
2795
|
-
row = gridRows[rowIndex];
|
|
2877
|
+
row = gridRows[parseInt(rowIndex.toString(), 10)];
|
|
2796
2878
|
}
|
|
2797
2879
|
else {
|
|
2798
|
-
rowIndex = +row.getAttribute('
|
|
2880
|
+
rowIndex = +row.getAttribute('data-rowindex');
|
|
2799
2881
|
}
|
|
2800
2882
|
if (!isNullOrUndefined(row)) {
|
|
2801
2883
|
row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
|
|
@@ -2848,6 +2930,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2848
2930
|
}
|
|
2849
2931
|
removeClass([targetEle], 'e-treegridexpand');
|
|
2850
2932
|
}
|
|
2933
|
+
row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
|
|
2851
2934
|
var detailrows = gridRows.filter(function (r) {
|
|
2852
2935
|
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
2853
2936
|
});
|
|
@@ -2859,16 +2942,20 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2859
2942
|
this.localExpand(action, row, record);
|
|
2860
2943
|
}
|
|
2861
2944
|
}
|
|
2945
|
+
if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
|
|
2946
|
+
targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
|
|
2947
|
+
targetEle.closest('.e-treerowcell').removeAttribute('aria-selected');
|
|
2948
|
+
}
|
|
2862
2949
|
if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell')) {
|
|
2863
2950
|
var totalRows = this.getRows();
|
|
2864
2951
|
var rows = this.getContentTable().rows;
|
|
2865
2952
|
totalRows = [].slice.call(rows);
|
|
2866
2953
|
for (var i = totalRows.length - 1; i >= 0; i--) {
|
|
2867
|
-
if (!isHidden(totalRows[i])) {
|
|
2954
|
+
if (!isHidden(totalRows[parseInt(i.toString(), 10)])) {
|
|
2868
2955
|
var table = this.getContentTable();
|
|
2869
2956
|
var sHeight = table.scrollHeight;
|
|
2870
2957
|
var clientHeight = this.getContent().clientHeight;
|
|
2871
|
-
this.lastRowBorder(totalRows[i], sHeight <= clientHeight);
|
|
2958
|
+
this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], sHeight <= clientHeight);
|
|
2872
2959
|
break;
|
|
2873
2960
|
}
|
|
2874
2961
|
}
|
|
@@ -2879,17 +2966,34 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2879
2966
|
};
|
|
2880
2967
|
TreeGrid.prototype.updateChildOnDemand = function (expandingArgs) {
|
|
2881
2968
|
var _this = this;
|
|
2969
|
+
if (expandingArgs.requestType === 'collapse' && isCountRequired(this)) {
|
|
2970
|
+
var flatDataRecords = this.flatData.slice();
|
|
2971
|
+
for (var i = 0; i < flatDataRecords.length; i++) {
|
|
2972
|
+
if (flatDataRecords[parseInt(i.toString(), 10)]['parentUniqueID'] === expandingArgs.data['uniqueID']) {
|
|
2973
|
+
flatDataRecords.splice(i, 1);
|
|
2974
|
+
i = i - 1;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
this.dataResults.result = flatDataRecords;
|
|
2978
|
+
return;
|
|
2979
|
+
}
|
|
2882
2980
|
var deff = new Deferred();
|
|
2883
2981
|
var childDataBind = 'childDataBind';
|
|
2884
|
-
expandingArgs[childDataBind] = deff.resolve;
|
|
2982
|
+
expandingArgs["" + childDataBind] = deff.resolve;
|
|
2885
2983
|
var record = expandingArgs.data;
|
|
2886
2984
|
this.trigger(events.dataStateChange, expandingArgs);
|
|
2887
2985
|
deff.promise.then(function () {
|
|
2888
2986
|
if (expandingArgs.childData.length) {
|
|
2987
|
+
if (isCountRequired(_this)) {
|
|
2988
|
+
_this.flatData = _this.dataResults.result;
|
|
2989
|
+
}
|
|
2990
|
+
if (_this.enableInfiniteScrolling && isCountRequired(_this)) {
|
|
2991
|
+
_this.flatData = _this.infiniteScrollData;
|
|
2992
|
+
}
|
|
2889
2993
|
var currentData = (_this.flatData);
|
|
2890
2994
|
var index = 0;
|
|
2891
2995
|
for (var i = 0; i < currentData.length; i++) {
|
|
2892
|
-
if (currentData[i].taskData === record.taskData) {
|
|
2996
|
+
if (currentData[parseInt(i.toString(), 10)].taskData === record.taskData) {
|
|
2893
2997
|
index = i;
|
|
2894
2998
|
break;
|
|
2895
2999
|
}
|
|
@@ -2906,42 +3010,57 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2906
3010
|
}
|
|
2907
3011
|
});
|
|
2908
3012
|
}
|
|
2909
|
-
if (childData[i]) {
|
|
2910
|
-
childData[i].level = record.level + 1;
|
|
2911
|
-
childData[i].index = Math.ceil(Math.random() * 1000);
|
|
2912
|
-
childData[i].parentItem = extend({}, record);
|
|
2913
|
-
childData[i].taskData = extend({}, childData[i]);
|
|
2914
|
-
delete childData[i].parentItem.childRecords;
|
|
2915
|
-
delete childData[i].taskData.parentItem;
|
|
2916
|
-
childData[i].parentUniqueID = record.uniqueID;
|
|
2917
|
-
childData[i].uniqueID = getUid(_this.element.id + '_data_');
|
|
2918
|
-
setValue('uniqueIDCollection.' + childData[i].uniqueID, childData[i], _this);
|
|
2919
|
-
if (!isNullOrUndefined(childData[i][_this.childMapping]) ||
|
|
2920
|
-
(childData[i][_this.hasChildMapping] && isCountRequired(_this))) {
|
|
2921
|
-
childData[i].hasChildRecords = true;
|
|
3013
|
+
if (childData[parseInt(i.toString(), 10)]) {
|
|
3014
|
+
childData[parseInt(i.toString(), 10)].level = record.level + 1;
|
|
3015
|
+
childData[parseInt(i.toString(), 10)].index = Math.ceil(Math.random() * 1000);
|
|
3016
|
+
childData[parseInt(i.toString(), 10)].parentItem = extend({}, record);
|
|
3017
|
+
childData[parseInt(i.toString(), 10)].taskData = extend({}, childData[parseInt(i.toString(), 10)]);
|
|
3018
|
+
delete childData[parseInt(i.toString(), 10)].parentItem.childRecords;
|
|
3019
|
+
delete childData[parseInt(i.toString(), 10)].taskData.parentItem;
|
|
3020
|
+
childData[parseInt(i.toString(), 10)].parentUniqueID = record.uniqueID;
|
|
3021
|
+
childData[parseInt(i.toString(), 10)].uniqueID = getUid(_this.element.id + '_data_');
|
|
3022
|
+
setValue('uniqueIDCollection.' + childData[parseInt(i.toString(), 10)].uniqueID, childData[parseInt(i.toString(), 10)], _this);
|
|
3023
|
+
if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)][_this.childMapping]) ||
|
|
3024
|
+
(childData[parseInt(i.toString(), 10)][_this.hasChildMapping] && isCountRequired(_this))) {
|
|
3025
|
+
childData[parseInt(i.toString(), 10)].hasChildRecords = true;
|
|
3026
|
+
}
|
|
3027
|
+
if (isCountRequired(_this) && record[_this.childMapping] && record[_this.childMapping][parseInt(i.toString(), 10)]) {
|
|
3028
|
+
currentData.splice(index + 1 + i, 0, childData[parseInt(i.toString(), 10)]);
|
|
3029
|
+
}
|
|
3030
|
+
else {
|
|
3031
|
+
currentData.splice(index + 1 + i, record[_this.childMapping] &&
|
|
3032
|
+
record[_this.childMapping][parseInt(i.toString(), 10)] ? 1 : 0, childData[parseInt(i.toString(), 10)]);
|
|
2922
3033
|
}
|
|
2923
|
-
currentData.splice(index + 1 + i, record[_this.childMapping] && record[_this.childMapping][i] ? 1 : 0, childData[i]);
|
|
2924
3034
|
}
|
|
2925
3035
|
else {
|
|
2926
3036
|
currentData.splice(index + 1 + i, 1);
|
|
2927
3037
|
}
|
|
2928
3038
|
}
|
|
2929
|
-
currentData[index][_this.childMapping] = childData;
|
|
2930
|
-
currentData[index].childRecords = childData;
|
|
2931
|
-
currentData[index].expanded = true;
|
|
2932
|
-
setValue('uniqueIDCollection.' + currentData[index].uniqueID, currentData[index], _this);
|
|
3039
|
+
currentData[parseInt(index.toString(), 10)]["" + _this.childMapping] = childData;
|
|
3040
|
+
currentData[parseInt(index.toString(), 10)].childRecords = childData;
|
|
3041
|
+
currentData[parseInt(index.toString(), 10)].expanded = true;
|
|
3042
|
+
setValue('uniqueIDCollection.' + currentData[parseInt(index.toString(), 10)].uniqueID, currentData[parseInt(index.toString(), 10)], _this);
|
|
2933
3043
|
for (var j = 0; j < expandingArgs.childData.length; j++) {
|
|
2934
|
-
data_1.push(expandingArgs.childData[j]);
|
|
3044
|
+
data_1.push(expandingArgs.childData[parseInt(j.toString(), 10)]);
|
|
2935
3045
|
}
|
|
2936
3046
|
}
|
|
3047
|
+
if (isCountRequired(_this) && _this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
|
|
3048
|
+
_this.dataResults['expandRecord'] = {};
|
|
3049
|
+
_this.dataResults['expandRecord'] = expandingArgs.data;
|
|
3050
|
+
}
|
|
2937
3051
|
_this.isExpandRefresh = true;
|
|
3052
|
+
var scrollHeightBeforeRefresh = _this.getContentTable().parentElement.scrollTop;
|
|
2938
3053
|
_this.grid.refresh();
|
|
2939
3054
|
_this.setHeightForFrozenContent();
|
|
3055
|
+
if (_this.enableInfiniteScrolling) {
|
|
3056
|
+
_this.getContentTable().parentElement.scrollTop = scrollHeightBeforeRefresh;
|
|
3057
|
+
}
|
|
2940
3058
|
_this.trigger(events.expanded, expandingArgs);
|
|
2941
3059
|
});
|
|
2942
3060
|
};
|
|
2943
3061
|
TreeGrid.prototype.remoteExpand = function (action, row, record) {
|
|
2944
3062
|
var gridRows = this.getRows();
|
|
3063
|
+
var fetchRemoteChildData = 'fetchRemoteChildData';
|
|
2945
3064
|
if (this.rowTemplate) {
|
|
2946
3065
|
var rows_1 = this.getContentTable().rows;
|
|
2947
3066
|
gridRows = [].slice.call(rows_1);
|
|
@@ -2949,7 +3068,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2949
3068
|
var args = { data: record, row: row };
|
|
2950
3069
|
var rows = [];
|
|
2951
3070
|
rows = gridRows.filter(function (r) {
|
|
2952
|
-
return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));
|
|
3071
|
+
return ((r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1))) || (r.querySelector('.e-gridrowindex' + record.index + 'level0' + '.e-summarycell')));
|
|
2953
3072
|
});
|
|
2954
3073
|
if (action === 'expand') {
|
|
2955
3074
|
this.notify(events.remoteExpand, { record: record, rows: rows, parentRow: row });
|
|
@@ -2959,6 +3078,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2959
3078
|
this.trigger(events.expanded, args_1);
|
|
2960
3079
|
}
|
|
2961
3080
|
}
|
|
3081
|
+
else if (action === 'collapse' && this.enableVirtualization) {
|
|
3082
|
+
this.dataModule["" + fetchRemoteChildData]({ action: action, record: args.data, rows: null, parentRow: args.row });
|
|
3083
|
+
}
|
|
2962
3084
|
else {
|
|
2963
3085
|
this.collapseRemoteChild({ record: record, rows: rows });
|
|
2964
3086
|
this.setHeightForFrozenContent();
|
|
@@ -2985,8 +3107,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2985
3107
|
if (this.enableImmutableMode && !this.allowPaging) {
|
|
2986
3108
|
rows = [];
|
|
2987
3109
|
for (var i = 0; i < childRecords.length; i++) {
|
|
2988
|
-
var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[i][primaryKeyField]);
|
|
2989
|
-
rows.push(this.getRows()[rowIndex]);
|
|
3110
|
+
var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]);
|
|
3111
|
+
rows.push(this.getRows()[parseInt(rowIndex.toString(), 10)]);
|
|
2990
3112
|
}
|
|
2991
3113
|
}
|
|
2992
3114
|
else {
|
|
@@ -3005,31 +3127,65 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3005
3127
|
return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));
|
|
3006
3128
|
});
|
|
3007
3129
|
}
|
|
3130
|
+
var gridRowsObject = this.grid.getRowsObject();
|
|
3131
|
+
var currentViewData = this.getCurrentViewRecords();
|
|
3132
|
+
var currentRecord = currentViewData.filter(function (e) {
|
|
3133
|
+
return e.uniqueID === record.uniqueID;
|
|
3134
|
+
});
|
|
3135
|
+
var currentIndex = currentViewData.indexOf(currentRecord[0]);
|
|
3136
|
+
if (!isNullOrUndefined(gridRowsObject[parseInt(currentIndex.toString(), 10)].visible) &&
|
|
3137
|
+
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {
|
|
3138
|
+
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;
|
|
3139
|
+
}
|
|
3140
|
+
var detailrows = gridRows.filter(function (r) {
|
|
3141
|
+
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
3142
|
+
});
|
|
3008
3143
|
for (var i = 0; i < rows.length; i++) {
|
|
3009
|
-
if (!isNullOrUndefined(rows[i])) {
|
|
3010
|
-
rows[i].style.display = displayAction;
|
|
3144
|
+
if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)])) {
|
|
3145
|
+
rows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3146
|
+
}
|
|
3147
|
+
if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization
|
|
3148
|
+
|| this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3149
|
+
gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'none' ? true : false;
|
|
3150
|
+
var parentRecord = currentViewData.filter(function (e) {
|
|
3151
|
+
return e.uniqueID === currentRecord[0].parentUniqueID;
|
|
3152
|
+
});
|
|
3153
|
+
if (!isNullOrUndefined(parentRecord[0]) && gridRows[currentViewData.indexOf(parentRecord[0])].getElementsByClassName('e-treegridcollapse').length) {
|
|
3154
|
+
gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = false;
|
|
3155
|
+
}
|
|
3011
3156
|
}
|
|
3012
3157
|
if (!isNullOrUndefined(movableRows)) {
|
|
3013
|
-
movableRows[i].style.display = displayAction;
|
|
3158
|
+
movableRows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3014
3159
|
}
|
|
3015
3160
|
if (!isNullOrUndefined(freezeRightRows)) {
|
|
3016
|
-
freezeRightRows[i].style.display = displayAction;
|
|
3161
|
+
freezeRightRows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3017
3162
|
}
|
|
3018
|
-
this.notify('childRowExpand', { row: rows[i] });
|
|
3019
|
-
if ((!isNullOrUndefined(childRecords[i].childRecords) && childRecords[i].childRecords.length > 0) && (action !== 'expand' ||
|
|
3020
|
-
isNullOrUndefined(childRecords[i].expanded) || childRecords[i].expanded)) {
|
|
3021
|
-
this.expandCollapse(action, rows[i], childRecords[i], true);
|
|
3163
|
+
this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });
|
|
3164
|
+
if ((!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||
|
|
3165
|
+
isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {
|
|
3166
|
+
this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
|
|
3022
3167
|
if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {
|
|
3023
|
-
this.expandCollapse(action, movableRows[i], childRecords[i], true);
|
|
3168
|
+
this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
|
|
3024
3169
|
}
|
|
3025
3170
|
}
|
|
3026
3171
|
}
|
|
3172
|
+
for (var i = 0; i < detailrows.length; i++) {
|
|
3173
|
+
if (!isNullOrUndefined(detailrows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization
|
|
3174
|
+
|| this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3175
|
+
gridRowsObject[detailrows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'none' ? true : false;
|
|
3176
|
+
detailrows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this)
|
|
3180
|
+
|| isCountRequired(this))) {
|
|
3181
|
+
this.grid.notify('refresh-Expand-and-Collapse', { rows: this.grid.getRowsObject() });
|
|
3182
|
+
}
|
|
3027
3183
|
};
|
|
3028
3184
|
TreeGrid.prototype.updateAltRow = function (rows) {
|
|
3029
3185
|
if (this.enableAltRow && !this.rowTemplate) {
|
|
3030
3186
|
var visibleRowCount = 0;
|
|
3031
3187
|
for (var i = 0; rows && i < rows.length; i++) {
|
|
3032
|
-
var gridRow = rows[i];
|
|
3188
|
+
var gridRow = rows[parseInt(i.toString(), 10)];
|
|
3033
3189
|
if (gridRow.style.display !== 'none') {
|
|
3034
3190
|
if (gridRow.classList.contains('e-altrow')) {
|
|
3035
3191
|
removeClass([gridRow], 'e-altrow');
|
|
@@ -3049,9 +3205,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3049
3205
|
var rows = this.getContentTable().rows;
|
|
3050
3206
|
rows = [].slice.call(rows);
|
|
3051
3207
|
for (var i = 0; i < rows.length; i++) {
|
|
3052
|
-
var rcell = this.grid.getContentTable().rows[i
|
|
3053
|
-
|
|
3054
|
-
var
|
|
3208
|
+
var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
|
|
3209
|
+
.cells[this.treeColumnIndex];
|
|
3210
|
+
var row = rows[parseInt(i.toString(), 10)];
|
|
3211
|
+
var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
|
|
3055
3212
|
var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
|
|
3056
3213
|
this.renderModule.cellRender(arg);
|
|
3057
3214
|
}
|
|
@@ -3076,28 +3233,28 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3076
3233
|
});
|
|
3077
3234
|
}
|
|
3078
3235
|
for (var i = 0; i < rows.length; i++) {
|
|
3079
|
-
rows[i].style.display = 'none';
|
|
3080
|
-
row = rows[i];
|
|
3081
|
-
var collapsingTd = rows[i].querySelector('.e-detailrowexpand');
|
|
3236
|
+
rows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3237
|
+
row = rows[parseInt(i.toString(), 10)];
|
|
3238
|
+
var collapsingTd = rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowexpand');
|
|
3082
3239
|
if (!isNullOrUndefined(collapsingTd)) {
|
|
3083
3240
|
this.grid.detailRowModule.collapse(collapsingTd);
|
|
3084
3241
|
}
|
|
3085
3242
|
if (freeze) {
|
|
3086
|
-
movablerows[i].style.display = 'none';
|
|
3087
|
-
rightrows[i].style.display = 'none';
|
|
3088
|
-
if (!rows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3089
|
-
if (movablerows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3090
|
-
row = movablerows[i];
|
|
3243
|
+
movablerows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3244
|
+
rightrows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3245
|
+
if (!rows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3246
|
+
if (movablerows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3247
|
+
row = movablerows[parseInt(i.toString(), 10)];
|
|
3091
3248
|
}
|
|
3092
|
-
else if (rightrows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3093
|
-
row = rightrows[i];
|
|
3249
|
+
else if (rightrows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3250
|
+
row = rightrows[parseInt(i.toString(), 10)];
|
|
3094
3251
|
}
|
|
3095
3252
|
}
|
|
3096
3253
|
}
|
|
3097
3254
|
if (row.querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3098
3255
|
var expandElement = row.querySelector('.e-treecolumn-container .e-treegridexpand');
|
|
3099
|
-
childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[i].rowIndex] :
|
|
3100
|
-
this.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
|
|
3256
|
+
childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex] :
|
|
3257
|
+
this.grid.getRowObjectFromUID(rows[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;
|
|
3101
3258
|
if (!isNullOrUndefined(expandElement) && childRecord.expanded) {
|
|
3102
3259
|
removeClass([expandElement], 'e-treegridexpand');
|
|
3103
3260
|
addClass([expandElement], 'e-treegridcollapse');
|
|
@@ -3105,8 +3262,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3105
3262
|
var cRow = [];
|
|
3106
3263
|
var eRows = this.getRows();
|
|
3107
3264
|
for (var i_1 = 0; i_1 < eRows.length; i_1++) {
|
|
3108
|
-
if (eRows[i_1].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {
|
|
3109
|
-
cRow.push(eRows[i_1]);
|
|
3265
|
+
if (eRows[parseInt(i_1.toString(), 10)].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {
|
|
3266
|
+
cRow.push(eRows[parseInt(i_1.toString(), 10)]);
|
|
3110
3267
|
}
|
|
3111
3268
|
}
|
|
3112
3269
|
if (cRow.length && childRecord.expanded) {
|
|
@@ -3126,13 +3283,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3126
3283
|
TreeGrid.prototype.updateRowAndCellElements = function (records, rows, index) {
|
|
3127
3284
|
for (var i = 0; i < records.length; i++) {
|
|
3128
3285
|
this.renderModule.cellRender({
|
|
3129
|
-
data: records[i], cell: rows[i].cells[index],
|
|
3286
|
+
data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
|
|
3130
3287
|
column: this.grid.getColumns()[this.treeColumnIndex],
|
|
3131
3288
|
requestType: 'rowDragAndDrop'
|
|
3132
3289
|
});
|
|
3133
3290
|
if (this['action'] === 'indenting' || this['action'] === 'outdenting') {
|
|
3134
3291
|
this.renderModule.RowModifier({
|
|
3135
|
-
data: records[i], row: rows[i]
|
|
3292
|
+
data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
|
|
3136
3293
|
});
|
|
3137
3294
|
}
|
|
3138
3295
|
}
|
|
@@ -3435,11 +3592,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3435
3592
|
};
|
|
3436
3593
|
TreeGrid.prototype.getFrozenCount = function (cols, cnt) {
|
|
3437
3594
|
for (var j = 0, len = cols.length; j < len; j++) {
|
|
3438
|
-
if (cols[j].columns) {
|
|
3439
|
-
cnt = this.getFrozenCount(cols[j].columns, cnt);
|
|
3595
|
+
if (cols[parseInt(j.toString(), 10)].columns) {
|
|
3596
|
+
cnt = this.getFrozenCount(cols[parseInt(j.toString(), 10)].columns, cnt);
|
|
3440
3597
|
}
|
|
3441
3598
|
else {
|
|
3442
|
-
if (cols[j].isFrozen) {
|
|
3599
|
+
if (cols[parseInt(j.toString(), 10)].isFrozen) {
|
|
3443
3600
|
cnt++;
|
|
3444
3601
|
}
|
|
3445
3602
|
}
|
|
@@ -3674,6 +3831,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3674
3831
|
__decorate([
|
|
3675
3832
|
Property('auto')
|
|
3676
3833
|
], TreeGrid.prototype, "width", void 0);
|
|
3834
|
+
__decorate([
|
|
3835
|
+
Complex({}, LoadingIndicator)
|
|
3836
|
+
], TreeGrid.prototype, "loadingIndicator", void 0);
|
|
3837
|
+
__decorate([
|
|
3838
|
+
Property(true)
|
|
3839
|
+
], TreeGrid.prototype, "enableVirtualMaskRow", void 0);
|
|
3677
3840
|
__decorate([
|
|
3678
3841
|
Property(false)
|
|
3679
3842
|
], TreeGrid.prototype, "enableVirtualization", void 0);
|