@syncfusion/ej2-treegrid 19.3.57 → 19.4.42
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +60 -0
- package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
- package/CHANGELOG.md +12 -33
- package/README.md +1 -1
- 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 +194 -31
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +200 -30
- 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 +9 -9
- package/src/treegrid/actions/batch-edit.js +5 -5
- package/src/treegrid/actions/edit.js +1 -2
- package/src/treegrid/actions/excel-export.js +5 -2
- package/src/treegrid/actions/virtual-scroll.js +4 -1
- package/src/treegrid/base/interface.d.ts +4 -0
- package/src/treegrid/base/treegrid-model.d.ts +16 -1
- package/src/treegrid/base/treegrid.d.ts +43 -2
- package/src/treegrid/base/treegrid.js +157 -20
- package/src/treegrid/models/column.d.ts +10 -1
- package/src/treegrid/models/column.js +19 -0
- package/src/treegrid/renderer/virtual-row-model-generator.js +8 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +3 -1
- package/styles/bootstrap-dark.css +5 -0
- package/styles/bootstrap.css +5 -0
- package/styles/bootstrap4.css +5 -0
- package/styles/bootstrap5-dark.css +32 -27
- package/styles/bootstrap5.css +32 -27
- package/styles/fabric-dark.css +5 -0
- package/styles/fabric.css +5 -0
- package/styles/highcontrast-light.css +5 -0
- package/styles/highcontrast.css +5 -0
- package/styles/material-dark.css +5 -0
- package/styles/material.css +5 -0
- package/styles/tailwind-dark.css +31 -26
- package/styles/tailwind.css +5 -0
- package/styles/treegrid/_bootstrap5-definition.scss +4 -4
- package/styles/treegrid/_fluent-definition.scss +31 -0
- package/styles/treegrid/_layout.scss +8 -0
- package/styles/treegrid/_tailwind-definition.scss +4 -4
- package/styles/treegrid/bootstrap-dark.css +5 -0
- package/styles/treegrid/bootstrap.css +5 -0
- package/styles/treegrid/bootstrap4.css +5 -0
- package/styles/treegrid/bootstrap5-dark.css +32 -27
- package/styles/treegrid/bootstrap5.css +32 -27
- package/styles/treegrid/fabric-dark.css +5 -0
- package/styles/treegrid/fabric.css +5 -0
- package/styles/treegrid/highcontrast-light.css +5 -0
- package/styles/treegrid/highcontrast.css +5 -0
- package/styles/treegrid/icons/_fluent.scss +26 -0
- package/styles/treegrid/material-dark.css +5 -0
- package/styles/treegrid/material.css +5 -0
- package/styles/treegrid/tailwind-dark.css +31 -26
- package/styles/treegrid/tailwind.css +5 -0
|
@@ -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, setValue } from '@syncfusion/ej2-base';
|
|
2
|
-
import { Aggregate, Cell, 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, 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';
|
|
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';
|
|
@@ -76,6 +76,25 @@ class Column {
|
|
|
76
76
|
this.filter = {};
|
|
77
77
|
merge(this, options);
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Update the State changes reflected for TreeGrid columndirective in react platform.
|
|
81
|
+
*
|
|
82
|
+
* @param {Column} column - specifies the column
|
|
83
|
+
* @returns {void}
|
|
84
|
+
* @hidden
|
|
85
|
+
*/
|
|
86
|
+
setProperties(column) {
|
|
87
|
+
//Angular two way binding
|
|
88
|
+
const keys = Object.keys(column);
|
|
89
|
+
for (let i = 0; i < keys.length; i++) {
|
|
90
|
+
this[keys[i]] = column[keys[i]];
|
|
91
|
+
//Refresh the react columnTemplates on state change
|
|
92
|
+
if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
|
|
93
|
+
const refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
|
|
94
|
+
this.parent.clipboardModule['treeGridParent'][refreshReactColumnTemplateByUid](this.uid);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
79
98
|
}
|
|
80
99
|
|
|
81
100
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -3527,6 +3546,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3527
3546
|
this.grid.allowResizing = this.allowResizing;
|
|
3528
3547
|
this.grid.enableHover = this.enableHover;
|
|
3529
3548
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
3549
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
3530
3550
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
3531
3551
|
this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
|
|
3532
3552
|
this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
|
|
@@ -3575,7 +3595,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3575
3595
|
this.grid.currentViewData.length !== this.grid.selectionModule.selectedRowIndexes.length) {
|
|
3576
3596
|
const updateRowSelection = 'updateRowSelection';
|
|
3577
3597
|
for (let i = 0; i < this.getRows().length; i++) {
|
|
3578
|
-
if (this.getRows()[i].getElementsByClassName(
|
|
3598
|
+
if (this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
3579
3599
|
this.grid.selectionModule[updateRowSelection](this.getRows()[i], this.getCurrentViewRecords()[i].index);
|
|
3580
3600
|
}
|
|
3581
3601
|
}
|
|
@@ -3689,6 +3709,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3689
3709
|
}
|
|
3690
3710
|
}
|
|
3691
3711
|
}
|
|
3712
|
+
const action = 'action';
|
|
3713
|
+
if (this.enableVirtualization && this.selectionSettings.persistSelection && (this.dataResults[action] === 'expand' || this.dataResults[action] === 'collapse')) {
|
|
3714
|
+
const refreshPersistSelection = 'refreshPersistSelection';
|
|
3715
|
+
this.grid.selectionModule[refreshPersistSelection]();
|
|
3716
|
+
if (this.grid.selectionSettings.type === 'Single') {
|
|
3717
|
+
const updateRowSelection = 'updateRowSelection';
|
|
3718
|
+
const index = this.getCurrentViewRecords().indexOf(this.grid.selectionModule['data']);
|
|
3719
|
+
this.grid.selectionModule[updateRowSelection](this.getRows()[index], index);
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3692
3722
|
this.trigger(dataBound, args);
|
|
3693
3723
|
this.initialRender = false;
|
|
3694
3724
|
};
|
|
@@ -3883,8 +3913,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3883
3913
|
this.notify('clearFilters', { flatData: this.grid.dataSource });
|
|
3884
3914
|
this.grid.setProperties({ dataSource: this.dataResults.result }, true);
|
|
3885
3915
|
if (isNullOrUndefined(this.grid['changedProperties'].dataSource)) {
|
|
3886
|
-
this.grid.renderModule.data.dataManager = this.grid.dataSource instanceof DataManager ?
|
|
3916
|
+
this.grid.renderModule.data.dataManager = this.grid.dataSource instanceof DataManager ?
|
|
3917
|
+
this.grid.dataSource :
|
|
3887
3918
|
(isNullOrUndefined(this.grid.dataSource) ? new DataManager() : new DataManager(this.grid.dataSource));
|
|
3919
|
+
this.grid.renderModule.data.isQueryInvokedFromData = true;
|
|
3920
|
+
this.grid.query = this.grid.query instanceof Query ? this.grid.query : new Query();
|
|
3888
3921
|
}
|
|
3889
3922
|
}
|
|
3890
3923
|
const callBackPromise = new Deferred();
|
|
@@ -4328,6 +4361,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4328
4361
|
case 'enableAutoFill':
|
|
4329
4362
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
4330
4363
|
break;
|
|
4364
|
+
case 'enableAdaptiveUI':
|
|
4365
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
4366
|
+
break;
|
|
4331
4367
|
case 'enableImmutableMode':
|
|
4332
4368
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
4333
4369
|
break;
|
|
@@ -4455,7 +4491,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4455
4491
|
for (let i = 0; i < keyEntity.length; i++) {
|
|
4456
4492
|
const currentObject = this[keyEntity[i]];
|
|
4457
4493
|
for (let k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
4458
|
-
|
|
4494
|
+
const objVal = val[k];
|
|
4459
4495
|
delete currentObject[objVal];
|
|
4460
4496
|
}
|
|
4461
4497
|
}
|
|
@@ -4907,7 +4943,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4907
4943
|
gridColumn[prop] = gridColumns[i][prop];
|
|
4908
4944
|
}
|
|
4909
4945
|
this.columnModel.push(new Column(gridColumn));
|
|
4910
|
-
if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
4946
|
+
if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
4911
4947
|
this.columnModel[i].template = temp;
|
|
4912
4948
|
}
|
|
4913
4949
|
}
|
|
@@ -4923,6 +4959,31 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4923
4959
|
this[merge$$1] = undefined; // Workaround for blazor updateModel
|
|
4924
4960
|
return this.columnModel;
|
|
4925
4961
|
}
|
|
4962
|
+
/**
|
|
4963
|
+
* @param {string} columnUid - Defines column uid
|
|
4964
|
+
* @returns {void}
|
|
4965
|
+
* @hidden
|
|
4966
|
+
*/
|
|
4967
|
+
refreshReactColumnTemplateByUid(columnUid) {
|
|
4968
|
+
if (this.isReact) {
|
|
4969
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4970
|
+
this.clearTemplate(['columnTemplate'], undefined, () => {
|
|
4971
|
+
const cells = 'cells';
|
|
4972
|
+
const rowIdx = 'index';
|
|
4973
|
+
const rowsObj = this.grid.getRowsObject();
|
|
4974
|
+
const indent = this.grid.getIndentCount();
|
|
4975
|
+
const cellIndex = this.grid.getNormalizedColumnIndex(columnUid);
|
|
4976
|
+
for (let j = 0; j < rowsObj.length; j++) {
|
|
4977
|
+
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
4978
|
+
const cell = rowsObj[j][cells][cellIndex];
|
|
4979
|
+
const cellRenderer = new CellRenderer(this.grid, this.grid.serviceLocator);
|
|
4980
|
+
const td = this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
4981
|
+
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
4982
|
+
}
|
|
4983
|
+
}
|
|
4984
|
+
});
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4926
4987
|
/**
|
|
4927
4988
|
* Gets the content div of the TreeGrid.
|
|
4928
4989
|
*
|
|
@@ -5191,9 +5252,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5191
5252
|
*
|
|
5192
5253
|
* @param {HTMLTableRowElement} row - Expands the given row
|
|
5193
5254
|
* @param {Object} record - Expands the given record
|
|
5255
|
+
* @param {Object} key - Primary key value
|
|
5256
|
+
* @param {number} level - Specifies the hierarchical level of the record
|
|
5194
5257
|
* @returns {void}
|
|
5195
5258
|
*/
|
|
5196
|
-
expandRow(row, record) {
|
|
5259
|
+
expandRow(row, record, key, level) {
|
|
5197
5260
|
record = this.getCollapseExpandRecords(row, record);
|
|
5198
5261
|
if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
5199
5262
|
this.lastRowBorder(row, false);
|
|
@@ -5202,6 +5265,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5202
5265
|
this.trigger(expanding, args, (expandingArgs) => {
|
|
5203
5266
|
if (!expandingArgs.cancel) {
|
|
5204
5267
|
this.expandCollapse('expand', row, record);
|
|
5268
|
+
if (expandingArgs.expandAll) {
|
|
5269
|
+
this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
5270
|
+
}
|
|
5205
5271
|
const children = 'Children';
|
|
5206
5272
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[children]))) {
|
|
5207
5273
|
const collapseArgs = { data: record, row: row };
|
|
@@ -5211,6 +5277,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5211
5277
|
}
|
|
5212
5278
|
});
|
|
5213
5279
|
}
|
|
5280
|
+
expandCollapseAllChildren(record, action, key, level) {
|
|
5281
|
+
if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
|
|
5282
|
+
(!isNullOrUndefined(level) && level !== record.level)) {
|
|
5283
|
+
return;
|
|
5284
|
+
}
|
|
5285
|
+
const records = findChildrenRecords(record).filter((e) => {
|
|
5286
|
+
return e.hasChildRecords;
|
|
5287
|
+
});
|
|
5288
|
+
records.unshift(record);
|
|
5289
|
+
for (let i = 0; i < records.length; i++) {
|
|
5290
|
+
this.expandCollapse(action, null, records[i]);
|
|
5291
|
+
}
|
|
5292
|
+
}
|
|
5214
5293
|
setHeightForFrozenContent() {
|
|
5215
5294
|
const freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5216
5295
|
if (this.grid.getFrozenColumns() > 0 || freeze) {
|
|
@@ -5234,13 +5313,17 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5234
5313
|
*
|
|
5235
5314
|
* @param {HTMLTableRowElement} row - Collapse the given row
|
|
5236
5315
|
* @param {Object} record - Collapse the given record
|
|
5316
|
+
* @param {Object} key - Primary key value
|
|
5237
5317
|
* @returns {void}
|
|
5238
5318
|
*/
|
|
5239
|
-
collapseRow(row, record) {
|
|
5319
|
+
collapseRow(row, record, key) {
|
|
5240
5320
|
record = this.getCollapseExpandRecords(row, record);
|
|
5241
5321
|
const args = { data: record, row: row, cancel: false };
|
|
5242
5322
|
this.trigger(collapsing, args, (collapsingArgs) => {
|
|
5243
5323
|
if (!collapsingArgs.cancel) {
|
|
5324
|
+
if (collapsingArgs.collapseAll) {
|
|
5325
|
+
this.expandCollapseAllChildren(record, 'collapse', key);
|
|
5326
|
+
}
|
|
5244
5327
|
this.expandCollapse('collapse', row, record);
|
|
5245
5328
|
const collapseArgs = { data: record, row: row };
|
|
5246
5329
|
if (!isRemoteData(this)) {
|
|
@@ -5271,22 +5354,53 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5271
5354
|
}
|
|
5272
5355
|
return e.hasChildRecords && e.level === level;
|
|
5273
5356
|
});
|
|
5274
|
-
this.
|
|
5357
|
+
this.expandAction(rec, null, level, true);
|
|
5275
5358
|
}
|
|
5276
5359
|
else {
|
|
5277
5360
|
const rec = this.getRecordDetails(level);
|
|
5278
|
-
const row = getObject('rows', rec);
|
|
5279
5361
|
const record = getObject('records', rec);
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5362
|
+
this.expandAction(record, null, level);
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
/**
|
|
5366
|
+
* Expands the records by given primary key value
|
|
5367
|
+
*
|
|
5368
|
+
* @param {Object} key - Expands the parent rows with given primary key value
|
|
5369
|
+
* @returns {void}
|
|
5370
|
+
*/
|
|
5371
|
+
expandByKey(key) {
|
|
5372
|
+
this.expandCollapseActionByKey(key, 'Expand');
|
|
5373
|
+
}
|
|
5374
|
+
expandAction(record, key, level, isPaging = false) {
|
|
5375
|
+
for (let i = 0; i < record.length; i++) {
|
|
5376
|
+
if (!isNullOrUndefined(record[i].parentItem)) {
|
|
5377
|
+
const puniqueID = record[i].parentItem.uniqueID;
|
|
5378
|
+
let parentItem = this.flatData.filter((e) => {
|
|
5379
|
+
return e.uniqueID === puniqueID;
|
|
5380
|
+
});
|
|
5381
|
+
if (isRemoteData(this)) {
|
|
5382
|
+
parentItem = this.getCurrentViewRecords().filter((e) => {
|
|
5383
|
+
return e.uniqueID === puniqueID;
|
|
5384
|
+
});
|
|
5385
|
+
}
|
|
5386
|
+
if (parentItem[0].expanded === false) {
|
|
5387
|
+
record.push(parentItem[0]);
|
|
5388
|
+
parentItem[0].expanded = true;
|
|
5389
|
+
}
|
|
5390
|
+
else {
|
|
5391
|
+
if (!getExpandStatus(this, parentItem[0], this.parentData)) {
|
|
5392
|
+
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
5393
|
+
record.push(parentItem[0]);
|
|
5394
|
+
}
|
|
5286
5395
|
}
|
|
5287
5396
|
}
|
|
5288
|
-
this.expandRow(row[i], record[i]);
|
|
5289
5397
|
}
|
|
5398
|
+
if (!isPaging) {
|
|
5399
|
+
this.expandRow(null, record[i], key, level);
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5402
|
+
if (isPaging) {
|
|
5403
|
+
this.expandRow(null, record, key, level);
|
|
5290
5404
|
}
|
|
5291
5405
|
}
|
|
5292
5406
|
getRecordDetails(level) {
|
|
@@ -5314,14 +5428,45 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5314
5428
|
}
|
|
5315
5429
|
return e.hasChildRecords && e.level === level;
|
|
5316
5430
|
});
|
|
5317
|
-
this.
|
|
5431
|
+
this.collapseAction(record, null, true);
|
|
5318
5432
|
}
|
|
5319
5433
|
else {
|
|
5320
5434
|
const rec = this.getRecordDetails(level);
|
|
5321
|
-
const rows = getObject('rows', rec);
|
|
5322
5435
|
const records = getObject('records', rec);
|
|
5323
|
-
|
|
5324
|
-
|
|
5436
|
+
this.collapseAction(records);
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5439
|
+
/**
|
|
5440
|
+
* Collapses the records by given primary key value
|
|
5441
|
+
*
|
|
5442
|
+
* @param {Object} key - Collapses the parent rows with given primary key value
|
|
5443
|
+
* @returns {void}
|
|
5444
|
+
*/
|
|
5445
|
+
collapseByKey(key) {
|
|
5446
|
+
this.expandCollapseActionByKey(key, 'Collapse');
|
|
5447
|
+
}
|
|
5448
|
+
expandCollapseActionByKey(key, action) {
|
|
5449
|
+
const primaryKeyField = this.getPrimaryKeyFieldNames()[0];
|
|
5450
|
+
const dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
|
|
5451
|
+
if (!isNullOrUndefined(primaryKeyField)) {
|
|
5452
|
+
const rec = dataSource.filter((e) => {
|
|
5453
|
+
return e[primaryKeyField].toString() === key.toString();
|
|
5454
|
+
});
|
|
5455
|
+
if (action === 'Expand') {
|
|
5456
|
+
this.expandAction(rec, key, null);
|
|
5457
|
+
}
|
|
5458
|
+
else {
|
|
5459
|
+
this.collapseAction(rec, key);
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5462
|
+
}
|
|
5463
|
+
collapseAction(record, key, isPaging = false) {
|
|
5464
|
+
if (isPaging) {
|
|
5465
|
+
this.collapseRow(null, record);
|
|
5466
|
+
}
|
|
5467
|
+
else {
|
|
5468
|
+
for (let i = 0; i < record.length; i++) {
|
|
5469
|
+
this.collapseRow(null, record[i], key);
|
|
5325
5470
|
}
|
|
5326
5471
|
}
|
|
5327
5472
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
@@ -6216,6 +6361,9 @@ __decorate([
|
|
|
6216
6361
|
__decorate([
|
|
6217
6362
|
Property(false)
|
|
6218
6363
|
], TreeGrid.prototype, "enableAutoFill", void 0);
|
|
6364
|
+
__decorate([
|
|
6365
|
+
Property(false)
|
|
6366
|
+
], TreeGrid.prototype, "enableAdaptiveUI", void 0);
|
|
6219
6367
|
__decorate([
|
|
6220
6368
|
Property(false)
|
|
6221
6369
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
@@ -7760,6 +7908,14 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
7760
7908
|
return super.getData();
|
|
7761
7909
|
}
|
|
7762
7910
|
generateRows(data, notifyArgs) {
|
|
7911
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
|
|
7912
|
+
notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
|
|
7913
|
+
this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
|
|
7914
|
+
}
|
|
7915
|
+
else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
|
|
7916
|
+
notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
|
|
7917
|
+
this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
|
|
7918
|
+
}
|
|
7763
7919
|
const info = this.getDataInfo();
|
|
7764
7920
|
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
7765
7921
|
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
@@ -8211,9 +8367,9 @@ class ExcelExport$1 {
|
|
|
8211
8367
|
if (excelRow.type === 'excel') {
|
|
8212
8368
|
const excelrowobj = excelRow.rowObj.data;
|
|
8213
8369
|
const filtercolumnlength = this.parent.grid.filterSettings.columns.length;
|
|
8370
|
+
const rowlength = excelRow.excelRows.length;
|
|
8371
|
+
const rowlevel = excelrowobj.level;
|
|
8214
8372
|
if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {
|
|
8215
|
-
const rowlength = excelRow.excelRows.length;
|
|
8216
|
-
const rowlevel = excelrowobj.level;
|
|
8217
8373
|
let expandedStatus = false;
|
|
8218
8374
|
let sublevelState = false;
|
|
8219
8375
|
const state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);
|
|
@@ -8224,6 +8380,9 @@ class ExcelExport$1 {
|
|
|
8224
8380
|
excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,
|
|
8225
8381
|
isHidden: expandedStatus };
|
|
8226
8382
|
}
|
|
8383
|
+
else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {
|
|
8384
|
+
excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };
|
|
8385
|
+
}
|
|
8227
8386
|
}
|
|
8228
8387
|
}
|
|
8229
8388
|
/* eslint-disable-next-line */
|
|
@@ -9589,11 +9748,6 @@ class BatchEdit {
|
|
|
9589
9748
|
const data = (this.parent.grid.dataSource instanceof DataManager ?
|
|
9590
9749
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
9591
9750
|
const primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
9592
|
-
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
9593
|
-
const row = this.parent[targetElement].closest('tr');
|
|
9594
|
-
this.parent.collapseRow(row);
|
|
9595
|
-
this.parent[targetElement] = null;
|
|
9596
|
-
}
|
|
9597
9751
|
if (!isNullOrUndefined(this.batchAddedRecords)) {
|
|
9598
9752
|
for (let i = 0; i < this.batchAddedRecords.length; i++) {
|
|
9599
9753
|
index = data.map((e) => { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
|
|
@@ -9613,6 +9767,11 @@ class BatchEdit {
|
|
|
9613
9767
|
}
|
|
9614
9768
|
}
|
|
9615
9769
|
}
|
|
9770
|
+
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
9771
|
+
const row = this.parent[targetElement].closest('tr');
|
|
9772
|
+
this.parent.collapseRow(row);
|
|
9773
|
+
this.parent[targetElement] = null;
|
|
9774
|
+
}
|
|
9616
9775
|
if (!isNullOrUndefined(this.batchDeletedRecords)) {
|
|
9617
9776
|
for (let i = 0; i < this.batchDeletedRecords.length; i++) {
|
|
9618
9777
|
if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
|
|
@@ -10579,8 +10738,7 @@ class Edit$1 {
|
|
|
10579
10738
|
const currentData = this.parent.grid.getCurrentViewRecords();
|
|
10580
10739
|
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
10581
10740
|
this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
|
|
10582
|
-
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
|
|
10583
|
-
|
|
10741
|
+
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
|
|
10584
10742
|
}
|
|
10585
10743
|
let index = this.addRowIndex;
|
|
10586
10744
|
value.uniqueID = getUid(this.parent.element.id + '_data_');
|
|
@@ -11084,7 +11242,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11084
11242
|
if (isNullOrUndefined(this.observer[containerRect])) {
|
|
11085
11243
|
this.observer[containerRect] = this.observers[containerRect];
|
|
11086
11244
|
}
|
|
11087
|
-
if (
|
|
11245
|
+
if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
|
|
11246
|
+
isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
|
|
11088
11247
|
super[selectVirtualRow](args);
|
|
11089
11248
|
}
|
|
11090
11249
|
}
|
|
@@ -11321,6 +11480,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11321
11480
|
const replace = 'replaceWith';
|
|
11322
11481
|
this.getTable().querySelector('tbody')[replace](target);
|
|
11323
11482
|
if (!this.isExpandCollapse || this.translateY === 0) {
|
|
11483
|
+
this.translateY = this.translateY < 0 ? 0 : this.translateY;
|
|
11324
11484
|
getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
|
|
11325
11485
|
}
|
|
11326
11486
|
else {
|
|
@@ -11514,7 +11674,10 @@ class VirtualScroll$1 {
|
|
|
11514
11674
|
record: row.record,
|
|
11515
11675
|
count: this.parent.flatData.length
|
|
11516
11676
|
};
|
|
11517
|
-
this.parent.
|
|
11677
|
+
if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
|
|
11678
|
+
this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
|
|
11679
|
+
this.parent.grid.clearSelection();
|
|
11680
|
+
}
|
|
11518
11681
|
const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
11519
11682
|
getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
|
|
11520
11683
|
}
|