@syncfusion/ej2-treegrid 20.2.46 → 20.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -52
- package/dist/ej2-treegrid.min.js +10 -0
- 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 +432 -102
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +461 -107
- 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 +10 -10
- package/src/treegrid/actions/clipboard.d.ts +3 -2
- package/src/treegrid/actions/clipboard.js +3 -2
- package/src/treegrid/actions/context-menu.js +1 -1
- package/src/treegrid/actions/crud-actions.js +4 -0
- package/src/treegrid/actions/edit.js +23 -5
- package/src/treegrid/actions/filter.js +0 -4
- package/src/treegrid/actions/freeze-column.d.ts +1 -0
- package/src/treegrid/actions/freeze-column.js +39 -3
- package/src/treegrid/actions/rowdragdrop.js +8 -5
- package/src/treegrid/actions/selection.js +11 -2
- package/src/treegrid/actions/toolbar.js +43 -41
- package/src/treegrid/actions/virtual-scroll.js +7 -4
- package/src/treegrid/base/constant.d.ts +28 -0
- package/src/treegrid/base/constant.js +28 -0
- package/src/treegrid/base/data.d.ts +1 -0
- package/src/treegrid/base/data.js +3 -2
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +2 -0
- package/src/treegrid/base/treegrid.js +46 -9
- package/src/treegrid/renderer/virtual-row-model-generator.js +4 -0
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +3 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +68 -9
- package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
- package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
- package/styles/bootstrap-dark.css +5 -1
- package/styles/bootstrap.css +5 -1
- package/styles/bootstrap4.css +5 -1
- package/styles/bootstrap5-dark.css +6 -1
- package/styles/bootstrap5.css +6 -1
- package/styles/fabric-dark.css +5 -1
- package/styles/fabric.css +5 -1
- package/styles/fluent-dark.css +5 -1
- package/styles/fluent.css +5 -1
- package/styles/highcontrast-light.css +5 -1
- package/styles/highcontrast.css +5 -1
- package/styles/material-dark.css +5 -1
- package/styles/material.css +5 -1
- package/styles/tailwind-dark.css +5 -1
- package/styles/tailwind.css +5 -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 +0 -1
- package/styles/treegrid/_highcontrast-definition.scss +0 -1
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
- package/styles/treegrid/_icons.scss +1 -1
- package/styles/treegrid/_layout.scss +3 -3
- package/styles/treegrid/_material-definition.scss +0 -1
- package/styles/treegrid/_material3-definition.scss +0 -1
- package/styles/treegrid/_tailwind-definition.scss +0 -1
- package/styles/treegrid/_theme.scss +1 -0
- package/styles/treegrid/bootstrap-dark.css +5 -1
- package/styles/treegrid/bootstrap.css +5 -1
- package/styles/treegrid/bootstrap4.css +5 -1
- package/styles/treegrid/bootstrap5-dark.css +6 -1
- package/styles/treegrid/bootstrap5.css +6 -1
- package/styles/treegrid/fabric-dark.css +5 -1
- package/styles/treegrid/fabric.css +5 -1
- package/styles/treegrid/fluent-dark.css +5 -1
- package/styles/treegrid/fluent.css +5 -1
- package/styles/treegrid/highcontrast-light.css +5 -1
- package/styles/treegrid/highcontrast.css +5 -1
- package/styles/treegrid/icons/_bootstrap-dark.scss +1 -1
- package/styles/treegrid/icons/_bootstrap.scss +1 -1
- package/styles/treegrid/icons/_bootstrap4.scss +1 -1
- package/styles/treegrid/icons/_fabric-dark.scss +1 -1
- package/styles/treegrid/icons/_fabric.scss +1 -1
- package/styles/treegrid/icons/_highcontrast-light.scss +1 -1
- package/styles/treegrid/icons/_material-dark.scss +1 -1
- package/styles/treegrid/material-dark.css +5 -1
- package/styles/treegrid/material.css +5 -1
- package/styles/treegrid/tailwind-dark.css +5 -1
- package/styles/treegrid/tailwind.css +5 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnFreezeContentRenderer, ColumnFreezeHeaderRenderer, ColumnMenu, ColumnVirtualFreezeRenderer, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, FreezeContentRender, FreezeRender, FreezeRowModelGenerator, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualFreezeHdrRenderer, VirtualFreezeRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, setDebounce, templateCompiler } from '@syncfusion/ej2-grids';
|
|
3
3
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
|
4
4
|
import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
|
|
5
5
|
import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
@@ -440,6 +440,34 @@ const rowDropped = 'row-dropped';
|
|
|
440
440
|
const autoCol = 'auto-col';
|
|
441
441
|
/** @hidden */
|
|
442
442
|
const rowDeselecting = 'rowDeselecting';
|
|
443
|
+
/** @hidden */
|
|
444
|
+
const headerContent = 'e-headercontent';
|
|
445
|
+
/** @hidden */
|
|
446
|
+
const movableContent = 'e-movablecontent';
|
|
447
|
+
/** @hidden */
|
|
448
|
+
const movableHeader = 'e-movableheader';
|
|
449
|
+
/** @hidden */
|
|
450
|
+
const frozenContent = 'e-frozencontent';
|
|
451
|
+
/** @hidden */
|
|
452
|
+
const frozenHeader = 'e-frozenheader';
|
|
453
|
+
/** @hidden */
|
|
454
|
+
const content = 'e-content';
|
|
455
|
+
/** @hidden */
|
|
456
|
+
const table = 'e-table';
|
|
457
|
+
/** @hidden */
|
|
458
|
+
const leftRight = 'Left-Right';
|
|
459
|
+
/** @hidden */
|
|
460
|
+
const frozenRight = 'frozen-right';
|
|
461
|
+
/** @hidden */
|
|
462
|
+
const frozenLeft = 'frozen-left';
|
|
463
|
+
/** @hidden */
|
|
464
|
+
const dataColIndex = 'data-colindex';
|
|
465
|
+
/** @hidden */
|
|
466
|
+
const ariaColIndex = 'aria-colindex';
|
|
467
|
+
/** @hidden */
|
|
468
|
+
const dataRowIndex = 'data-rowindex';
|
|
469
|
+
/** @hidden */
|
|
470
|
+
const ariaRowIndex = 'aria-rowindex';
|
|
443
471
|
|
|
444
472
|
/**
|
|
445
473
|
* The `Clipboard` module is used to handle clipboard copy action.
|
|
@@ -447,11 +475,12 @@ const rowDeselecting = 'rowDeselecting';
|
|
|
447
475
|
* @hidden
|
|
448
476
|
*/
|
|
449
477
|
class TreeClipboard extends Clipboard {
|
|
450
|
-
constructor(parent) {
|
|
451
|
-
super(parent.grid);
|
|
478
|
+
constructor(parent, serviceLocator) {
|
|
479
|
+
super(parent.grid, serviceLocator);
|
|
452
480
|
this.treeCopyContent = '';
|
|
453
481
|
this.copiedUniqueIdCollection = [];
|
|
454
482
|
this.treeGridParent = parent;
|
|
483
|
+
this.serviceLocator = serviceLocator;
|
|
455
484
|
}
|
|
456
485
|
setCopyData(withHeader) {
|
|
457
486
|
const copyContent = 'copyContent';
|
|
@@ -1065,6 +1094,8 @@ class Selection {
|
|
|
1065
1094
|
headerSelection(checkAll) {
|
|
1066
1095
|
let index = -1;
|
|
1067
1096
|
let length = 0;
|
|
1097
|
+
//This property used to maintain the check state of the currentview data after clear filtering
|
|
1098
|
+
let multiFilterCheckState = false;
|
|
1068
1099
|
if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {
|
|
1069
1100
|
const filterResult = this.parent.filterModule.filteredResult;
|
|
1070
1101
|
if (this.filteredList.length === 0) {
|
|
@@ -1073,6 +1104,10 @@ class Selection {
|
|
|
1073
1104
|
else {
|
|
1074
1105
|
if (this.filteredList !== filterResult) {
|
|
1075
1106
|
this.filteredList = filterResult;
|
|
1107
|
+
multiFilterCheckState = true;
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
multiFilterCheckState = false;
|
|
1076
1111
|
}
|
|
1077
1112
|
}
|
|
1078
1113
|
}
|
|
@@ -1091,6 +1126,9 @@ class Selection {
|
|
|
1091
1126
|
if (data[i].checkboxState === 'check') {
|
|
1092
1127
|
continue;
|
|
1093
1128
|
}
|
|
1129
|
+
if (multiFilterCheckState) {
|
|
1130
|
+
continue;
|
|
1131
|
+
}
|
|
1094
1132
|
data[i].checkboxState = 'check';
|
|
1095
1133
|
this.updateSelectedItems(data[i], data[i].checkboxState);
|
|
1096
1134
|
}
|
|
@@ -1238,8 +1276,8 @@ class Selection {
|
|
|
1238
1276
|
childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?
|
|
1239
1277
|
this.parent.getCurrentViewRecords() : this.parent.flatData;
|
|
1240
1278
|
childData.forEach((record) => {
|
|
1241
|
-
if (this.parent.enableVirtualization
|
|
1242
|
-
if (record.hasChildRecords) {
|
|
1279
|
+
if (this.parent.enableVirtualization) {
|
|
1280
|
+
if (record.hasChildRecords && record.childRecords.length > 0) {
|
|
1243
1281
|
this.updateParentSelection(record);
|
|
1244
1282
|
}
|
|
1245
1283
|
else {
|
|
@@ -2079,8 +2117,8 @@ class DataManipulation {
|
|
|
2079
2117
|
if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
|
|
2080
2118
|
currentData.index = this.storedIndex;
|
|
2081
2119
|
}
|
|
2082
|
-
if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
|
|
2083
|
-
|
|
2120
|
+
if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) || ((currentData[this.parent.hasChildMapping]) &&
|
|
2121
|
+
isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result) || this.parent.enableInfiniteScrolling))) {
|
|
2084
2122
|
currentData.hasChildRecords = true;
|
|
2085
2123
|
if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
|
|
2086
2124
|
&& isNullOrUndefined(currentData[this.parent.childMapping])) {
|
|
@@ -2116,6 +2154,7 @@ class DataManipulation {
|
|
|
2116
2154
|
currentData.checkboxState = 'uncheck';
|
|
2117
2155
|
if (isNullOrUndefined(currentData[this.parent.parentIdMapping]) || currentData.parentItem) {
|
|
2118
2156
|
this.parent.flatData.push(currentData);
|
|
2157
|
+
this.parent['infiniteScrollData'].push(currentData);
|
|
2119
2158
|
}
|
|
2120
2159
|
if (!this.isSelfReference && currentData.level === 0) {
|
|
2121
2160
|
this.parent.parentData.push(currentData);
|
|
@@ -2871,6 +2910,10 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
|
|
|
2871
2910
|
index = i;
|
|
2872
2911
|
return;
|
|
2873
2912
|
} });
|
|
2913
|
+
if (control.enableVirtualization && isNullOrUndefined(index)) {
|
|
2914
|
+
const updatedParent = getValue('uniqueIDCollection.' + child.parentUniqueID, control);
|
|
2915
|
+
record = updatedParent;
|
|
2916
|
+
}
|
|
2874
2917
|
if (!isNullOrUndefined(index)) {
|
|
2875
2918
|
record = currentRecords[index];
|
|
2876
2919
|
}
|
|
@@ -3295,6 +3338,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3295
3338
|
initProperties() {
|
|
3296
3339
|
this.defaultLocale = {};
|
|
3297
3340
|
this.flatData = [];
|
|
3341
|
+
this.infiniteScrollData = [];
|
|
3298
3342
|
this.parentData = [];
|
|
3299
3343
|
this.columnModel = [];
|
|
3300
3344
|
this.isExpandAll = false;
|
|
@@ -3584,7 +3628,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3584
3628
|
if (!isNullOrUndefined(this.grid.clipboardModule)) {
|
|
3585
3629
|
this.grid.clipboardModule.destroy();
|
|
3586
3630
|
}
|
|
3587
|
-
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);
|
|
3631
|
+
this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this, this.grid.serviceLocator);
|
|
3588
3632
|
}
|
|
3589
3633
|
convertTreeData(data) {
|
|
3590
3634
|
if (isCountRequired(this)) {
|
|
@@ -3676,13 +3720,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3676
3720
|
this.grid[templateInstance] = this[templateInstance];
|
|
3677
3721
|
const isJsComponent = 'isJsComponent';
|
|
3678
3722
|
this.grid[isJsComponent] = true;
|
|
3723
|
+
this.grid.enableVirtualMaskRow = false; // Need to update in virtual mask row feature implementation.
|
|
3679
3724
|
}
|
|
3680
3725
|
triggerEvents(args) {
|
|
3681
3726
|
this.trigger(getObject('name', args), args);
|
|
3682
3727
|
}
|
|
3683
3728
|
IsExpandCollapseClicked(args) {
|
|
3684
|
-
if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
|
|
3685
|
-
|| args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
|
|
3729
|
+
if (args['name'] === "rowSelecting" && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
|
|
3730
|
+
|| args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')) && (isNullOrUndefined(args['previousRowIndex']))) {
|
|
3731
|
+
args.cancel = true;
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3734
|
+
else if (args['name'] === "rowDeselecting" && !isNullOrUndefined(args.target) && ((!isNullOrUndefined(args.row) && (!args.row.length)) && (args.target.classList.contains('e-treegridexpand')
|
|
3735
|
+
|| args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')))) {
|
|
3686
3736
|
args.cancel = true;
|
|
3687
3737
|
return;
|
|
3688
3738
|
}
|
|
@@ -3738,7 +3788,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3738
3788
|
this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);
|
|
3739
3789
|
this.grid.dataSourceChanged = this.triggerEvents.bind(this);
|
|
3740
3790
|
this.grid.recordDoubleClick = this.triggerEvents.bind(this);
|
|
3741
|
-
this.grid.rowDeselecting = this.triggerEvents.bind(this);
|
|
3742
3791
|
this.grid.cellDeselected = this.triggerEvents.bind(this);
|
|
3743
3792
|
this.grid.cellDeselecting = this.triggerEvents.bind(this);
|
|
3744
3793
|
this.grid.columnMenuOpen = this.triggerEvents.bind(this);
|
|
@@ -3916,6 +3965,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3916
3965
|
this.grid.dataSource = { result: this.flatData, count: getValue('count', this.grid.dataSource) };
|
|
3917
3966
|
}
|
|
3918
3967
|
else {
|
|
3968
|
+
if (args.action.requestType !== 'infiniteScroll') {
|
|
3969
|
+
this.infiniteScrollData = [];
|
|
3970
|
+
}
|
|
3919
3971
|
this.trigger(dataStateChange, args);
|
|
3920
3972
|
}
|
|
3921
3973
|
};
|
|
@@ -4058,6 +4110,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4058
4110
|
if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary === true).length) {
|
|
4059
4111
|
this.grid.refresh();
|
|
4060
4112
|
}
|
|
4113
|
+
if (args.action === 'filter') {
|
|
4114
|
+
if (this.filterModule['currentFilterObject'] !== '' && this.enableVirtualization && !this.initialRender) {
|
|
4115
|
+
this.expandAll();
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
if (args.requestType === 'searching') {
|
|
4119
|
+
if (this.searchSettings.key !== '' && this.enableVirtualization && !this.initialRender) {
|
|
4120
|
+
this.expandAll();
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
if (args.action === 'clearFilter' && this.enableCollapseAll) {
|
|
4124
|
+
this.collapseAll();
|
|
4125
|
+
}
|
|
4061
4126
|
if (this.action === 'indenting' || this.action === 'outdenting') {
|
|
4062
4127
|
this.action = this.action === 'indenting' ? 'indented' : 'outdented';
|
|
4063
4128
|
const selectedItem = [this.selectedRecords];
|
|
@@ -4080,6 +4145,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4080
4145
|
this.selectedRecords = this.selectedRows = this.modifiedRecords = [];
|
|
4081
4146
|
}
|
|
4082
4147
|
else {
|
|
4148
|
+
if (this.grid.isFrozenGrid() && this.enableVirtualization && args['tableName'] === 'movable') {
|
|
4149
|
+
const movableContent$$1 = this.grid.element.querySelector('.' + movableContent);
|
|
4150
|
+
const frozenContent$$1 = this.grid.element.querySelector('.' + frozenContent);
|
|
4151
|
+
movableContent$$1.style.height = frozenContent$$1.style.height = 'auto';
|
|
4152
|
+
}
|
|
4083
4153
|
this.trigger(actionComplete, args);
|
|
4084
4154
|
}
|
|
4085
4155
|
};
|
|
@@ -4921,8 +4991,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4921
4991
|
this.grid.setRowData(key, rowData);
|
|
4922
4992
|
const visibleRecords = this.getVisibleRecords();
|
|
4923
4993
|
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {
|
|
4924
|
-
const table = this.getContentTable();
|
|
4925
|
-
const sHeight = table.scrollHeight;
|
|
4994
|
+
const table$$1 = this.getContentTable();
|
|
4995
|
+
const sHeight = table$$1.scrollHeight;
|
|
4926
4996
|
const clientHeight = this.getContent().clientHeight;
|
|
4927
4997
|
this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);
|
|
4928
4998
|
}
|
|
@@ -5395,6 +5465,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5395
5465
|
else {
|
|
5396
5466
|
const rowInfo = this.grid.getRowInfo(target);
|
|
5397
5467
|
let record = rowInfo.rowData;
|
|
5468
|
+
if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {
|
|
5469
|
+
const freezeRows = 'freezeRows';
|
|
5470
|
+
record = this.grid.contentModule[freezeRows].filter((e) => e.uid === rowInfo.row.getAttribute('data-uid'))[0].data;
|
|
5471
|
+
}
|
|
5398
5472
|
if (this.enableImmutableMode) {
|
|
5399
5473
|
record = this.getCurrentViewRecords()[rowInfo.rowIndex];
|
|
5400
5474
|
}
|
|
@@ -5806,8 +5880,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5806
5880
|
totalRows = [].slice.call(rows);
|
|
5807
5881
|
for (let i = totalRows.length - 1; i >= 0; i--) {
|
|
5808
5882
|
if (!isHidden(totalRows[i])) {
|
|
5809
|
-
const table = this.getContentTable();
|
|
5810
|
-
const sHeight = table.scrollHeight;
|
|
5883
|
+
const table$$1 = this.getContentTable();
|
|
5884
|
+
const sHeight = table$$1.scrollHeight;
|
|
5811
5885
|
const clientHeight = this.getContent().clientHeight;
|
|
5812
5886
|
this.lastRowBorder(totalRows[i], sHeight <= clientHeight);
|
|
5813
5887
|
break;
|
|
@@ -5826,6 +5900,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5826
5900
|
this.trigger(dataStateChange, expandingArgs);
|
|
5827
5901
|
deff.promise.then(() => {
|
|
5828
5902
|
if (expandingArgs.childData.length) {
|
|
5903
|
+
this.flatData = this.infiniteScrollData;
|
|
5829
5904
|
const currentData = (this.flatData);
|
|
5830
5905
|
let index = 0;
|
|
5831
5906
|
for (let i = 0; i < currentData.length; i++) {
|
|
@@ -5875,8 +5950,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5875
5950
|
}
|
|
5876
5951
|
}
|
|
5877
5952
|
this.isExpandRefresh = true;
|
|
5953
|
+
const scrollHeightBeforeRefresh = this.getContentTable().parentElement.scrollTop;
|
|
5878
5954
|
this.grid.refresh();
|
|
5879
5955
|
this.setHeightForFrozenContent();
|
|
5956
|
+
if (this.enableInfiniteScrolling) {
|
|
5957
|
+
this.getContentTable().parentElement.scrollTop = scrollHeightBeforeRefresh;
|
|
5958
|
+
}
|
|
5880
5959
|
this.trigger(expanded, expandingArgs);
|
|
5881
5960
|
});
|
|
5882
5961
|
}
|
|
@@ -7117,13 +7196,16 @@ class RowDD$1 {
|
|
|
7117
7196
|
for (let i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
7118
7197
|
if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {
|
|
7119
7198
|
dropIndex = i;
|
|
7199
|
+
if (tObj.enableVirtualization) {
|
|
7200
|
+
dropIndex = parseInt(tObj.getRows()[i].getAttribute('data-rowindex'), 10);
|
|
7201
|
+
}
|
|
7120
7202
|
}
|
|
7121
7203
|
}
|
|
7122
7204
|
}
|
|
7123
7205
|
else {
|
|
7124
7206
|
dropIndex = this.selectedRow.rowIndex - 1;
|
|
7125
7207
|
}
|
|
7126
|
-
if (this.parent.enableVirtualization && this.
|
|
7208
|
+
if (this.parent.enableVirtualization && this.selectedRecord && !(record.level > this.selectedRecord.level)) {
|
|
7127
7209
|
dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;
|
|
7128
7210
|
}
|
|
7129
7211
|
tObj[action] = 'indenting';
|
|
@@ -7138,11 +7220,11 @@ class RowDD$1 {
|
|
|
7138
7220
|
let dropIndex;
|
|
7139
7221
|
const parentItem = this.selectedRecord.parentItem;
|
|
7140
7222
|
for (let i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
7141
|
-
if (tObj.getCurrentViewRecords()[i].
|
|
7223
|
+
if (tObj.getCurrentViewRecords()[i].uniqueID === parentItem.uniqueID) {
|
|
7142
7224
|
dropIndex = i;
|
|
7143
7225
|
}
|
|
7144
7226
|
}
|
|
7145
|
-
if (this.parent.enableVirtualization && this.
|
|
7227
|
+
if (this.parent.enableVirtualization && this.selectedRecord) {
|
|
7146
7228
|
dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('data-rowindex'), 10);
|
|
7147
7229
|
}
|
|
7148
7230
|
tObj[action] = 'outdenting';
|
|
@@ -7161,7 +7243,7 @@ class RowDD$1 {
|
|
|
7161
7243
|
this.parent.trigger(actionBegin, actionArgs, (actionArgs) => {
|
|
7162
7244
|
if (!actionArgs.cancel) {
|
|
7163
7245
|
if (actionArgs.action === 'indenting') {
|
|
7164
|
-
if (this.parent.enableVirtualization
|
|
7246
|
+
if (this.parent.enableVirtualization) {
|
|
7165
7247
|
this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');
|
|
7166
7248
|
}
|
|
7167
7249
|
else {
|
|
@@ -7169,7 +7251,7 @@ class RowDD$1 {
|
|
|
7169
7251
|
}
|
|
7170
7252
|
}
|
|
7171
7253
|
else if (actionArgs.action === 'outdenting') {
|
|
7172
|
-
if (this.parent.enableVirtualization
|
|
7254
|
+
if (this.parent.enableVirtualization) {
|
|
7173
7255
|
this.reorderRows([parseInt(this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');
|
|
7174
7256
|
}
|
|
7175
7257
|
else {
|
|
@@ -7522,16 +7604,16 @@ class RowDD$1 {
|
|
|
7522
7604
|
classList(ele, ['e-errorcontainer'], []);
|
|
7523
7605
|
classList(ele, ['e-icons', 'e-errorelem'], []);
|
|
7524
7606
|
const errorVal = dragelem.querySelector('.errorValue');
|
|
7525
|
-
let content = dragelem.querySelector('.e-rowcell').innerHTML;
|
|
7607
|
+
let content$$1 = dragelem.querySelector('.e-rowcell').innerHTML;
|
|
7526
7608
|
if (errorVal) {
|
|
7527
|
-
content = errorVal.innerHTML;
|
|
7609
|
+
content$$1 = errorVal.innerHTML;
|
|
7528
7610
|
errorVal.parentNode.removeChild(errorVal);
|
|
7529
7611
|
}
|
|
7530
7612
|
dragelem.querySelector('.e-rowcell').innerHTML = '';
|
|
7531
7613
|
const spanContent = document.createElement('span');
|
|
7532
7614
|
spanContent.className = 'errorValue';
|
|
7533
7615
|
spanContent.style.paddingLeft = '16px';
|
|
7534
|
-
spanContent.innerHTML = content;
|
|
7616
|
+
spanContent.innerHTML = content$$1;
|
|
7535
7617
|
dragelem.querySelector('.e-rowcell').appendChild(ele);
|
|
7536
7618
|
dragelem.querySelector('.e-rowcell').appendChild(spanContent);
|
|
7537
7619
|
const dropItemSpan = document.querySelector('.e-dropitemscount');
|
|
@@ -8380,6 +8462,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
8380
8462
|
const currentPage = this[model].currentPage;
|
|
8381
8463
|
if (clear) {
|
|
8382
8464
|
this.cache = {};
|
|
8465
|
+
this.movableCache = {};
|
|
8466
|
+
this.frozenRightCache = {};
|
|
8383
8467
|
this.data = {};
|
|
8384
8468
|
this.groups = {};
|
|
8385
8469
|
}
|
|
@@ -8393,6 +8477,8 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
8393
8477
|
this.cache = {};
|
|
8394
8478
|
this.data = {};
|
|
8395
8479
|
this.groups = {};
|
|
8480
|
+
this.movableCache = {};
|
|
8481
|
+
this.frozenRightCache = {};
|
|
8396
8482
|
}
|
|
8397
8483
|
}
|
|
8398
8484
|
return clear;
|
|
@@ -8557,10 +8643,6 @@ class Filter$1 {
|
|
|
8557
8643
|
}
|
|
8558
8644
|
}
|
|
8559
8645
|
else {
|
|
8560
|
-
if ((!this.parent.enableCollapseAll || !this.parent.initialRender && isNullOrUndefined(this.parent['dataResults']['result']))
|
|
8561
|
-
&& parent['expanded'] === false && this.parent.getVisibleRecords().indexOf(record) === -1) {
|
|
8562
|
-
this.parent.expandRow(this.parent.getRows()[parent['index']], parent);
|
|
8563
|
-
}
|
|
8564
8646
|
this.addParentRecord(parent);
|
|
8565
8647
|
}
|
|
8566
8648
|
}
|
|
@@ -9231,53 +9313,55 @@ class Toolbar$1 {
|
|
|
9231
9313
|
this.parent.off(toolbarClick, this.toolbarClickHandler);
|
|
9232
9314
|
}
|
|
9233
9315
|
refreshToolbar(args) {
|
|
9234
|
-
const tObj = this.parent;
|
|
9235
|
-
let indentElement;
|
|
9236
|
-
let outdentElement;
|
|
9237
|
-
const indentID = tObj.element.id + '_gridcontrol_indent';
|
|
9238
|
-
const outdentID = tObj.element.id + '_gridcontrol_outdent';
|
|
9239
9316
|
const toolbarElement = this.parent.grid.toolbarModule.getToolbar();
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
if (
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9317
|
+
if (!isNullOrUndefined(toolbarElement)) {
|
|
9318
|
+
const tObj = this.parent;
|
|
9319
|
+
let indentElement;
|
|
9320
|
+
let outdentElement;
|
|
9321
|
+
const indentID = tObj.element.id + '_gridcontrol_indent';
|
|
9322
|
+
const outdentID = tObj.element.id + '_gridcontrol_outdent';
|
|
9323
|
+
const indentEle = toolbarElement.querySelector('#' + indentID);
|
|
9324
|
+
const outdentEle = toolbarElement.querySelector('#' + outdentID);
|
|
9325
|
+
let row = args.row;
|
|
9326
|
+
const selectedrow = tObj.getSelectedRows()[0];
|
|
9327
|
+
if (!isNullOrUndefined(row[0])) {
|
|
9328
|
+
row = row[0];
|
|
9329
|
+
}
|
|
9330
|
+
row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;
|
|
9331
|
+
if (indentEle !== null && outdentEle !== null) {
|
|
9332
|
+
indentElement = toolbarElement.querySelector('#' + indentID).parentElement;
|
|
9333
|
+
outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;
|
|
9334
|
+
if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
|
|
9335
|
+
indentElement.classList.add('e-hidden');
|
|
9336
|
+
outdentElement.classList.add('e-hidden');
|
|
9337
|
+
}
|
|
9338
|
+
else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
|
|
9339
|
+
const selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];
|
|
9340
|
+
if (!isNullOrUndefined(selectedItem)) {
|
|
9341
|
+
if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {
|
|
9342
|
+
indentElement.classList.add('e-hidden');
|
|
9343
|
+
}
|
|
9344
|
+
else {
|
|
9345
|
+
indentElement.classList.remove('e-hidden');
|
|
9346
|
+
}
|
|
9347
|
+
if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {
|
|
9348
|
+
indentElement.classList.remove('e-hidden');
|
|
9349
|
+
}
|
|
9350
|
+
if (selectedItem.level === 0) {
|
|
9351
|
+
outdentElement.classList.add('e-hidden');
|
|
9352
|
+
}
|
|
9353
|
+
if (selectedItem.level !== 0) {
|
|
9354
|
+
outdentElement.classList.remove('e-hidden');
|
|
9355
|
+
}
|
|
9263
9356
|
}
|
|
9264
|
-
|
|
9265
|
-
|
|
9357
|
+
}
|
|
9358
|
+
if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
|
|
9359
|
+
if (this.parent.toolbar['includes']('Indent')) {
|
|
9360
|
+
indentElement.classList.add('e-hidden');
|
|
9266
9361
|
}
|
|
9267
|
-
if (
|
|
9362
|
+
if (this.parent.toolbar['includes']('Outdent')) {
|
|
9268
9363
|
outdentElement.classList.add('e-hidden');
|
|
9269
9364
|
}
|
|
9270
|
-
if (selectedItem.level !== 0) {
|
|
9271
|
-
outdentElement.classList.remove('e-hidden');
|
|
9272
|
-
}
|
|
9273
|
-
}
|
|
9274
|
-
}
|
|
9275
|
-
if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
|
|
9276
|
-
if (this.parent.toolbar['includes']('Indent')) {
|
|
9277
|
-
indentElement.classList.add('e-hidden');
|
|
9278
|
-
}
|
|
9279
|
-
if (this.parent.toolbar['includes']('Outdent')) {
|
|
9280
|
-
outdentElement.classList.add('e-hidden');
|
|
9281
9365
|
}
|
|
9282
9366
|
}
|
|
9283
9367
|
}
|
|
@@ -9766,7 +9850,7 @@ class ContextMenu$1 {
|
|
|
9766
9850
|
const indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
|
|
9767
9851
|
const outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
|
|
9768
9852
|
if (addRow) {
|
|
9769
|
-
if (this.parent.grid.editSettings.allowAdding === false) {
|
|
9853
|
+
if (this.parent.grid.editSettings.allowAdding === false || this.parent.grid.isEdit) {
|
|
9770
9854
|
addRow.style.display = 'none';
|
|
9771
9855
|
}
|
|
9772
9856
|
else {
|
|
@@ -10135,13 +10219,13 @@ class BatchEdit {
|
|
|
10135
10219
|
this.updateRowIndex();
|
|
10136
10220
|
// update focus module, need to refix this once grid source modified.
|
|
10137
10221
|
const focusModule = getValue('focusModule', this.parent.grid);
|
|
10138
|
-
const table = this.parent.getContentTable();
|
|
10222
|
+
const table$$1 = this.parent.getContentTable();
|
|
10139
10223
|
if (this.parent.getBatchChanges()[this.deletedRecords].length && this.parent.editSettings.newRowPosition === 'Above') {
|
|
10140
10224
|
actualIndex = e.row.rowIndex;
|
|
10141
10225
|
focusModule.getContent().matrix.matrix = this.matrix;
|
|
10142
10226
|
}
|
|
10143
10227
|
else {
|
|
10144
|
-
actualIndex = table.getElementsByClassName('e-batchrow')[0].rowIndex;
|
|
10228
|
+
actualIndex = table$$1.getElementsByClassName('e-batchrow')[0].rowIndex;
|
|
10145
10229
|
// if (this.parent.frozenRows || this.parent.frozenColumns) {
|
|
10146
10230
|
// actualIndex = this.batchIndex;
|
|
10147
10231
|
// }
|
|
@@ -10806,6 +10890,9 @@ class Edit$1 {
|
|
|
10806
10890
|
args.cancel = true;
|
|
10807
10891
|
}
|
|
10808
10892
|
}
|
|
10893
|
+
if (this.parent.enableVirtualization) {
|
|
10894
|
+
this.parent.grid.contentModule['editedRowIndex'] = this.parent.grid.editModule.editModule['index'];
|
|
10895
|
+
}
|
|
10809
10896
|
// if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {
|
|
10810
10897
|
// this.isAdd = false;
|
|
10811
10898
|
// }
|
|
@@ -10924,6 +11011,9 @@ class Edit$1 {
|
|
|
10924
11011
|
this.parent.grid.isEdit = true;
|
|
10925
11012
|
}
|
|
10926
11013
|
}
|
|
11014
|
+
if (this.parent.enableVirtualization) {
|
|
11015
|
+
this.parent.grid.contentModule['virtualData'] = {};
|
|
11016
|
+
}
|
|
10927
11017
|
}
|
|
10928
11018
|
afterCellSave(args, row, rowIndex) {
|
|
10929
11019
|
let mRow;
|
|
@@ -11173,7 +11263,12 @@ class Edit$1 {
|
|
|
11173
11263
|
if (isVirtualization) {
|
|
11174
11264
|
this.prevAriaRowIndex = '-1';
|
|
11175
11265
|
}
|
|
11176
|
-
|
|
11266
|
+
if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
|
|
11267
|
+
focussedElement.focus();
|
|
11268
|
+
}
|
|
11269
|
+
if (this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {
|
|
11270
|
+
this.parent.grid.contentModule['createEmptyRowdata']();
|
|
11271
|
+
}
|
|
11177
11272
|
}
|
|
11178
11273
|
}
|
|
11179
11274
|
if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {
|
|
@@ -11293,6 +11388,9 @@ class Edit$1 {
|
|
|
11293
11388
|
}
|
|
11294
11389
|
if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {
|
|
11295
11390
|
this.addRowRecord = this.parent.flatData[this.parent.grid.selectedRowIndex];
|
|
11391
|
+
if (this.parent.enableVirtualization && this.isAddedRowByContextMenu) {
|
|
11392
|
+
this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];
|
|
11393
|
+
}
|
|
11296
11394
|
}
|
|
11297
11395
|
else {
|
|
11298
11396
|
this.addRowRecord = this.parent.getSelectedRecords()[0];
|
|
@@ -11329,15 +11427,18 @@ class Edit$1 {
|
|
|
11329
11427
|
let position = null;
|
|
11330
11428
|
value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
|
|
11331
11429
|
let currentData;
|
|
11332
|
-
if (this.parent.
|
|
11430
|
+
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
11431
|
+
currentData = this.parent.flatData;
|
|
11432
|
+
}
|
|
11433
|
+
else if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {
|
|
11333
11434
|
currentData = this.batchEditModule['batchRecords'];
|
|
11334
11435
|
}
|
|
11335
11436
|
else {
|
|
11336
11437
|
currentData = this.parent.grid.getCurrentViewRecords();
|
|
11337
11438
|
}
|
|
11338
11439
|
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
11339
|
-
this.addRowIndex = this.parent.
|
|
11340
|
-
this.selectedIndex =
|
|
11440
|
+
this.addRowIndex = this.parent.flatData.indexOf(this.addRowRecord);
|
|
11441
|
+
this.selectedIndex = this.addRowIndex;
|
|
11341
11442
|
}
|
|
11342
11443
|
let index = this.addRowIndex;
|
|
11343
11444
|
value.uniqueID = getUid(this.parent.element.id + '_data_');
|
|
@@ -11351,7 +11452,8 @@ class Edit$1 {
|
|
|
11351
11452
|
const rows = this.parent.getRows();
|
|
11352
11453
|
const firstAriaIndex = rows.length ? currentData.indexOf(currentData[0]) : 0;
|
|
11353
11454
|
const lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
|
|
11354
|
-
const withinRange = this.
|
|
11455
|
+
const withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :
|
|
11456
|
+
this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;
|
|
11355
11457
|
if (currentData.length) {
|
|
11356
11458
|
idMapping = currentData[this.addRowIndex][this.parent.idMapping];
|
|
11357
11459
|
parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];
|
|
@@ -11699,6 +11801,29 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11699
11801
|
getRowByIndex(index) {
|
|
11700
11802
|
return this.parent.getDataRows().filter((e) => parseInt(e.getAttribute('data-rowindex'), 10) === index)[0];
|
|
11701
11803
|
}
|
|
11804
|
+
getMovableVirtualRowByIndex(index) {
|
|
11805
|
+
return this.getRowCollection(index, true);
|
|
11806
|
+
}
|
|
11807
|
+
getFrozenRightVirtualRowByIndex(index) {
|
|
11808
|
+
return this.getRowCollection(index, false, false, true);
|
|
11809
|
+
}
|
|
11810
|
+
getRowCollection(index, isMovable, isRowObject, isFrozenRight) {
|
|
11811
|
+
const startIdx = parseInt(this.parent.getRows()[0].getAttribute(dataRowIndex), 10);
|
|
11812
|
+
let rowCollection = isMovable ? this.parent.getMovableDataRows() : this.parent.getDataRows();
|
|
11813
|
+
rowCollection = isFrozenRight ? this.parent.getFrozenRightDataRows() : rowCollection;
|
|
11814
|
+
const collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
|
|
11815
|
+
let selectedRow = collection[index - startIdx];
|
|
11816
|
+
if (this.parent.frozenRows && this.parent.pageSettings.currentPage > 1) {
|
|
11817
|
+
if (!isRowObject) {
|
|
11818
|
+
selectedRow = index <= this.parent.frozenRows ? rowCollection[index]
|
|
11819
|
+
: rowCollection[(index - startIdx) + this.parent.frozenRows];
|
|
11820
|
+
}
|
|
11821
|
+
else {
|
|
11822
|
+
selectedRow = index <= this.parent.frozenRows ? this.parent.getRowsObject()[index].data : selectedRow;
|
|
11823
|
+
}
|
|
11824
|
+
}
|
|
11825
|
+
return selectedRow;
|
|
11826
|
+
}
|
|
11702
11827
|
addEventListener() {
|
|
11703
11828
|
this.parent.on(virtualActionArgs, this.virtualOtherAction, this);
|
|
11704
11829
|
this.parent.on(indexModifier, this.indexModifier, this);
|
|
@@ -11714,10 +11839,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11714
11839
|
}
|
|
11715
11840
|
}
|
|
11716
11841
|
indexModifier(args) {
|
|
11717
|
-
const content = this.parent.getContent().querySelector('.e-content');
|
|
11842
|
+
const content$$1 = this.parent.getContent().querySelector('.e-content');
|
|
11718
11843
|
if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {
|
|
11719
11844
|
if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {
|
|
11720
|
-
const nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
|
|
11845
|
+
const nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
|
|
11721
11846
|
let lastIndex = nextSetResIndex + this.parent.getRows().length;
|
|
11722
11847
|
if (lastIndex > args.count) {
|
|
11723
11848
|
lastIndex = nextSetResIndex +
|
|
@@ -11726,7 +11851,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11726
11851
|
this.startIndex = lastIndex - this.parent.getRows().length;
|
|
11727
11852
|
this.endIndex = lastIndex;
|
|
11728
11853
|
}
|
|
11729
|
-
else {
|
|
11854
|
+
else if (this.parent.root.editSettings.newRowPosition !== 'Top' && this.parent.root.editModule.selectedIndex !== -1 || this.parent.root.editModule.selectedIndex !== -1) {
|
|
11730
11855
|
this.startIndex += 1;
|
|
11731
11856
|
this.endIndex += 1;
|
|
11732
11857
|
}
|
|
@@ -11777,7 +11902,15 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11777
11902
|
&& this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
|
|
11778
11903
|
if (!isNullOrUndefined(e.count)) {
|
|
11779
11904
|
this.totalRecords = e.count;
|
|
11780
|
-
|
|
11905
|
+
// To overcome the white space issue in last page when records collapsed
|
|
11906
|
+
if (this.parent.isFrozenGrid() && e.count < Object.keys(this.parent.dataSource).length) {
|
|
11907
|
+
const width = this.parent.enableColumnVirtualization ?
|
|
11908
|
+
this.getColumnOffset(this.parent.columns.length - 1) + 'px' : '100%';
|
|
11909
|
+
const height = (this.parent.getRowHeight() * e.count) -
|
|
11910
|
+
(this.parent.getRowHeight() * this.parent.pageSettings.pageSize);
|
|
11911
|
+
getValue('virtualEle', this).setVirtualHeight(height, width);
|
|
11912
|
+
}
|
|
11913
|
+
if (!this.parent.enableColumnVirtualization && !this.parent.isFrozenGrid()) {
|
|
11781
11914
|
getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
|
|
11782
11915
|
}
|
|
11783
11916
|
}
|
|
@@ -11875,6 +12008,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11875
12008
|
return new Cell(opt);
|
|
11876
12009
|
}
|
|
11877
12010
|
beginEdit(e) {
|
|
12011
|
+
this['editedRowIndex'] = e.index;
|
|
11878
12012
|
const selector = '.e-row[data-rowindex="' + e.index + '"]';
|
|
11879
12013
|
const index = this.parent.getContent().querySelector(selector).rowIndex;
|
|
11880
12014
|
const rowData = this.parent.getCurrentViewRecords()[index];
|
|
@@ -11914,8 +12048,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11914
12048
|
}
|
|
11915
12049
|
virtualEditSuccess() {
|
|
11916
12050
|
const isAdd = 'isAdd';
|
|
11917
|
-
const content = this.parent.getContent().querySelector('.e-content');
|
|
11918
|
-
if (this[isAdd] && content.querySelector('.e-addedrow')) {
|
|
12051
|
+
const content$$1 = this.parent.getContent().querySelector('.e-content');
|
|
12052
|
+
if (this[isAdd] && content$$1.querySelector('.e-addedrow')) {
|
|
11919
12053
|
this.recordAdded = true;
|
|
11920
12054
|
}
|
|
11921
12055
|
}
|
|
@@ -11929,10 +12063,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11929
12063
|
}
|
|
11930
12064
|
restoreNewRow() {
|
|
11931
12065
|
const isAdd = 'isAdd';
|
|
11932
|
-
const content = this.parent.getContent().querySelector('.e-content');
|
|
11933
|
-
if (this[isAdd] && !content.querySelector('.e-addedrow')) {
|
|
12066
|
+
const content$$1 = this.parent.getContent().querySelector('.e-content');
|
|
12067
|
+
if (this[isAdd] && !content$$1.querySelector('.e-addedrow')) {
|
|
11934
12068
|
this.parent.isEdit = false;
|
|
11935
|
-
this.parent.addRecord();
|
|
12069
|
+
this.parent.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);
|
|
11936
12070
|
}
|
|
11937
12071
|
}
|
|
11938
12072
|
getData(data) {
|
|
@@ -11945,7 +12079,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11945
12079
|
this.parent.notify('get-row-position', addArgs);
|
|
11946
12080
|
this.rowPosition = addArgs.newRowPosition;
|
|
11947
12081
|
this.addRowIndex = addArgs.addRowIndex;
|
|
11948
|
-
this.dataRowIndex =
|
|
12082
|
+
this.dataRowIndex = this.parent.root.editModule.selectedIndex;
|
|
11949
12083
|
}
|
|
11950
12084
|
const actionComplete$$1 = 'actionComplete';
|
|
11951
12085
|
super[actionComplete$$1](args);
|
|
@@ -11966,17 +12100,20 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11966
12100
|
const maxLeft = this.vgenerator.cOffsets[idx - 1];
|
|
11967
12101
|
x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
|
|
11968
12102
|
}
|
|
11969
|
-
this.
|
|
11970
|
-
|
|
11971
|
-
this.
|
|
12103
|
+
if (!this.parent.isFrozenGrid()) {
|
|
12104
|
+
this.virtualEle.adjustTable(x, this.translateY);
|
|
12105
|
+
if (this.parent.enableColumnVirtualization) {
|
|
12106
|
+
this.header.virtualEle.adjustTable(x, 0);
|
|
12107
|
+
}
|
|
11972
12108
|
}
|
|
11973
12109
|
}
|
|
11974
12110
|
};
|
|
11975
12111
|
}
|
|
11976
12112
|
scrollListeners(scrollArgs) {
|
|
12113
|
+
this['scrollAfterEdit']();
|
|
11977
12114
|
const info = scrollArgs.sentinel;
|
|
11978
12115
|
const outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
|
|
11979
|
-
const content = this.parent.getContent().querySelector('.e-content');
|
|
12116
|
+
const content$$1 = this.parent.getContent().querySelector('.e-content');
|
|
11980
12117
|
const scrollHeight = outBuffer * this.parent.getRowHeight();
|
|
11981
12118
|
const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
|
|
11982
12119
|
const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;
|
|
@@ -11986,7 +12123,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11986
12123
|
if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
11987
12124
|
const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
|
|
11988
12125
|
this.parent.element.getBoundingClientRect().height);
|
|
11989
|
-
let index = (~~(content.scrollTop / this.parent.getRowHeight())
|
|
12126
|
+
let index = (~~(content$$1.scrollTop / this.parent.getRowHeight())
|
|
11990
12127
|
+ Math.ceil(vHeight / this.parent.getRowHeight()))
|
|
11991
12128
|
- this.parent.pageSettings.pageSize;
|
|
11992
12129
|
index = (index > 0) ? index : 0;
|
|
@@ -12001,7 +12138,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12001
12138
|
this.endIndex = lastInx;
|
|
12002
12139
|
this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
|
|
12003
12140
|
}
|
|
12004
|
-
if (currentViewData.length && (
|
|
12141
|
+
if (currentViewData.length && (currentViewData[0][indexValue] >= this.parent.pageSettings.pageSize / 2) &&
|
|
12142
|
+
((currentViewData[0][indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
|
|
12005
12143
|
this.startIndex = currentViewData[0][indexValue] - (this.parent.pageSettings.pageSize / 2);
|
|
12006
12144
|
this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
|
|
12007
12145
|
}
|
|
@@ -12030,7 +12168,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12030
12168
|
}
|
|
12031
12169
|
}
|
|
12032
12170
|
else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
|
|
12033
|
-
let nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());
|
|
12171
|
+
let nextSetResIndex = ~~(content$$1.scrollTop / this.parent.getRowHeight());
|
|
12034
12172
|
const isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
|
|
12035
12173
|
if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&
|
|
12036
12174
|
nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {
|
|
@@ -12048,7 +12186,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12048
12186
|
this.startIndex = currentViewData[0][indexValue] + (this.parent.pageSettings.pageSize / 2);
|
|
12049
12187
|
}
|
|
12050
12188
|
if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {
|
|
12051
|
-
this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
|
|
12189
|
+
this.translateY = this.getTranslateY(scrollArgs.offset.top, content$$1.getBoundingClientRect().height);
|
|
12052
12190
|
}
|
|
12053
12191
|
else {
|
|
12054
12192
|
if (this.parent.allowRowDragAndDrop) {
|
|
@@ -12066,6 +12204,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12066
12204
|
this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
|
|
12067
12205
|
const page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
|
|
12068
12206
|
this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
|
|
12207
|
+
this.requestType = 'virtualscroll';
|
|
12069
12208
|
if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {
|
|
12070
12209
|
viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;
|
|
12071
12210
|
}
|
|
@@ -12073,12 +12212,28 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12073
12212
|
}
|
|
12074
12213
|
}
|
|
12075
12214
|
appendContent(target, newChild, e) {
|
|
12215
|
+
const isFrozen = this.parent.isFrozenGrid();
|
|
12076
12216
|
if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
|
|
12077
|
-
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
|
|
12217
|
+
&& !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || this.parent.isFrozenGrid()) {
|
|
12078
12218
|
if (getValue('isExpandCollapse', e)) {
|
|
12079
12219
|
this.isRemoteExpand = true;
|
|
12080
12220
|
}
|
|
12221
|
+
if (isFrozen && isNullOrUndefined(this.requestType) && getValue('requestTypes', this).indexOf('isFrozen') === -1) {
|
|
12222
|
+
getValue('requestTypes', this).push('isFrozen');
|
|
12223
|
+
this.requestType = 'isFrozen';
|
|
12224
|
+
}
|
|
12081
12225
|
super.appendContent(target, newChild, e);
|
|
12226
|
+
if (getValue('requestTypes', this).indexOf('isFrozen') !== -1) {
|
|
12227
|
+
getValue('requestTypes', this).splice(getValue('requestTypes', this).indexOf('isFrozen'), 1);
|
|
12228
|
+
this.requestType = this.requestType === 'isFrozen' ? undefined : this.requestType;
|
|
12229
|
+
}
|
|
12230
|
+
if (isFrozen && (!this.isExpandCollapse || this.translateY === 0)) {
|
|
12231
|
+
this.translateY = this.translateY < 0 ? 0 : this.translateY;
|
|
12232
|
+
getValue('virtualEle', this).adjustTable(0, this.translateY);
|
|
12233
|
+
}
|
|
12234
|
+
else {
|
|
12235
|
+
this.isExpandCollapse = false;
|
|
12236
|
+
}
|
|
12082
12237
|
}
|
|
12083
12238
|
else {
|
|
12084
12239
|
const info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&
|
|
@@ -12164,6 +12319,11 @@ class TreeInterSectionObserver extends InterSectionObserver {
|
|
|
12164
12319
|
const containerRect = 'containerRect';
|
|
12165
12320
|
super[containerRect] = getValue('options', this).container.getBoundingClientRect();
|
|
12166
12321
|
EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
|
|
12322
|
+
if (getValue('options', this).movableContainer) {
|
|
12323
|
+
const movableContainerRect = 'movableContainerRect';
|
|
12324
|
+
super[movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
|
|
12325
|
+
EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);
|
|
12326
|
+
}
|
|
12167
12327
|
}
|
|
12168
12328
|
clear() {
|
|
12169
12329
|
this.lastPos = null;
|
|
@@ -12365,6 +12525,7 @@ class VirtualScroll$1 {
|
|
|
12365
12525
|
}
|
|
12366
12526
|
}
|
|
12367
12527
|
this.expandCollapseRec = null;
|
|
12528
|
+
startIndex = startIndex < 0 ? 0 : startIndex;
|
|
12368
12529
|
pageingDetails.result = visualData.slice(startIndex, endIndex);
|
|
12369
12530
|
this.prevstartIndex = startIndex;
|
|
12370
12531
|
this.prevendIndex = endIndex;
|
|
@@ -12394,12 +12555,14 @@ class TreeVirtual extends VirtualScroll {
|
|
|
12394
12555
|
const parentGrid = getValue('parent', this);
|
|
12395
12556
|
getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');
|
|
12396
12557
|
const renderer = getValue('locator', this).getService('rendererFactory');
|
|
12397
|
-
if (parentGrid.
|
|
12558
|
+
if (!parentGrid.isFrozenGrid()) {
|
|
12559
|
+
if (parentGrid.enableColumnVirtualization) {
|
|
12560
|
+
getValue('addRenderer', renderer)
|
|
12561
|
+
.apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
12562
|
+
}
|
|
12398
12563
|
getValue('addRenderer', renderer)
|
|
12399
|
-
.apply(renderer, [RenderType.
|
|
12564
|
+
.apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
12400
12565
|
}
|
|
12401
|
-
getValue('addRenderer', renderer)
|
|
12402
|
-
.apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
|
|
12403
12566
|
//renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));
|
|
12404
12567
|
this.ensurePageSize();
|
|
12405
12568
|
}
|
|
@@ -12418,6 +12581,138 @@ class TreeVirtual extends VirtualScroll {
|
|
|
12418
12581
|
}
|
|
12419
12582
|
}
|
|
12420
12583
|
|
|
12584
|
+
/**
|
|
12585
|
+
* VirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
|
|
12586
|
+
*
|
|
12587
|
+
* @hidden
|
|
12588
|
+
*/
|
|
12589
|
+
class VirtualTreeFreezeRenderer extends VirtualFreezeRenderer {
|
|
12590
|
+
constructor(parent, locator) {
|
|
12591
|
+
super(parent, locator);
|
|
12592
|
+
this.addEventListener();
|
|
12593
|
+
}
|
|
12594
|
+
/**
|
|
12595
|
+
* @returns {void}
|
|
12596
|
+
* @hidden
|
|
12597
|
+
*/
|
|
12598
|
+
renderTable() {
|
|
12599
|
+
this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
|
|
12600
|
+
this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
|
|
12601
|
+
this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
|
|
12602
|
+
.getRenderer(RenderType.Header).virtualHdrRenderer;
|
|
12603
|
+
FreezeContentRender.prototype.renderTable.call(this);
|
|
12604
|
+
this.virtualRenderer.setPanel(this.parent.getContent());
|
|
12605
|
+
this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
|
|
12606
|
+
const movableCont = this.getMovableContent();
|
|
12607
|
+
const minHeight = this.parent.height;
|
|
12608
|
+
this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
|
|
12609
|
+
this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
|
|
12610
|
+
this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
|
|
12611
|
+
this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
|
|
12612
|
+
if (this.parent.enableColumnVirtualization) {
|
|
12613
|
+
this.virtualRenderer.virtualEle.movableContent = this.virtualRenderer.movableContent
|
|
12614
|
+
= this.getPanel().querySelector('.' + movableContent);
|
|
12615
|
+
this.virtualRenderer.virtualEle.renderMovableWrapper(minHeight);
|
|
12616
|
+
this.virtualRenderer.virtualEle.renderMovablePlaceHolder();
|
|
12617
|
+
const tbl = movableCont.querySelector('table');
|
|
12618
|
+
this.virtualRenderer.virtualEle.movableTable = tbl;
|
|
12619
|
+
this.virtualRenderer.virtualEle.movableWrapper.appendChild(tbl);
|
|
12620
|
+
movableCont.appendChild(this.virtualRenderer.virtualEle.movableWrapper);
|
|
12621
|
+
movableCont.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder);
|
|
12622
|
+
}
|
|
12623
|
+
this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent());
|
|
12624
|
+
this.virtualRenderer.virtualEle.wrapper.appendChild(movableCont);
|
|
12625
|
+
this.virtualRenderer.virtualEle.table = this.getTable();
|
|
12626
|
+
setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
|
|
12627
|
+
}
|
|
12628
|
+
/**
|
|
12629
|
+
* @param {HTMLElement} target - specifies the target
|
|
12630
|
+
* @param {DocumentFragment} newChild - specifies the newChild
|
|
12631
|
+
* @param {NotifyArgs} e - specifies the notifyargs
|
|
12632
|
+
* @returns {void}
|
|
12633
|
+
* @hidden
|
|
12634
|
+
*/
|
|
12635
|
+
appendContent(target, newChild, e) {
|
|
12636
|
+
getValue('observer', this.virtualRenderer).options.debounceEvent = false;
|
|
12637
|
+
this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
|
|
12638
|
+
this.virtualRenderer['contents'] = this.getPanel().firstChild;
|
|
12639
|
+
super.appendContent(target, newChild, e);
|
|
12640
|
+
}
|
|
12641
|
+
/**
|
|
12642
|
+
* @param {Object[]} data - specifies the data
|
|
12643
|
+
* @param {NotifyArgs} e - specifies the notifyargs
|
|
12644
|
+
* @returns {Row<Column>[]} returns the row
|
|
12645
|
+
* @hidden
|
|
12646
|
+
*/
|
|
12647
|
+
generateRows(data, e) {
|
|
12648
|
+
return super.generateRows(data, e);
|
|
12649
|
+
}
|
|
12650
|
+
}
|
|
12651
|
+
/**
|
|
12652
|
+
* ColumnVirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table
|
|
12653
|
+
*
|
|
12654
|
+
* @hidden
|
|
12655
|
+
*/
|
|
12656
|
+
class ColumnVirtualTreeFreezeRenderer extends ColumnVirtualFreezeRenderer {
|
|
12657
|
+
constructor(parent, locator) {
|
|
12658
|
+
super(parent, locator);
|
|
12659
|
+
this.serviceLoc = locator;
|
|
12660
|
+
this.eventListener('on');
|
|
12661
|
+
}
|
|
12662
|
+
/**
|
|
12663
|
+
* @returns {void}
|
|
12664
|
+
* @hidden
|
|
12665
|
+
*/
|
|
12666
|
+
renderTable() {
|
|
12667
|
+
this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);
|
|
12668
|
+
this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')
|
|
12669
|
+
.getRenderer(RenderType.Header).virtualHdrRenderer;
|
|
12670
|
+
this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);
|
|
12671
|
+
ColumnFreezeContentRenderer.prototype.renderTable.call(this);
|
|
12672
|
+
this.virtualRenderer.setPanel(this.parent.getContent());
|
|
12673
|
+
this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');
|
|
12674
|
+
const frozenRightCont = this.getFrozenRightContent();
|
|
12675
|
+
let frzCont = this.getFrozenContent();
|
|
12676
|
+
const movableCont = this.getMovableContent();
|
|
12677
|
+
if (this.parent.getFrozenMode() === 'Right') {
|
|
12678
|
+
frzCont = frozenRightCont;
|
|
12679
|
+
}
|
|
12680
|
+
this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + content);
|
|
12681
|
+
this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';
|
|
12682
|
+
const minHeight = this.parent.height;
|
|
12683
|
+
this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);
|
|
12684
|
+
this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();
|
|
12685
|
+
super['renderVirtualFrozenLeft'](frzCont, movableCont);
|
|
12686
|
+
super['renderVirtualFrozenRight'](frzCont, movableCont);
|
|
12687
|
+
super['renderVirtualFrozenLeftRight'](frzCont, movableCont, frozenRightCont);
|
|
12688
|
+
this.virtualRenderer.virtualEle.table = this.getTable();
|
|
12689
|
+
setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());
|
|
12690
|
+
}
|
|
12691
|
+
appendContent(target, newChild, e) {
|
|
12692
|
+
getValue('observer', this.virtualRenderer).options.debounceEvent = false;
|
|
12693
|
+
this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);
|
|
12694
|
+
this.virtualRenderer['contents'] = this.getPanel().firstChild;
|
|
12695
|
+
super.appendContent(target, newChild, e);
|
|
12696
|
+
}
|
|
12697
|
+
}
|
|
12698
|
+
/**
|
|
12699
|
+
* VirtualTreeFreezeHdrRenderer is used to render the virtual table within the frozen and movable header table
|
|
12700
|
+
*
|
|
12701
|
+
* @hidden
|
|
12702
|
+
*/
|
|
12703
|
+
class VirtualTreeFreezeHdrRenderer extends VirtualFreezeHdrRenderer {
|
|
12704
|
+
/**
|
|
12705
|
+
* @returns {void}
|
|
12706
|
+
* @hidden
|
|
12707
|
+
*/
|
|
12708
|
+
renderTable() {
|
|
12709
|
+
super.renderTable();
|
|
12710
|
+
}
|
|
12711
|
+
rfshMovable() {
|
|
12712
|
+
super.rfshMovable();
|
|
12713
|
+
}
|
|
12714
|
+
}
|
|
12715
|
+
|
|
12421
12716
|
/**
|
|
12422
12717
|
* TreeGrid Freeze module
|
|
12423
12718
|
*
|
|
@@ -12438,6 +12733,7 @@ class Freeze$1 {
|
|
|
12438
12733
|
this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
|
|
12439
12734
|
this.parent.on('dataBoundArg', this.dataBoundArg, this);
|
|
12440
12735
|
this.parent.grid.on('dblclick', this.dblClickHandler, this);
|
|
12736
|
+
this.parent.grid.on('initial-load', this.instantiateRenderer, this);
|
|
12441
12737
|
}
|
|
12442
12738
|
removeEventListener() {
|
|
12443
12739
|
if (this.parent.isDestroyed) {
|
|
@@ -12446,6 +12742,40 @@ class Freeze$1 {
|
|
|
12446
12742
|
this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
|
|
12447
12743
|
this.parent.off('dataBoundArg', this.dataBoundArg);
|
|
12448
12744
|
this.parent.grid.off('dblclick', this.dblClickHandler);
|
|
12745
|
+
this.parent.grid.off('initial-load', this.instantiateRenderer);
|
|
12746
|
+
}
|
|
12747
|
+
instantiateRenderer() {
|
|
12748
|
+
const renderer = getValue('serviceLocator', this.parent.grid).getService('rendererFactory');
|
|
12749
|
+
if (this.parent.getFrozenColumns()) {
|
|
12750
|
+
if (this.parent.enableColumnVirtualization) {
|
|
12751
|
+
getValue('addRenderer', renderer)
|
|
12752
|
+
.apply(renderer, [RenderType.Header, new VirtualTreeFreezeHdrRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12753
|
+
}
|
|
12754
|
+
else {
|
|
12755
|
+
getValue('addRenderer', renderer)
|
|
12756
|
+
.apply(renderer, [RenderType.Header, new FreezeRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12757
|
+
}
|
|
12758
|
+
if (this.parent.enableVirtualization) {
|
|
12759
|
+
getValue('addRenderer', renderer)
|
|
12760
|
+
.apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12761
|
+
}
|
|
12762
|
+
else {
|
|
12763
|
+
getValue('addRenderer', renderer)
|
|
12764
|
+
.apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12765
|
+
}
|
|
12766
|
+
}
|
|
12767
|
+
if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {
|
|
12768
|
+
getValue('addRenderer', renderer)
|
|
12769
|
+
.apply(renderer, [RenderType.Header, new ColumnFreezeHeaderRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12770
|
+
if (this.parent.enableVirtualization) {
|
|
12771
|
+
getValue('addRenderer', renderer)
|
|
12772
|
+
.apply(renderer, [RenderType.Content, new ColumnVirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12773
|
+
}
|
|
12774
|
+
else {
|
|
12775
|
+
getValue('addRenderer', renderer)
|
|
12776
|
+
.apply(renderer, [RenderType.Content, new ColumnFreezeContentRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);
|
|
12777
|
+
}
|
|
12778
|
+
}
|
|
12449
12779
|
}
|
|
12450
12780
|
rowExpandCollapse(args) {
|
|
12451
12781
|
const movableRows = this.parent.getMovableDataRows();
|
|
@@ -12486,7 +12816,7 @@ class Freeze$1 {
|
|
|
12486
12816
|
}
|
|
12487
12817
|
dblClickHandler(e) {
|
|
12488
12818
|
if (parentsUntil(e.target, 'e-rowcell') &&
|
|
12489
|
-
this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
|
|
12819
|
+
this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell' && (!e.target['classList'].contains('e-treegridcollapse') && !e.target['classList'].contains('e-treegridexpand'))) {
|
|
12490
12820
|
this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
|
|
12491
12821
|
}
|
|
12492
12822
|
}
|
|
@@ -12892,5 +13222,5 @@ class InfiniteScroll$1 {
|
|
|
12892
13222
|
* Export TreeGrid component
|
|
12893
13223
|
*/
|
|
12894
13224
|
|
|
12895
|
-
export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
|
|
13225
|
+
export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, headerContent, movableContent, movableHeader, frozenContent, frozenHeader, content, table, leftRight, frozenRight, frozenLeft, dataColIndex, ariaColIndex, dataRowIndex, ariaRowIndex, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
|
|
12896
13226
|
//# sourceMappingURL=ej2-treegrid.es2015.js.map
|