@syncfusion/ej2-treegrid 20.3.60 → 20.4.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 +16 -1
- package/CHANGELOG.md +8 -53
- package/README.md +64 -51
- 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 +1191 -908
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1249 -944
- 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 +16 -10
- package/src/treegrid/actions/batch-edit.js +82 -82
- package/src/treegrid/actions/clipboard.js +34 -33
- package/src/treegrid/actions/context-menu.js +1 -1
- package/src/treegrid/actions/crud-actions.js +62 -55
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.js +61 -60
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -13
- package/src/treegrid/actions/freeze-column.js +9 -8
- package/src/treegrid/actions/infinite-scroll.js +19 -19
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.js +8 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +88 -82
- package/src/treegrid/actions/selection.js +34 -32
- package/src/treegrid/actions/sort.js +7 -6
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +242 -55
- package/src/treegrid/base/treegrid-model.d.ts +20 -4
- package/src/treegrid/base/treegrid.d.ts +24 -5
- package/src/treegrid/base/treegrid.js +226 -191
- package/src/treegrid/models/column.js +3 -3
- 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 +19 -0
- package/src/treegrid/models/loading-indicator.d.ts +16 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.js +20 -19
- package/src/treegrid/renderer/virtual-row-model-generator.js +6 -5
- package/src/treegrid/renderer/virtual-tree-content-render.js +128 -99
- package/src/treegrid/utils.js +12 -11
|
@@ -22,6 +22,7 @@ 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';
|
|
@@ -77,9 +78,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
77
78
|
var isEqual = true;
|
|
78
79
|
var excludeKeys = ['Children', 'childRecords', 'taskData', 'uniqueID', 'parentItem', 'parentUniqueID', 'index'];
|
|
79
80
|
for (var i = 0; i < keys.length; i++) {
|
|
80
|
-
if (old[keys[i]] !== current[keys[i
|
|
81
|
-
|
|
82
|
-
|
|
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())) {
|
|
83
87
|
isEqual = false;
|
|
84
88
|
break;
|
|
85
89
|
}
|
|
@@ -94,7 +98,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
94
98
|
TreeGrid_1.Inject(TreeGridSelection);
|
|
95
99
|
setValue('mergePersistData', _this.mergePersistTreeGridData, _this);
|
|
96
100
|
var logger = 'Logger';
|
|
97
|
-
if (!isNullOrUndefined(_this.injectedModules[logger])) {
|
|
101
|
+
if (!isNullOrUndefined(_this.injectedModules["" + logger])) {
|
|
98
102
|
Grid.Inject(Logger);
|
|
99
103
|
}
|
|
100
104
|
_this.grid = new Grid();
|
|
@@ -287,7 +291,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
287
291
|
target = e.target;
|
|
288
292
|
column = target.closest('.e-rowcell');
|
|
289
293
|
row = column.closest('tr');
|
|
290
|
-
if (row
|
|
294
|
+
if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridexpand')[0]))) {
|
|
291
295
|
this.expandCollapseRequest(row.querySelector('.e-treegridexpand'));
|
|
292
296
|
}
|
|
293
297
|
break;
|
|
@@ -295,7 +299,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
295
299
|
target = e.target;
|
|
296
300
|
column = target.closest('.e-rowcell');
|
|
297
301
|
row = column.closest('tr');
|
|
298
|
-
if (row
|
|
302
|
+
if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridcollapse')[0]))) {
|
|
299
303
|
this.expandCollapseRequest(row.querySelector('.e-treegridcollapse'));
|
|
300
304
|
}
|
|
301
305
|
break;
|
|
@@ -307,7 +311,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
307
311
|
var rowIndex = summaryElement.rowIndex;
|
|
308
312
|
this.selectRow(rowIndex);
|
|
309
313
|
var cellIndex = e.target.cellIndex;
|
|
310
|
-
var row_1 = summaryElement.children[cellIndex];
|
|
314
|
+
var row_1 = summaryElement.children[parseInt(cellIndex.toString(), 10)];
|
|
311
315
|
addClass([row_1], 'e-focused');
|
|
312
316
|
addClass([row_1], 'e-focus');
|
|
313
317
|
}
|
|
@@ -324,7 +328,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
324
328
|
var rIndex = summaryElement.rowIndex;
|
|
325
329
|
this.selectRow(rIndex);
|
|
326
330
|
var cIndex = e.target.cellIndex;
|
|
327
|
-
var rows = summaryElement.children[cIndex];
|
|
331
|
+
var rows = summaryElement.children[parseInt(cIndex.toString(), 10)];
|
|
328
332
|
addClass([rows], 'e-focused');
|
|
329
333
|
addClass([rows], 'e-focus');
|
|
330
334
|
}
|
|
@@ -357,6 +361,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
357
361
|
this.defaultLocale = {};
|
|
358
362
|
this.flatData = [];
|
|
359
363
|
this.infiniteScrollData = [];
|
|
364
|
+
this.remoteCollapsedData = [];
|
|
365
|
+
this.remoteExpandedData = [];
|
|
360
366
|
this.parentData = [];
|
|
361
367
|
this.columnModel = [];
|
|
362
368
|
this.isExpandAll = false;
|
|
@@ -400,7 +406,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
400
406
|
TreeGrid.prototype.requiredModules = function () {
|
|
401
407
|
var modules = [];
|
|
402
408
|
var splitFrozenCount = 'splitFrozenCount';
|
|
403
|
-
this.grid[splitFrozenCount](this.getGridColumns(this.columns));
|
|
409
|
+
this.grid["" + splitFrozenCount](this.getGridColumns(this.columns));
|
|
404
410
|
if (this.isDestroyed) {
|
|
405
411
|
return modules;
|
|
406
412
|
}
|
|
@@ -610,14 +616,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
610
616
|
var modules = [];
|
|
611
617
|
modules = gridRequiredModules.apply(this);
|
|
612
618
|
for (var i = 0; i < modules.length; i++) {
|
|
613
|
-
if (modules[i].member === 'virtualscroll') {
|
|
614
|
-
modules[i].member = 'treeVirtualScroll';
|
|
619
|
+
if (modules[parseInt(i.toString(), 10)].member === 'virtualscroll') {
|
|
620
|
+
modules[parseInt(i.toString(), 10)].member = 'treeVirtualScroll';
|
|
615
621
|
}
|
|
616
622
|
}
|
|
617
623
|
return modules;
|
|
618
624
|
};
|
|
619
625
|
var root = 'root';
|
|
620
|
-
this.grid[root] = this[root] ? this[root] : this;
|
|
626
|
+
this.grid["" + root] = this["" + root] ? this["" + root] : this;
|
|
621
627
|
this.grid.appendTo(gridContainer);
|
|
622
628
|
if (this.isIndentEnabled) {
|
|
623
629
|
this.refreshToolbarItems();
|
|
@@ -625,12 +631,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
625
631
|
this.wireEvents();
|
|
626
632
|
this.renderComplete();
|
|
627
633
|
var destroyTemplate = 'destroyTemplate';
|
|
628
|
-
var destroyTemplateFn = this.grid[destroyTemplate];
|
|
634
|
+
var destroyTemplateFn = this.grid["" + destroyTemplate];
|
|
629
635
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
630
|
-
this.grid[destroyTemplate] = function (args, index) {
|
|
636
|
+
this.grid["" + destroyTemplate] = function (args, index) {
|
|
631
637
|
destroyTemplateFn.apply(_this.grid);
|
|
632
638
|
var portals = 'portals';
|
|
633
|
-
if (!(_this.isReact && isNullOrUndefined(_this[portals]))) {
|
|
639
|
+
if (!(_this.isReact && isNullOrUndefined(_this["" + portals]))) {
|
|
634
640
|
_this.clearTemplate(args, index);
|
|
635
641
|
}
|
|
636
642
|
};
|
|
@@ -702,6 +708,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
702
708
|
this.grid.enableColumnVirtualization = this.enableColumnVirtualization;
|
|
703
709
|
this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;
|
|
704
710
|
this.grid.infiniteScrollSettings = this.infiniteScrollSettings;
|
|
711
|
+
this.grid.enableVirtualMaskRow = this.enableVirtualMaskRow;
|
|
712
|
+
this.grid.loadingIndicator = this.loadingIndicator;
|
|
705
713
|
this.grid.width = this.width;
|
|
706
714
|
this.grid.height = this.height;
|
|
707
715
|
this.grid.enableAltRow = this.enableAltRow;
|
|
@@ -738,10 +746,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
738
746
|
this.grid.frozenColumns = this.frozenColumns;
|
|
739
747
|
this.grid.clipMode = getActualProperties(this.clipMode);
|
|
740
748
|
var templateInstance = 'templateDotnetInstance';
|
|
741
|
-
this.grid[templateInstance] = this[templateInstance];
|
|
749
|
+
this.grid["" + templateInstance] = this["" + templateInstance];
|
|
742
750
|
var isJsComponent = 'isJsComponent';
|
|
743
|
-
this.grid[isJsComponent] = true;
|
|
744
|
-
this.grid.enableVirtualMaskRow = false; // Need to update in virtual mask row feature implementation.
|
|
751
|
+
this.grid["" + isJsComponent] = true;
|
|
745
752
|
};
|
|
746
753
|
TreeGrid.prototype.triggerEvents = function (args) {
|
|
747
754
|
this.trigger(getObject('name', args), args);
|
|
@@ -769,8 +776,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
769
776
|
_this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
|
|
770
777
|
var updateRowSelection = 'updateRowSelection';
|
|
771
778
|
for (var i = 0; i < _this.getRows().length; i++) {
|
|
772
|
-
if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
773
|
-
_this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
|
|
779
|
+
if (_this.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
780
|
+
_this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(i.toString(), 10)], _this.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);
|
|
774
781
|
}
|
|
775
782
|
}
|
|
776
783
|
}
|
|
@@ -822,8 +829,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
822
829
|
this.grid.beforePaste = function (args) {
|
|
823
830
|
var rows = _this.getRows();
|
|
824
831
|
var rowIndex = 'rowIndex';
|
|
825
|
-
while (rows[args[rowIndex]].classList.contains('e-summaryrow')) {
|
|
826
|
-
args[rowIndex]++;
|
|
832
|
+
while (rows[args["" + rowIndex]].classList.contains('e-summaryrow')) {
|
|
833
|
+
args["" + rowIndex]++;
|
|
827
834
|
}
|
|
828
835
|
_this.trigger(events.beforePaste, args);
|
|
829
836
|
};
|
|
@@ -831,7 +838,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
831
838
|
_this.grid.on('initial-end', _this.afterGridRender, _this);
|
|
832
839
|
if (!isNullOrUndefined(_this.loggerModule)) {
|
|
833
840
|
var loggerModule = 'loggerModule';
|
|
834
|
-
_this.loggerModule = _this.grid[loggerModule] = new TreeLogger(_this.grid);
|
|
841
|
+
_this.loggerModule = _this.grid["" + loggerModule] = new TreeLogger(_this.grid);
|
|
835
842
|
}
|
|
836
843
|
};
|
|
837
844
|
this.grid.printComplete = this.triggerEvents.bind(this);
|
|
@@ -846,10 +853,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
846
853
|
TreeGrid.prototype.lastRowBorder = function (visiblerow, isAddBorder) {
|
|
847
854
|
for (var j = 0; j < visiblerow.cells.length; j++) {
|
|
848
855
|
if (isAddBorder) {
|
|
849
|
-
addClass([visiblerow.cells[j]], 'e-lastrowcell');
|
|
856
|
+
addClass([visiblerow.cells[parseInt(j.toString(), 10)]], 'e-lastrowcell');
|
|
850
857
|
}
|
|
851
858
|
else {
|
|
852
|
-
removeClass([visiblerow.cells[j]], 'e-lastrowcell');
|
|
859
|
+
removeClass([visiblerow.cells[parseInt(j.toString(), 10)]], 'e-lastrowcell');
|
|
853
860
|
}
|
|
854
861
|
}
|
|
855
862
|
};
|
|
@@ -878,22 +885,22 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
878
885
|
var rows = _this.getContentTable().rows;
|
|
879
886
|
var totalRows = [].slice.call(rows);
|
|
880
887
|
for (var i = totalRows.length - 1; i > 0; i--) {
|
|
881
|
-
if (!isHidden(totalRows[i])) {
|
|
882
|
-
if (totalRows[i].nextElementSibling) {
|
|
883
|
-
_this.lastRowBorder(totalRows[i], true);
|
|
888
|
+
if (!isHidden(totalRows[parseInt(i.toString(), 10)])) {
|
|
889
|
+
if (totalRows[parseInt(i.toString(), 10)].nextElementSibling) {
|
|
890
|
+
_this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], true);
|
|
884
891
|
}
|
|
885
892
|
break;
|
|
886
893
|
}
|
|
887
894
|
}
|
|
888
895
|
}
|
|
889
896
|
var action = 'action';
|
|
890
|
-
if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {
|
|
897
|
+
if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults["" + action] === 'expand' || _this.dataResults["" + action] === 'collapse')) {
|
|
891
898
|
var refreshPersistSelection = 'refreshPersistSelection';
|
|
892
|
-
_this.grid.selectionModule[refreshPersistSelection]();
|
|
899
|
+
_this.grid.selectionModule["" + refreshPersistSelection]();
|
|
893
900
|
if (_this.grid.selectionSettings.type === 'Single') {
|
|
894
901
|
var updateRowSelection = 'updateRowSelection';
|
|
895
902
|
var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);
|
|
896
|
-
_this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);
|
|
903
|
+
_this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
|
|
897
904
|
}
|
|
898
905
|
}
|
|
899
906
|
_this.trigger(events.dataBound, args);
|
|
@@ -911,7 +918,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
911
918
|
else if (treeGrid.flatData.length === 0 && isOffline(treeGrid) && treeGrid.dataSource instanceof DataManager) {
|
|
912
919
|
var dm = treeGrid.dataSource;
|
|
913
920
|
treeGrid.dataModule.convertToFlatData(dm.dataSource.json);
|
|
914
|
-
args.result = treeGrid.grid.dataSource[dataSource].json = treeGrid.flatData;
|
|
921
|
+
args.result = treeGrid.grid.dataSource["" + dataSource].json = treeGrid.flatData;
|
|
915
922
|
}
|
|
916
923
|
if (!isRemoteData(treeGrid) && !isCountRequired(this) && !isNullOrUndefined(treeGrid.dataSource)) {
|
|
917
924
|
if (this.isPrinting) {
|
|
@@ -1015,7 +1022,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1015
1022
|
this.grid.cellEdit = function (args) {
|
|
1016
1023
|
var prom = 'promise';
|
|
1017
1024
|
var promise = new Deferred();
|
|
1018
|
-
args[prom] = promise;
|
|
1025
|
+
args["" + prom] = promise;
|
|
1019
1026
|
_this.notify(events.cellEdit, args);
|
|
1020
1027
|
return promise;
|
|
1021
1028
|
};
|
|
@@ -1064,17 +1071,17 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1064
1071
|
this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);
|
|
1065
1072
|
}
|
|
1066
1073
|
if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {
|
|
1067
|
-
this.grid.dataSource[dataSource].json = extendArray(this.dataSource[dataSource].json);
|
|
1068
|
-
this.grid.dataSource[ready] = this.dataSource.ready;
|
|
1074
|
+
this.grid.dataSource["" + dataSource].json = extendArray(this.dataSource["" + dataSource].json);
|
|
1075
|
+
this.grid.dataSource["" + ready] = this.dataSource.ready;
|
|
1069
1076
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1070
1077
|
var proxy_1 = this;
|
|
1071
|
-
if (!isNullOrUndefined(this.grid.dataSource[ready])) {
|
|
1072
|
-
this.grid.dataSource[ready].then(function (e) {
|
|
1078
|
+
if (!isNullOrUndefined(this.grid.dataSource["" + ready])) {
|
|
1079
|
+
this.grid.dataSource["" + ready].then(function (e) {
|
|
1073
1080
|
var dm = proxy_1.grid.dataSource;
|
|
1074
|
-
dm[dataSource].offline = true;
|
|
1075
|
-
dm[isDataAvailable] = true;
|
|
1076
|
-
dm[dataSource].json = e.result;
|
|
1077
|
-
dm[adaptor] = new JsonAdaptor();
|
|
1081
|
+
dm["" + dataSource].offline = true;
|
|
1082
|
+
dm["" + isDataAvailable] = true;
|
|
1083
|
+
dm["" + dataSource].json = e.result;
|
|
1084
|
+
dm["" + adaptor] = new JsonAdaptor();
|
|
1078
1085
|
});
|
|
1079
1086
|
}
|
|
1080
1087
|
}
|
|
@@ -1090,6 +1097,18 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1090
1097
|
if (requestType === 'reorder') {
|
|
1091
1098
|
_this.notify('getColumnIndex', {});
|
|
1092
1099
|
}
|
|
1100
|
+
if (isRemoteData(_this) && _this.enableVirtualization) {
|
|
1101
|
+
if (args.requestType === 'virtualscroll') {
|
|
1102
|
+
_this.query.expand('VirtualScrollingAction');
|
|
1103
|
+
_this.showSpinner();
|
|
1104
|
+
}
|
|
1105
|
+
else if (args.requestType === 'searching' && args.searchString === '') {
|
|
1106
|
+
_this.query.expand('ClearSearchingAction');
|
|
1107
|
+
}
|
|
1108
|
+
else if (args.action === 'clearFilter') {
|
|
1109
|
+
_this.query.expand('ClearFilteringAction');
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1093
1112
|
_this.notify('actionBegin', { editAction: args });
|
|
1094
1113
|
if (!isRemoteData(_this) && !isNullOrUndefined(_this.filterModule) && !isCountRequired(_this)
|
|
1095
1114
|
&& (_this.grid.filterSettings.columns.length === 0 && _this.grid.searchSettings.key.length === 0)) {
|
|
@@ -1133,12 +1152,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1133
1152
|
_this.grid.refresh();
|
|
1134
1153
|
}
|
|
1135
1154
|
if (args.action === 'filter') {
|
|
1136
|
-
if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender) {
|
|
1155
|
+
if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
|
|
1137
1156
|
_this.expandAll();
|
|
1138
1157
|
}
|
|
1139
1158
|
}
|
|
1140
1159
|
if (args.requestType === 'searching') {
|
|
1141
|
-
if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender) {
|
|
1160
|
+
if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {
|
|
1142
1161
|
_this.expandAll();
|
|
1143
1162
|
}
|
|
1144
1163
|
}
|
|
@@ -1254,7 +1273,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1254
1273
|
this.bindGridEvents();
|
|
1255
1274
|
setValue('registeredTemplate', this.registeredTemplate, this.grid);
|
|
1256
1275
|
var ref = 'viewContainerRef';
|
|
1257
|
-
setValue('viewContainerRef', this[ref], this.grid);
|
|
1276
|
+
setValue('viewContainerRef', this["" + ref], this.grid);
|
|
1258
1277
|
};
|
|
1259
1278
|
/**
|
|
1260
1279
|
* AutoGenerate TreeGrid columns from first record
|
|
@@ -1272,8 +1291,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1272
1291
|
// }
|
|
1273
1292
|
var keys = Object.keys(record);
|
|
1274
1293
|
for (var i = 0; i < keys.length; i++) {
|
|
1275
|
-
if ([this.childMapping, this.parentIdMapping].indexOf(keys[i]) === -1) {
|
|
1276
|
-
this.columns.push(keys[i]);
|
|
1294
|
+
if ([this.childMapping, this.parentIdMapping].indexOf(keys[parseInt(i.toString(), 10)]) === -1) {
|
|
1295
|
+
this.columns.push(keys[parseInt(i.toString(), 10)]);
|
|
1277
1296
|
}
|
|
1278
1297
|
}
|
|
1279
1298
|
}
|
|
@@ -1290,7 +1309,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1290
1309
|
edit.template = this.editSettings.template;
|
|
1291
1310
|
edit.showDeleteConfirmDialog = this.editSettings.showDeleteConfirmDialog;
|
|
1292
1311
|
edit.allowNextRowEdit = this.editSettings.allowNextRowEdit;
|
|
1293
|
-
edit[guid] = this.editSettings[guid];
|
|
1312
|
+
edit["" + guid] = this.editSettings["" + guid];
|
|
1294
1313
|
edit.dialog = this.editSettings.dialog;
|
|
1295
1314
|
switch (this.editSettings.mode) {
|
|
1296
1315
|
case 'Dialog':
|
|
@@ -1319,7 +1338,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1319
1338
|
if (this.contextMenuItems) {
|
|
1320
1339
|
var items = [];
|
|
1321
1340
|
for (var i = 0; i < this.contextMenuItems.length; i++) {
|
|
1322
|
-
switch (this.contextMenuItems[i]) {
|
|
1341
|
+
switch (this.contextMenuItems[parseInt(i.toString(), 10)]) {
|
|
1323
1342
|
case 'AddRow':
|
|
1324
1343
|
case ContextMenuItems.AddRow:
|
|
1325
1344
|
items.push({ text: this.l10n.getConstant('AddRow'),
|
|
@@ -1337,7 +1356,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1337
1356
|
target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
|
|
1338
1357
|
break;
|
|
1339
1358
|
default:
|
|
1340
|
-
items.push(this.contextMenuItems[i]);
|
|
1359
|
+
items.push(this.contextMenuItems[parseInt(i.toString(), 10)]);
|
|
1341
1360
|
}
|
|
1342
1361
|
}
|
|
1343
1362
|
return items;
|
|
@@ -1358,7 +1377,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1358
1377
|
var items = [];
|
|
1359
1378
|
var tooltipText = void 0;
|
|
1360
1379
|
for (var i = 0; i < this.toolbar.length; i++) {
|
|
1361
|
-
switch (this.toolbar[i]) {
|
|
1380
|
+
switch (this.toolbar[parseInt(i.toString(), 10)]) {
|
|
1362
1381
|
case 'Search':
|
|
1363
1382
|
case ToolbarItem.Search:
|
|
1364
1383
|
items.push('Search');
|
|
@@ -1397,7 +1416,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1397
1416
|
});
|
|
1398
1417
|
break;
|
|
1399
1418
|
default:
|
|
1400
|
-
items.push(this.toolbar[i]);
|
|
1419
|
+
items.push(this.toolbar[parseInt(i.toString(), 10)]);
|
|
1401
1420
|
}
|
|
1402
1421
|
}
|
|
1403
1422
|
return items;
|
|
@@ -1422,31 +1441,31 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1422
1441
|
var gridColumnCollection = [];
|
|
1423
1442
|
for (var i = 0; i < column.length; i++) {
|
|
1424
1443
|
index = index + 1;
|
|
1425
|
-
var treeColumn = this.grid.getColumnByUid(column[i].uid);
|
|
1444
|
+
var treeColumn = this.grid.getColumnByUid(column[parseInt(i.toString(), 10)].uid);
|
|
1426
1445
|
gridColumn = treeColumn ? treeColumn : {};
|
|
1427
1446
|
treeGridColumn = {};
|
|
1428
|
-
if (typeof this.columns[i] === 'string') {
|
|
1429
|
-
gridColumn.field = treeGridColumn.field = this.columns[i];
|
|
1447
|
+
if (typeof this.columns[parseInt(i.toString(), 10)] === 'string') {
|
|
1448
|
+
gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];
|
|
1430
1449
|
}
|
|
1431
1450
|
else {
|
|
1432
|
-
for (var _i = 0, _a = Object.keys(column[i]); _i < _a.length; _i++) {
|
|
1451
|
+
for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
|
|
1433
1452
|
var prop = _a[_i];
|
|
1434
1453
|
if (index === this.treeColumnIndex && prop === 'template') {
|
|
1435
|
-
treeGridColumn[prop] = column[i][prop];
|
|
1454
|
+
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1436
1455
|
}
|
|
1437
|
-
else if (prop === 'columns' && !isNullOrUndefined(column[i][prop])) {
|
|
1438
|
-
gridColumn[prop] = this.getGridColumns(column[i][prop], false, this.columnModel.length - 1);
|
|
1439
|
-
treeGridColumn[prop] = column[i][prop];
|
|
1456
|
+
else if (prop === 'columns' && !isNullOrUndefined(column[parseInt(i.toString(), 10)]["" + prop])) {
|
|
1457
|
+
gridColumn["" + prop] = this.getGridColumns(column[parseInt(i.toString(), 10)]["" + prop], false, this.columnModel.length - 1);
|
|
1458
|
+
treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1440
1459
|
}
|
|
1441
1460
|
else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {
|
|
1442
|
-
gridColumn[prop] = treeGridColumn[prop] = treeColumn[prop];
|
|
1461
|
+
gridColumn["" + prop] = treeGridColumn["" + prop] = treeColumn["" + prop];
|
|
1443
1462
|
}
|
|
1444
1463
|
else if (!(treeColumn) || prop !== 'sortComparer') {
|
|
1445
|
-
gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
|
|
1464
|
+
gridColumn["" + prop] = treeGridColumn["" + prop] = column[parseInt(i.toString(), 10)]["" + prop];
|
|
1446
1465
|
}
|
|
1447
1466
|
}
|
|
1448
1467
|
}
|
|
1449
|
-
if (!treeGridColumn[stackedColumn]) {
|
|
1468
|
+
if (!treeGridColumn["" + stackedColumn]) {
|
|
1450
1469
|
this.columnModel.push(new Column(treeGridColumn));
|
|
1451
1470
|
}
|
|
1452
1471
|
gridColumnCollection.push(gridColumn);
|
|
@@ -1566,7 +1585,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1566
1585
|
this.grid.query = this.query;
|
|
1567
1586
|
break;
|
|
1568
1587
|
case 'enableCollapseAll':
|
|
1569
|
-
if (newProp[prop]) {
|
|
1588
|
+
if (newProp["" + prop]) {
|
|
1570
1589
|
this.collapseAll();
|
|
1571
1590
|
}
|
|
1572
1591
|
else {
|
|
@@ -1665,8 +1684,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1665
1684
|
this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);
|
|
1666
1685
|
break;
|
|
1667
1686
|
case 'editSettings':
|
|
1668
|
-
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[prop].mode &&
|
|
1669
|
-
(newProp[prop].mode === 'Cell' || newProp[prop].mode === 'Row')) {
|
|
1687
|
+
if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
|
|
1688
|
+
(newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
|
|
1670
1689
|
this.grid.closeEdit();
|
|
1671
1690
|
}
|
|
1672
1691
|
this.grid.editSettings = this.getGridEditSettings();
|
|
@@ -1713,8 +1732,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1713
1732
|
'pagerModule', 'keyboardModule', 'columnMenuModule', 'contextMenuModule', 'editModule', 'virtualScrollModule',
|
|
1714
1733
|
'selectionModule', 'detailRow', 'rowDragAndDropModule', 'freezeModule'];
|
|
1715
1734
|
for (var i = 0; i < modules.length; i++) {
|
|
1716
|
-
if (this[modules[i]]) {
|
|
1717
|
-
this[modules[i]] = null;
|
|
1735
|
+
if (this[modules[parseInt(i.toString(), 10)]]) {
|
|
1736
|
+
this[modules[parseInt(i.toString(), 10)]] = null;
|
|
1718
1737
|
}
|
|
1719
1738
|
}
|
|
1720
1739
|
this.element.innerHTML = '';
|
|
@@ -1757,10 +1776,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1757
1776
|
var ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',
|
|
1758
1777
|
'commandTemplate', 'commands', 'dataSource'];
|
|
1759
1778
|
for (var i = 0; i < keyEntity.length; i++) {
|
|
1760
|
-
var currentObject = this[keyEntity[i]];
|
|
1761
|
-
for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
1762
|
-
var objVal = val[k];
|
|
1763
|
-
delete currentObject[objVal];
|
|
1779
|
+
var currentObject = this[keyEntity[parseInt(i.toString(), 10)]];
|
|
1780
|
+
for (var k = 0, val = ignoreOnPersist[keyEntity[parseInt(i.toString(), 10)]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
1781
|
+
var objVal = val[parseInt(k.toString(), 10)];
|
|
1782
|
+
delete currentObject["" + objVal];
|
|
1764
1783
|
}
|
|
1765
1784
|
}
|
|
1766
1785
|
this.ignoreInArrays(ignoreOnColumn, this.columns);
|
|
@@ -1768,18 +1787,18 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1768
1787
|
};
|
|
1769
1788
|
TreeGrid.prototype.ignoreInArrays = function (ignoreOnColumn, columns) {
|
|
1770
1789
|
for (var i = 0; i < columns.length; i++) {
|
|
1771
|
-
if (columns[i].columns) {
|
|
1772
|
-
this.ignoreInColumn(ignoreOnColumn, columns[i]);
|
|
1773
|
-
this.ignoreInArrays(ignoreOnColumn, columns[i].columns);
|
|
1790
|
+
if (columns[parseInt(i.toString(), 10)].columns) {
|
|
1791
|
+
this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);
|
|
1792
|
+
this.ignoreInArrays(ignoreOnColumn, columns[parseInt(i.toString(), 10)].columns);
|
|
1774
1793
|
}
|
|
1775
1794
|
else {
|
|
1776
|
-
this.ignoreInColumn(ignoreOnColumn, columns[i]);
|
|
1795
|
+
this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);
|
|
1777
1796
|
}
|
|
1778
1797
|
}
|
|
1779
1798
|
};
|
|
1780
1799
|
TreeGrid.prototype.ignoreInColumn = function (ignoreOnColumn, column) {
|
|
1781
1800
|
for (var i = 0; i < ignoreOnColumn.length; i++) {
|
|
1782
|
-
delete column[ignoreOnColumn[i]];
|
|
1801
|
+
delete column[ignoreOnColumn[parseInt(i.toString(), 10)]];
|
|
1783
1802
|
column.filter = {};
|
|
1784
1803
|
}
|
|
1785
1804
|
};
|
|
@@ -1823,7 +1842,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1823
1842
|
TreeGrid.prototype.addRecord = function (data, index, position) {
|
|
1824
1843
|
if (this.editModule) {
|
|
1825
1844
|
var isAddedRowByMethod = 'isAddedRowByMethod';
|
|
1826
|
-
this.editModule[isAddedRowByMethod] = true;
|
|
1845
|
+
this.editModule["" + isAddedRowByMethod] = true;
|
|
1827
1846
|
this.editModule.addRecord(data, index, position);
|
|
1828
1847
|
}
|
|
1829
1848
|
};
|
|
@@ -1870,7 +1889,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1870
1889
|
TreeGrid.prototype.updateRow = function (index, data) {
|
|
1871
1890
|
if (this.grid.editModule) {
|
|
1872
1891
|
if (!isNullOrUndefined(index)) {
|
|
1873
|
-
var griddata = this.grid.getCurrentViewRecords()[index];
|
|
1892
|
+
var griddata = this.grid.getCurrentViewRecords()[parseInt(index.toString(), 10)];
|
|
1874
1893
|
extend(griddata, data);
|
|
1875
1894
|
this.grid.editModule.updateRow(index, griddata);
|
|
1876
1895
|
}
|
|
@@ -1980,7 +1999,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1980
1999
|
TreeGrid.prototype.setCellValue = function (key, field, value) {
|
|
1981
2000
|
this.grid.setCellValue(key, field, value);
|
|
1982
2001
|
var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
|
|
1983
|
-
var record = this.getCurrentViewRecords()[rowIndex];
|
|
2002
|
+
var record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
|
|
1984
2003
|
if (!isNullOrUndefined(record)) {
|
|
1985
2004
|
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
|
|
1986
2005
|
}
|
|
@@ -1999,7 +2018,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1999
2018
|
var level = 0;
|
|
2000
2019
|
var record = {};
|
|
2001
2020
|
currentRecords.some(function (value) {
|
|
2002
|
-
if (value[primaryKey] === key) {
|
|
2021
|
+
if (value["" + primaryKey] === key) {
|
|
2003
2022
|
record = value;
|
|
2004
2023
|
return true;
|
|
2005
2024
|
}
|
|
@@ -2020,7 +2039,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2020
2039
|
rowData.expanded = record.expanded;
|
|
2021
2040
|
this.grid.setRowData(key, rowData);
|
|
2022
2041
|
var visibleRecords = this.getVisibleRecords();
|
|
2023
|
-
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
|
|
2042
|
+
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])["" + primaryKey]) {
|
|
2024
2043
|
var table = this.getContentTable();
|
|
2025
2044
|
var sHeight = table.scrollHeight;
|
|
2026
2045
|
var clientHeight = this.getContent().clientHeight;
|
|
@@ -2083,7 +2102,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2083
2102
|
var Columns = this.initialRender ? this.grid.columns : this.columns;
|
|
2084
2103
|
var columnModel = 'columnModel';
|
|
2085
2104
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2086
|
-
Columns = this.grid[columnModel];
|
|
2105
|
+
Columns = this.grid["" + columnModel];
|
|
2087
2106
|
}
|
|
2088
2107
|
return iterateArrayOrObject(Columns, function (item) {
|
|
2089
2108
|
if (item.uid === uid) {
|
|
@@ -2176,7 +2195,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2176
2195
|
};
|
|
2177
2196
|
TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {
|
|
2178
2197
|
var columnModel = 'columnModel';
|
|
2179
|
-
var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {
|
|
2198
|
+
var index = iterateArrayOrObject(this.grid["" + columnModel], function (item, index) {
|
|
2180
2199
|
if (item.uid === uid) {
|
|
2181
2200
|
return index;
|
|
2182
2201
|
}
|
|
@@ -2217,25 +2236,25 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2217
2236
|
this.columnModel = [];
|
|
2218
2237
|
for (var i = 0; i < gridColumns.length; i++) {
|
|
2219
2238
|
gridColumn = {};
|
|
2220
|
-
for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {
|
|
2239
|
+
for (var _i = 0, _a = Object.keys(gridColumns[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {
|
|
2221
2240
|
var prop = _a[_i];
|
|
2222
|
-
gridColumn[prop] = gridColumns[i][prop];
|
|
2241
|
+
gridColumn["" + prop] = gridColumns[parseInt(i.toString(), 10)]["" + prop];
|
|
2223
2242
|
}
|
|
2224
2243
|
this.columnModel.push(new Column(gridColumn));
|
|
2225
|
-
if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2226
|
-
this.columnModel[i].template = temp;
|
|
2244
|
+
if (field === this.columnModel[parseInt(i.toString(), 10)].field && this.columnModel[parseInt(i.toString(), 10)].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2245
|
+
this.columnModel[parseInt(i.toString(), 10)].template = temp;
|
|
2227
2246
|
}
|
|
2228
2247
|
}
|
|
2229
2248
|
}
|
|
2230
2249
|
var deepMerge = 'deepMerge';
|
|
2231
|
-
this[deepMerge] = ['columns']; // Workaround for blazor updateModel
|
|
2250
|
+
this["" + deepMerge] = ['columns']; // Workaround for blazor updateModel
|
|
2232
2251
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2233
2252
|
this.stackedHeader = true;
|
|
2234
2253
|
}
|
|
2235
2254
|
if (!this.stackedHeader) {
|
|
2236
2255
|
merge(this.columns, this.columnModel);
|
|
2237
2256
|
}
|
|
2238
|
-
this[deepMerge] = undefined; // Workaround for blazor updateModel
|
|
2257
|
+
this["" + deepMerge] = undefined; // Workaround for blazor updateModel
|
|
2239
2258
|
return this.columnModel;
|
|
2240
2259
|
};
|
|
2241
2260
|
/**
|
|
@@ -2248,11 +2267,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2248
2267
|
};
|
|
2249
2268
|
TreeGrid.prototype.mergePersistTreeGridData = function () {
|
|
2250
2269
|
var persist1 = 'mergePersistGridData';
|
|
2251
|
-
this.grid[persist1].apply(this);
|
|
2270
|
+
this.grid["" + persist1].apply(this);
|
|
2252
2271
|
};
|
|
2253
2272
|
TreeGrid.prototype.mergeColumns = function (storedColumn, columns) {
|
|
2254
2273
|
var persist2 = 'mergeColumns';
|
|
2255
|
-
this.grid[persist2].apply(this, [storedColumn, columns]);
|
|
2274
|
+
this.grid["" + persist2].apply(this, [storedColumn, columns]);
|
|
2256
2275
|
};
|
|
2257
2276
|
TreeGrid.prototype.updateTreeGridModel = function () {
|
|
2258
2277
|
this.setProperties({ filterSettings: getObject('properties', this.grid.filterSettings) }, true);
|
|
@@ -2277,8 +2296,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2277
2296
|
var dRows = [];
|
|
2278
2297
|
var rows = this.grid.getDataRows();
|
|
2279
2298
|
for (var i = 0, len = rows.length; i < len; i++) {
|
|
2280
|
-
if (!rows[i].classList.contains('e-summaryrow')) {
|
|
2281
|
-
dRows.push(rows[i]);
|
|
2299
|
+
if (!rows[parseInt(i.toString(), 10)].classList.contains('e-summaryrow')) {
|
|
2300
|
+
dRows.push(rows[parseInt(i.toString(), 10)]);
|
|
2282
2301
|
}
|
|
2283
2302
|
}
|
|
2284
2303
|
return dRows;
|
|
@@ -2414,9 +2433,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2414
2433
|
var currentViewRecords = this.getCurrentViewRecords();
|
|
2415
2434
|
if (!this.allowPaging) {
|
|
2416
2435
|
for (var i = 0; i < currentViewRecords.length; i++) {
|
|
2417
|
-
visibleRecords.push(currentViewRecords[i]);
|
|
2418
|
-
if (!currentViewRecords[i].expanded) {
|
|
2419
|
-
i += findChildrenRecords(currentViewRecords[i]).length;
|
|
2436
|
+
visibleRecords.push(currentViewRecords[parseInt(i.toString(), 10)]);
|
|
2437
|
+
if (!currentViewRecords[parseInt(i.toString(), 10)].expanded) {
|
|
2438
|
+
i += findChildrenRecords(currentViewRecords[parseInt(i.toString(), 10)]).length;
|
|
2420
2439
|
}
|
|
2421
2440
|
}
|
|
2422
2441
|
}
|
|
@@ -2476,11 +2495,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2476
2495
|
if (this.editSettings.mode === 'Batch') {
|
|
2477
2496
|
var obj = 'dialogObj';
|
|
2478
2497
|
var showDialog = 'showDialog';
|
|
2479
|
-
if ((this.getBatchChanges()[this.changedRecords].length ||
|
|
2480
|
-
this.getBatchChanges()[this.
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
this.grid.editModule[showDialog]('CancelEdit', dialogObj);
|
|
2498
|
+
if ((this.getBatchChanges()[this.changedRecords].length || this.getBatchChanges()[this.deletedRecords].length ||
|
|
2499
|
+
this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
|
|
2500
|
+
var dialogObj = this.grid.editModule["" + obj];
|
|
2501
|
+
this.grid.editModule["" + showDialog]('CancelEdit', dialogObj);
|
|
2484
2502
|
this.targetElement = target;
|
|
2485
2503
|
return;
|
|
2486
2504
|
}
|
|
@@ -2500,7 +2518,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2500
2518
|
var record = rowInfo_1.rowData;
|
|
2501
2519
|
if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {
|
|
2502
2520
|
var freezeRows = 'freezeRows';
|
|
2503
|
-
record = this.grid.contentModule[freezeRows].filter(function (e) { return e.uid === rowInfo_1.row.getAttribute('data-uid'); })[0].data;
|
|
2521
|
+
record = this.grid.contentModule["" + freezeRows].filter(function (e) { return e.uid === rowInfo_1.row.getAttribute('data-uid'); })[0].data;
|
|
2504
2522
|
}
|
|
2505
2523
|
if (this.enableImmutableMode) {
|
|
2506
2524
|
record = this.getCurrentViewRecords()[rowInfo_1.rowIndex];
|
|
@@ -2536,7 +2554,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2536
2554
|
_this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
2537
2555
|
}
|
|
2538
2556
|
var children = 'Children';
|
|
2539
|
-
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
|
|
2557
|
+
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record["" + children]))) {
|
|
2540
2558
|
var collapseArgs = { data: record, row: row };
|
|
2541
2559
|
_this.setHeightForFrozenContent();
|
|
2542
2560
|
if (!isNullOrUndefined(_this.expandStateMapping)) {
|
|
@@ -2557,7 +2575,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2557
2575
|
});
|
|
2558
2576
|
records.unshift(record);
|
|
2559
2577
|
for (var i = 0; i < records.length; i++) {
|
|
2560
|
-
this.expandCollapse(action, null, records[i]);
|
|
2578
|
+
this.expandCollapse(action, null, records[parseInt(i.toString(), 10)]);
|
|
2561
2579
|
}
|
|
2562
2580
|
};
|
|
2563
2581
|
TreeGrid.prototype.setHeightForFrozenContent = function () {
|
|
@@ -2578,7 +2596,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2578
2596
|
record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
|
|
2579
2597
|
}
|
|
2580
2598
|
else {
|
|
2581
|
-
record = this.grid.getCurrentViewRecords()[row.
|
|
2599
|
+
record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
|
|
2582
2600
|
}
|
|
2583
2601
|
}
|
|
2584
2602
|
return record;
|
|
@@ -2623,12 +2641,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2623
2641
|
var totalRecords = record;
|
|
2624
2642
|
if (totalRecords.length) {
|
|
2625
2643
|
for (var i = 0; i < totalRecords.length; i++) {
|
|
2626
|
-
totalRecords[i][this.expandStateMapping] = state;
|
|
2627
|
-
editAction({ value: totalRecords[i], action: 'edit' }, this, this.isSelfReference, totalRecords[i].index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2644
|
+
totalRecords[parseInt(i.toString(), 10)][this.expandStateMapping] = state;
|
|
2645
|
+
editAction({ value: totalRecords[parseInt(i.toString(), 10)], action: 'edit' }, this, this.isSelfReference, totalRecords[parseInt(i.toString(), 10)].index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2628
2646
|
}
|
|
2629
2647
|
}
|
|
2630
2648
|
else {
|
|
2631
|
-
record[this.expandStateMapping] = state;
|
|
2649
|
+
record["" + this.expandStateMapping] = state;
|
|
2632
2650
|
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, this.expandStateMapping);
|
|
2633
2651
|
}
|
|
2634
2652
|
};
|
|
@@ -2666,8 +2684,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2666
2684
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
2667
2685
|
if (isPaging === void 0) { isPaging = false; }
|
|
2668
2686
|
var _loop_1 = function (i) {
|
|
2669
|
-
if (!isNullOrUndefined(record[i].parentItem)) {
|
|
2670
|
-
var puniqueID_1 = record[i].parentItem.uniqueID;
|
|
2687
|
+
if (!isNullOrUndefined(record[parseInt(i.toString(), 10)].parentItem)) {
|
|
2688
|
+
var puniqueID_1 = record[parseInt(i.toString(), 10)].parentItem.uniqueID;
|
|
2671
2689
|
var parentItem = this_1.flatData.filter(function (e) {
|
|
2672
2690
|
return e.uniqueID === puniqueID_1;
|
|
2673
2691
|
});
|
|
@@ -2689,7 +2707,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2689
2707
|
}
|
|
2690
2708
|
}
|
|
2691
2709
|
if (!isPaging) {
|
|
2692
|
-
this_1.expandRow(null, record[i], key, level);
|
|
2710
|
+
this_1.expandRow(null, record[parseInt(i.toString(), 10)], key, level);
|
|
2693
2711
|
}
|
|
2694
2712
|
};
|
|
2695
2713
|
var this_1 = this;
|
|
@@ -2747,7 +2765,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2747
2765
|
var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
|
|
2748
2766
|
if (!isNullOrUndefined(primaryKeyField)) {
|
|
2749
2767
|
var rec = dataSource.filter(function (e) {
|
|
2750
|
-
return e[primaryKeyField].toString() === key.toString();
|
|
2768
|
+
return e["" + primaryKeyField].toString() === key.toString();
|
|
2751
2769
|
});
|
|
2752
2770
|
if (action === 'Expand') {
|
|
2753
2771
|
this.expandAction(rec, key, null);
|
|
@@ -2764,14 +2782,14 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2764
2782
|
}
|
|
2765
2783
|
else {
|
|
2766
2784
|
for (var i = 0; i < record.length; i++) {
|
|
2767
|
-
this.collapseRow(null, record[i], key);
|
|
2785
|
+
this.collapseRow(null, record[parseInt(i.toString(), 10)], key);
|
|
2768
2786
|
}
|
|
2769
2787
|
}
|
|
2770
2788
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
2771
2789
|
&& this.parentData.length === this.getRows().length) {
|
|
2772
2790
|
var endIndex = 'endIndex';
|
|
2773
2791
|
this.grid.contentModule.startIndex = -1;
|
|
2774
|
-
this.grid.contentModule[endIndex] = -1;
|
|
2792
|
+
this.grid.contentModule["" + endIndex] = -1;
|
|
2775
2793
|
}
|
|
2776
2794
|
};
|
|
2777
2795
|
/**
|
|
@@ -2808,10 +2826,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2808
2826
|
if (rows.length) {
|
|
2809
2827
|
for (var i = 0; i < rows.length; i++) {
|
|
2810
2828
|
if (action === 'collapse') {
|
|
2811
|
-
this.collapseRow(rows[i]);
|
|
2829
|
+
this.collapseRow(rows[parseInt(i.toString(), 10)]);
|
|
2812
2830
|
}
|
|
2813
2831
|
else {
|
|
2814
|
-
this.expandRow(rows[i]);
|
|
2832
|
+
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
2815
2833
|
}
|
|
2816
2834
|
}
|
|
2817
2835
|
}
|
|
@@ -2825,10 +2843,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2825
2843
|
else {
|
|
2826
2844
|
for (var i = 0; i < rows.length; i++) {
|
|
2827
2845
|
if (action === 'collapse') {
|
|
2828
|
-
this.collapseRow(rows[i]);
|
|
2846
|
+
this.collapseRow(rows[parseInt(i.toString(), 10)]);
|
|
2829
2847
|
}
|
|
2830
2848
|
else {
|
|
2831
|
-
this.expandRow(rows[i]);
|
|
2849
|
+
this.expandRow(rows[parseInt(i.toString(), 10)]);
|
|
2832
2850
|
}
|
|
2833
2851
|
}
|
|
2834
2852
|
}
|
|
@@ -2852,7 +2870,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2852
2870
|
var rowIndex;
|
|
2853
2871
|
if (isNullOrUndefined(row)) {
|
|
2854
2872
|
rowIndex = this.getCurrentViewRecords().indexOf(record);
|
|
2855
|
-
row = gridRows[rowIndex];
|
|
2873
|
+
row = gridRows[parseInt(rowIndex.toString(), 10)];
|
|
2856
2874
|
}
|
|
2857
2875
|
else {
|
|
2858
2876
|
rowIndex = +row.getAttribute('data-rowindex');
|
|
@@ -2929,11 +2947,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2929
2947
|
var rows = this.getContentTable().rows;
|
|
2930
2948
|
totalRows = [].slice.call(rows);
|
|
2931
2949
|
for (var i = totalRows.length - 1; i >= 0; i--) {
|
|
2932
|
-
if (!isHidden(totalRows[i])) {
|
|
2950
|
+
if (!isHidden(totalRows[parseInt(i.toString(), 10)])) {
|
|
2933
2951
|
var table = this.getContentTable();
|
|
2934
2952
|
var sHeight = table.scrollHeight;
|
|
2935
2953
|
var clientHeight = this.getContent().clientHeight;
|
|
2936
|
-
this.lastRowBorder(totalRows[i], sHeight <= clientHeight);
|
|
2954
|
+
this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], sHeight <= clientHeight);
|
|
2937
2955
|
break;
|
|
2938
2956
|
}
|
|
2939
2957
|
}
|
|
@@ -2947,7 +2965,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2947
2965
|
if (expandingArgs.requestType === 'collapse' && isCountRequired(this)) {
|
|
2948
2966
|
var flatDataRecords = this.flatData.slice();
|
|
2949
2967
|
for (var i = 0; i < flatDataRecords.length; i++) {
|
|
2950
|
-
if (flatDataRecords[i]['parentUniqueID'] === expandingArgs.data['uniqueID']) {
|
|
2968
|
+
if (flatDataRecords[parseInt(i.toString(), 10)]['parentUniqueID'] === expandingArgs.data['uniqueID']) {
|
|
2951
2969
|
flatDataRecords.splice(i, 1);
|
|
2952
2970
|
i = i - 1;
|
|
2953
2971
|
}
|
|
@@ -2957,7 +2975,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2957
2975
|
}
|
|
2958
2976
|
var deff = new Deferred();
|
|
2959
2977
|
var childDataBind = 'childDataBind';
|
|
2960
|
-
expandingArgs[childDataBind] = deff.resolve;
|
|
2978
|
+
expandingArgs["" + childDataBind] = deff.resolve;
|
|
2961
2979
|
var record = expandingArgs.data;
|
|
2962
2980
|
this.trigger(events.dataStateChange, expandingArgs);
|
|
2963
2981
|
deff.promise.then(function () {
|
|
@@ -2971,7 +2989,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2971
2989
|
var currentData = (_this.flatData);
|
|
2972
2990
|
var index = 0;
|
|
2973
2991
|
for (var i = 0; i < currentData.length; i++) {
|
|
2974
|
-
if (currentData[i].taskData === record.taskData) {
|
|
2992
|
+
if (currentData[parseInt(i.toString(), 10)].taskData === record.taskData) {
|
|
2975
2993
|
index = i;
|
|
2976
2994
|
break;
|
|
2977
2995
|
}
|
|
@@ -2988,38 +3006,38 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2988
3006
|
}
|
|
2989
3007
|
});
|
|
2990
3008
|
}
|
|
2991
|
-
if (childData[i]) {
|
|
2992
|
-
childData[i].level = record.level + 1;
|
|
2993
|
-
childData[i].index = Math.ceil(Math.random() * 1000);
|
|
2994
|
-
childData[i].parentItem = extend({}, record);
|
|
2995
|
-
childData[i].taskData = extend({}, childData[i]);
|
|
2996
|
-
delete childData[i].parentItem.childRecords;
|
|
2997
|
-
delete childData[i].taskData.parentItem;
|
|
2998
|
-
childData[i].parentUniqueID = record.uniqueID;
|
|
2999
|
-
childData[i].uniqueID = getUid(_this.element.id + '_data_');
|
|
3000
|
-
setValue('uniqueIDCollection.' + childData[i].uniqueID, childData[i], _this);
|
|
3001
|
-
if (!isNullOrUndefined(childData[i][_this.childMapping]) ||
|
|
3002
|
-
(childData[i][_this.hasChildMapping] && isCountRequired(_this))) {
|
|
3003
|
-
childData[i].hasChildRecords = true;
|
|
3009
|
+
if (childData[parseInt(i.toString(), 10)]) {
|
|
3010
|
+
childData[parseInt(i.toString(), 10)].level = record.level + 1;
|
|
3011
|
+
childData[parseInt(i.toString(), 10)].index = Math.ceil(Math.random() * 1000);
|
|
3012
|
+
childData[parseInt(i.toString(), 10)].parentItem = extend({}, record);
|
|
3013
|
+
childData[parseInt(i.toString(), 10)].taskData = extend({}, childData[parseInt(i.toString(), 10)]);
|
|
3014
|
+
delete childData[parseInt(i.toString(), 10)].parentItem.childRecords;
|
|
3015
|
+
delete childData[parseInt(i.toString(), 10)].taskData.parentItem;
|
|
3016
|
+
childData[parseInt(i.toString(), 10)].parentUniqueID = record.uniqueID;
|
|
3017
|
+
childData[parseInt(i.toString(), 10)].uniqueID = getUid(_this.element.id + '_data_');
|
|
3018
|
+
setValue('uniqueIDCollection.' + childData[parseInt(i.toString(), 10)].uniqueID, childData[parseInt(i.toString(), 10)], _this);
|
|
3019
|
+
if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)][_this.childMapping]) ||
|
|
3020
|
+
(childData[parseInt(i.toString(), 10)][_this.hasChildMapping] && isCountRequired(_this))) {
|
|
3021
|
+
childData[parseInt(i.toString(), 10)].hasChildRecords = true;
|
|
3004
3022
|
}
|
|
3005
|
-
if (isCountRequired(_this) && record[_this.childMapping] && record[_this.childMapping][i]) {
|
|
3006
|
-
currentData.splice(index + 1 + i, 0, childData[i]);
|
|
3023
|
+
if (isCountRequired(_this) && record[_this.childMapping] && record[_this.childMapping][parseInt(i.toString(), 10)]) {
|
|
3024
|
+
currentData.splice(index + 1 + i, 0, childData[parseInt(i.toString(), 10)]);
|
|
3007
3025
|
}
|
|
3008
3026
|
else {
|
|
3009
3027
|
currentData.splice(index + 1 + i, record[_this.childMapping] &&
|
|
3010
|
-
record[_this.childMapping][i] ? 1 : 0, childData[i]);
|
|
3028
|
+
record[_this.childMapping][parseInt(i.toString(), 10)] ? 1 : 0, childData[parseInt(i.toString(), 10)]);
|
|
3011
3029
|
}
|
|
3012
3030
|
}
|
|
3013
3031
|
else {
|
|
3014
3032
|
currentData.splice(index + 1 + i, 1);
|
|
3015
3033
|
}
|
|
3016
3034
|
}
|
|
3017
|
-
currentData[index][_this.childMapping] = childData;
|
|
3018
|
-
currentData[index].childRecords = childData;
|
|
3019
|
-
currentData[index].expanded = true;
|
|
3020
|
-
setValue('uniqueIDCollection.' + currentData[index].uniqueID, currentData[index], _this);
|
|
3035
|
+
currentData[parseInt(index.toString(), 10)]["" + _this.childMapping] = childData;
|
|
3036
|
+
currentData[parseInt(index.toString(), 10)].childRecords = childData;
|
|
3037
|
+
currentData[parseInt(index.toString(), 10)].expanded = true;
|
|
3038
|
+
setValue('uniqueIDCollection.' + currentData[parseInt(index.toString(), 10)].uniqueID, currentData[parseInt(index.toString(), 10)], _this);
|
|
3021
3039
|
for (var j = 0; j < expandingArgs.childData.length; j++) {
|
|
3022
|
-
data_1.push(expandingArgs.childData[j]);
|
|
3040
|
+
data_1.push(expandingArgs.childData[parseInt(j.toString(), 10)]);
|
|
3023
3041
|
}
|
|
3024
3042
|
}
|
|
3025
3043
|
if (isCountRequired(_this) && _this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
|
|
@@ -3038,6 +3056,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3038
3056
|
};
|
|
3039
3057
|
TreeGrid.prototype.remoteExpand = function (action, row, record) {
|
|
3040
3058
|
var gridRows = this.getRows();
|
|
3059
|
+
var fetchRemoteChildData = 'fetchRemoteChildData';
|
|
3041
3060
|
if (this.rowTemplate) {
|
|
3042
3061
|
var rows_1 = this.getContentTable().rows;
|
|
3043
3062
|
gridRows = [].slice.call(rows_1);
|
|
@@ -3055,6 +3074,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3055
3074
|
this.trigger(events.expanded, args_1);
|
|
3056
3075
|
}
|
|
3057
3076
|
}
|
|
3077
|
+
else if (action === 'collapse' && this.enableVirtualization) {
|
|
3078
|
+
this.dataModule["" + fetchRemoteChildData]({ action: action, record: args.data, rows: null, parentRow: args.row });
|
|
3079
|
+
}
|
|
3058
3080
|
else {
|
|
3059
3081
|
this.collapseRemoteChild({ record: record, rows: rows });
|
|
3060
3082
|
this.setHeightForFrozenContent();
|
|
@@ -3081,8 +3103,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3081
3103
|
if (this.enableImmutableMode && !this.allowPaging) {
|
|
3082
3104
|
rows = [];
|
|
3083
3105
|
for (var i = 0; i < childRecords.length; i++) {
|
|
3084
|
-
var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[i][primaryKeyField]);
|
|
3085
|
-
rows.push(this.getRows()[rowIndex]);
|
|
3106
|
+
var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[parseInt(i.toString(), 10)]["" + primaryKeyField]);
|
|
3107
|
+
rows.push(this.getRows()[parseInt(rowIndex.toString(), 10)]);
|
|
3086
3108
|
}
|
|
3087
3109
|
}
|
|
3088
3110
|
else {
|
|
@@ -3102,43 +3124,49 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3102
3124
|
});
|
|
3103
3125
|
}
|
|
3104
3126
|
var gridRowsObject = this.grid.getRowsObject();
|
|
3105
|
-
|
|
3106
|
-
|
|
3127
|
+
var currentViewData = this.getCurrentViewRecords();
|
|
3128
|
+
var currentRecord = currentViewData.filter(function (e) {
|
|
3129
|
+
return e.uniqueID === record.uniqueID;
|
|
3130
|
+
});
|
|
3131
|
+
var currentIndex = currentViewData.indexOf(currentRecord[0]);
|
|
3132
|
+
if (!isNullOrUndefined(gridRowsObject[currentIndex].visible) && gridRowsObject[currentIndex].visible !== false) {
|
|
3133
|
+
gridRowsObject[currentIndex].visible = true;
|
|
3107
3134
|
}
|
|
3108
3135
|
var detailrows = gridRows.filter(function (r) {
|
|
3109
3136
|
return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
|
|
3110
3137
|
});
|
|
3111
3138
|
for (var i = 0; i < rows.length; i++) {
|
|
3112
|
-
if (!isNullOrUndefined(rows[i])) {
|
|
3113
|
-
rows[i].style.display = displayAction;
|
|
3114
|
-
}
|
|
3115
|
-
if (!isNullOrUndefined(rows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3116
|
-
gridRowsObject[rows[i].rowIndex].visible = displayAction != 'none' ? true : false;
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3139
|
+
if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)])) {
|
|
3140
|
+
rows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3141
|
+
}
|
|
3142
|
+
if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3143
|
+
gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction != 'none' ? true : false;
|
|
3144
|
+
var parentRecord = currentViewData.filter(function (e) {
|
|
3145
|
+
return e.uniqueID === currentRecord[0].parentUniqueID;
|
|
3146
|
+
});
|
|
3147
|
+
if (!isNullOrUndefined(parentRecord[0]) && gridRows[currentViewData.indexOf(parentRecord[0])].getElementsByClassName('e-treegridcollapse').length) {
|
|
3148
|
+
gridRowsObject[currentIndex].visible = false;
|
|
3121
3149
|
}
|
|
3122
3150
|
}
|
|
3123
3151
|
if (!isNullOrUndefined(movableRows)) {
|
|
3124
|
-
movableRows[i].style.display = displayAction;
|
|
3152
|
+
movableRows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3125
3153
|
}
|
|
3126
3154
|
if (!isNullOrUndefined(freezeRightRows)) {
|
|
3127
|
-
freezeRightRows[i].style.display = displayAction;
|
|
3155
|
+
freezeRightRows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3128
3156
|
}
|
|
3129
|
-
this.notify('childRowExpand', { row: rows[i] });
|
|
3130
|
-
if ((!isNullOrUndefined(childRecords[i].childRecords) && childRecords[i].childRecords.length > 0) && (action !== 'expand' ||
|
|
3131
|
-
isNullOrUndefined(childRecords[i].expanded) || childRecords[i].expanded)) {
|
|
3132
|
-
this.expandCollapse(action, rows[i], childRecords[i], true);
|
|
3157
|
+
this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });
|
|
3158
|
+
if ((!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||
|
|
3159
|
+
isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {
|
|
3160
|
+
this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
|
|
3133
3161
|
if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {
|
|
3134
|
-
this.expandCollapse(action, movableRows[i], childRecords[i], true);
|
|
3162
|
+
this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
|
|
3135
3163
|
}
|
|
3136
3164
|
}
|
|
3137
3165
|
}
|
|
3138
3166
|
for (var i = 0; i < detailrows.length; i++) {
|
|
3139
|
-
if (!isNullOrUndefined(detailrows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3140
|
-
gridRowsObject[detailrows[i].rowIndex].visible = displayAction != 'none' ? true : false;
|
|
3141
|
-
detailrows[i].style.display = displayAction;
|
|
3167
|
+
if (!isNullOrUndefined(detailrows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
3168
|
+
gridRowsObject[detailrows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction != 'none' ? true : false;
|
|
3169
|
+
detailrows[parseInt(i.toString(), 10)].style.display = displayAction;
|
|
3142
3170
|
}
|
|
3143
3171
|
}
|
|
3144
3172
|
if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
|
|
@@ -3149,7 +3177,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3149
3177
|
if (this.enableAltRow && !this.rowTemplate) {
|
|
3150
3178
|
var visibleRowCount = 0;
|
|
3151
3179
|
for (var i = 0; rows && i < rows.length; i++) {
|
|
3152
|
-
var gridRow = rows[i];
|
|
3180
|
+
var gridRow = rows[parseInt(i.toString(), 10)];
|
|
3153
3181
|
if (gridRow.style.display !== 'none') {
|
|
3154
3182
|
if (gridRow.classList.contains('e-altrow')) {
|
|
3155
3183
|
removeClass([gridRow], 'e-altrow');
|
|
@@ -3169,9 +3197,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3169
3197
|
var rows = this.getContentTable().rows;
|
|
3170
3198
|
rows = [].slice.call(rows);
|
|
3171
3199
|
for (var i = 0; i < rows.length; i++) {
|
|
3172
|
-
var rcell = this.grid.getContentTable().rows[i
|
|
3173
|
-
|
|
3174
|
-
var
|
|
3200
|
+
var rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
|
|
3201
|
+
.cells[this.treeColumnIndex];
|
|
3202
|
+
var row = rows[parseInt(i.toString(), 10)];
|
|
3203
|
+
var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
|
|
3175
3204
|
var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
|
|
3176
3205
|
this.renderModule.cellRender(arg);
|
|
3177
3206
|
}
|
|
@@ -3196,28 +3225,28 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3196
3225
|
});
|
|
3197
3226
|
}
|
|
3198
3227
|
for (var i = 0; i < rows.length; i++) {
|
|
3199
|
-
rows[i].style.display = 'none';
|
|
3200
|
-
row = rows[i];
|
|
3201
|
-
var collapsingTd = rows[i].querySelector('.e-detailrowexpand');
|
|
3228
|
+
rows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3229
|
+
row = rows[parseInt(i.toString(), 10)];
|
|
3230
|
+
var collapsingTd = rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowexpand');
|
|
3202
3231
|
if (!isNullOrUndefined(collapsingTd)) {
|
|
3203
3232
|
this.grid.detailRowModule.collapse(collapsingTd);
|
|
3204
3233
|
}
|
|
3205
3234
|
if (freeze) {
|
|
3206
|
-
movablerows[i].style.display = 'none';
|
|
3207
|
-
rightrows[i].style.display = 'none';
|
|
3208
|
-
if (!rows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3209
|
-
if (movablerows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3210
|
-
row = movablerows[i];
|
|
3235
|
+
movablerows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3236
|
+
rightrows[parseInt(i.toString(), 10)].style.display = 'none';
|
|
3237
|
+
if (!rows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3238
|
+
if (movablerows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3239
|
+
row = movablerows[parseInt(i.toString(), 10)];
|
|
3211
3240
|
}
|
|
3212
|
-
else if (rightrows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3213
|
-
row = rightrows[i];
|
|
3241
|
+
else if (rightrows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3242
|
+
row = rightrows[parseInt(i.toString(), 10)];
|
|
3214
3243
|
}
|
|
3215
3244
|
}
|
|
3216
3245
|
}
|
|
3217
3246
|
if (row.querySelector('.e-treecolumn-container .e-treegridexpand')) {
|
|
3218
3247
|
var expandElement = row.querySelector('.e-treecolumn-container .e-treegridexpand');
|
|
3219
|
-
childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[i].rowIndex] :
|
|
3220
|
-
this.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
|
|
3248
|
+
childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex] :
|
|
3249
|
+
this.grid.getRowObjectFromUID(rows[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;
|
|
3221
3250
|
if (!isNullOrUndefined(expandElement) && childRecord.expanded) {
|
|
3222
3251
|
removeClass([expandElement], 'e-treegridexpand');
|
|
3223
3252
|
addClass([expandElement], 'e-treegridcollapse');
|
|
@@ -3225,8 +3254,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3225
3254
|
var cRow = [];
|
|
3226
3255
|
var eRows = this.getRows();
|
|
3227
3256
|
for (var i_1 = 0; i_1 < eRows.length; i_1++) {
|
|
3228
|
-
if (eRows[i_1].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {
|
|
3229
|
-
cRow.push(eRows[i_1]);
|
|
3257
|
+
if (eRows[parseInt(i_1.toString(), 10)].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {
|
|
3258
|
+
cRow.push(eRows[parseInt(i_1.toString(), 10)]);
|
|
3230
3259
|
}
|
|
3231
3260
|
}
|
|
3232
3261
|
if (cRow.length && childRecord.expanded) {
|
|
@@ -3246,13 +3275,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3246
3275
|
TreeGrid.prototype.updateRowAndCellElements = function (records, rows, index) {
|
|
3247
3276
|
for (var i = 0; i < records.length; i++) {
|
|
3248
3277
|
this.renderModule.cellRender({
|
|
3249
|
-
data: records[i], cell: rows[i].cells[index],
|
|
3278
|
+
data: records[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],
|
|
3250
3279
|
column: this.grid.getColumns()[this.treeColumnIndex],
|
|
3251
3280
|
requestType: 'rowDragAndDrop'
|
|
3252
3281
|
});
|
|
3253
3282
|
if (this['action'] === 'indenting' || this['action'] === 'outdenting') {
|
|
3254
3283
|
this.renderModule.RowModifier({
|
|
3255
|
-
data: records[i], row: rows[i]
|
|
3284
|
+
data: records[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]
|
|
3256
3285
|
});
|
|
3257
3286
|
}
|
|
3258
3287
|
}
|
|
@@ -3555,11 +3584,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3555
3584
|
};
|
|
3556
3585
|
TreeGrid.prototype.getFrozenCount = function (cols, cnt) {
|
|
3557
3586
|
for (var j = 0, len = cols.length; j < len; j++) {
|
|
3558
|
-
if (cols[j].columns) {
|
|
3559
|
-
cnt = this.getFrozenCount(cols[j].columns, cnt);
|
|
3587
|
+
if (cols[parseInt(j.toString(), 10)].columns) {
|
|
3588
|
+
cnt = this.getFrozenCount(cols[parseInt(j.toString(), 10)].columns, cnt);
|
|
3560
3589
|
}
|
|
3561
3590
|
else {
|
|
3562
|
-
if (cols[j].isFrozen) {
|
|
3591
|
+
if (cols[parseInt(j.toString(), 10)].isFrozen) {
|
|
3563
3592
|
cnt++;
|
|
3564
3593
|
}
|
|
3565
3594
|
}
|
|
@@ -3794,6 +3823,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3794
3823
|
__decorate([
|
|
3795
3824
|
Property('auto')
|
|
3796
3825
|
], TreeGrid.prototype, "width", void 0);
|
|
3826
|
+
__decorate([
|
|
3827
|
+
Complex({}, LoadingIndicator)
|
|
3828
|
+
], TreeGrid.prototype, "loadingIndicator", void 0);
|
|
3829
|
+
__decorate([
|
|
3830
|
+
Property(true)
|
|
3831
|
+
], TreeGrid.prototype, "enableVirtualMaskRow", void 0);
|
|
3797
3832
|
__decorate([
|
|
3798
3833
|
Property(false)
|
|
3799
3834
|
], TreeGrid.prototype, "enableVirtualization", void 0);
|