@syncfusion/ej2-treegrid 19.3.53 → 19.4.40
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 +6 -37
- 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 +204 -26
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +218 -29
- 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 +24 -5
- package/src/treegrid/actions/virtual-scroll.js +5 -0
- package/src/treegrid/base/data.js +3 -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 +154 -18
- 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 +6 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +4 -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 -26
- package/styles/bootstrap5.css +32 -26
- 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 -26
- package/styles/treegrid/bootstrap5.css +32 -26
- 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) {
|
|
@@ -2165,7 +2184,9 @@ class DataManipulation {
|
|
|
2165
2184
|
const query = getObject('query', args);
|
|
2166
2185
|
const srtQry = new Query();
|
|
2167
2186
|
for (let srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
|
|
2168
|
-
const
|
|
2187
|
+
const getColumnByField = 'getColumnByField';
|
|
2188
|
+
const col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.
|
|
2189
|
+
sortSettings.columns[srt].field);
|
|
2169
2190
|
const compFun = col.sortComparer && isOffline(this.parent) ?
|
|
2170
2191
|
col.sortComparer.bind(col) :
|
|
2171
2192
|
this.parent.grid.sortSettings.columns[srt].direction;
|
|
@@ -3525,6 +3546,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3525
3546
|
this.grid.allowResizing = this.allowResizing;
|
|
3526
3547
|
this.grid.enableHover = this.enableHover;
|
|
3527
3548
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
3549
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
3528
3550
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
3529
3551
|
this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
|
|
3530
3552
|
this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
|
|
@@ -3569,6 +3591,15 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3569
3591
|
this.trigger(rowSelecting, args);
|
|
3570
3592
|
};
|
|
3571
3593
|
this.grid.rowSelected = (args) => {
|
|
3594
|
+
if (this.enableVirtualization && args.isHeaderCheckboxClicked &&
|
|
3595
|
+
this.grid.currentViewData.length !== this.grid.selectionModule.selectedRowIndexes.length) {
|
|
3596
|
+
const updateRowSelection = 'updateRowSelection';
|
|
3597
|
+
for (let i = 0; i < this.getRows().length; i++) {
|
|
3598
|
+
if (this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
3599
|
+
this.grid.selectionModule[updateRowSelection](this.getRows()[i], this.getCurrentViewRecords()[i].index);
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3572
3603
|
this.selectedRowIndex = this.grid.selectedRowIndex;
|
|
3573
3604
|
this.notify(rowSelected, args);
|
|
3574
3605
|
this.trigger(rowSelected, args);
|
|
@@ -3872,8 +3903,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3872
3903
|
this.notify('clearFilters', { flatData: this.grid.dataSource });
|
|
3873
3904
|
this.grid.setProperties({ dataSource: this.dataResults.result }, true);
|
|
3874
3905
|
if (isNullOrUndefined(this.grid['changedProperties'].dataSource)) {
|
|
3875
|
-
this.grid.renderModule.data.dataManager = this.grid.dataSource instanceof DataManager ?
|
|
3906
|
+
this.grid.renderModule.data.dataManager = this.grid.dataSource instanceof DataManager ?
|
|
3907
|
+
this.grid.dataSource :
|
|
3876
3908
|
(isNullOrUndefined(this.grid.dataSource) ? new DataManager() : new DataManager(this.grid.dataSource));
|
|
3909
|
+
this.grid.renderModule.data.isQueryInvokedFromData = true;
|
|
3910
|
+
this.grid.query = this.grid.query instanceof Query ? this.grid.query : new Query();
|
|
3877
3911
|
}
|
|
3878
3912
|
}
|
|
3879
3913
|
const callBackPromise = new Deferred();
|
|
@@ -4317,6 +4351,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4317
4351
|
case 'enableAutoFill':
|
|
4318
4352
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
4319
4353
|
break;
|
|
4354
|
+
case 'enableAdaptiveUI':
|
|
4355
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
4356
|
+
break;
|
|
4320
4357
|
case 'enableImmutableMode':
|
|
4321
4358
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
4322
4359
|
break;
|
|
@@ -4444,7 +4481,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4444
4481
|
for (let i = 0; i < keyEntity.length; i++) {
|
|
4445
4482
|
const currentObject = this[keyEntity[i]];
|
|
4446
4483
|
for (let k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
4447
|
-
|
|
4484
|
+
const objVal = val[k];
|
|
4448
4485
|
delete currentObject[objVal];
|
|
4449
4486
|
}
|
|
4450
4487
|
}
|
|
@@ -4912,6 +4949,31 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4912
4949
|
this[merge$$1] = undefined; // Workaround for blazor updateModel
|
|
4913
4950
|
return this.columnModel;
|
|
4914
4951
|
}
|
|
4952
|
+
/**
|
|
4953
|
+
* @param {string} columnUid - Defines column uid
|
|
4954
|
+
* @returns {void}
|
|
4955
|
+
* @hidden
|
|
4956
|
+
*/
|
|
4957
|
+
refreshReactColumnTemplateByUid(columnUid) {
|
|
4958
|
+
if (this.isReact) {
|
|
4959
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4960
|
+
this.clearTemplate(['columnTemplate'], undefined, () => {
|
|
4961
|
+
const cells = 'cells';
|
|
4962
|
+
const rowIdx = 'index';
|
|
4963
|
+
const rowsObj = this.grid.getRowsObject();
|
|
4964
|
+
const indent = this.grid.getIndentCount();
|
|
4965
|
+
const cellIndex = this.grid.getNormalizedColumnIndex(columnUid);
|
|
4966
|
+
for (let j = 0; j < rowsObj.length; j++) {
|
|
4967
|
+
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
4968
|
+
const cell = rowsObj[j][cells][cellIndex];
|
|
4969
|
+
const cellRenderer = new CellRenderer(this.grid, this.grid.serviceLocator);
|
|
4970
|
+
const td = this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
4971
|
+
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
});
|
|
4975
|
+
}
|
|
4976
|
+
}
|
|
4915
4977
|
/**
|
|
4916
4978
|
* Gets the content div of the TreeGrid.
|
|
4917
4979
|
*
|
|
@@ -5180,9 +5242,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5180
5242
|
*
|
|
5181
5243
|
* @param {HTMLTableRowElement} row - Expands the given row
|
|
5182
5244
|
* @param {Object} record - Expands the given record
|
|
5245
|
+
* @param {Object} key - Primary key value
|
|
5246
|
+
* @param {number} level - Specifies the hierarchical level of the record
|
|
5183
5247
|
* @returns {void}
|
|
5184
5248
|
*/
|
|
5185
|
-
expandRow(row, record) {
|
|
5249
|
+
expandRow(row, record, key, level) {
|
|
5186
5250
|
record = this.getCollapseExpandRecords(row, record);
|
|
5187
5251
|
if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
5188
5252
|
this.lastRowBorder(row, false);
|
|
@@ -5191,6 +5255,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5191
5255
|
this.trigger(expanding, args, (expandingArgs) => {
|
|
5192
5256
|
if (!expandingArgs.cancel) {
|
|
5193
5257
|
this.expandCollapse('expand', row, record);
|
|
5258
|
+
if (expandingArgs.expandAll) {
|
|
5259
|
+
this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
5260
|
+
}
|
|
5194
5261
|
const children = 'Children';
|
|
5195
5262
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[children]))) {
|
|
5196
5263
|
const collapseArgs = { data: record, row: row };
|
|
@@ -5200,6 +5267,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5200
5267
|
}
|
|
5201
5268
|
});
|
|
5202
5269
|
}
|
|
5270
|
+
expandCollapseAllChildren(record, action, key, level) {
|
|
5271
|
+
if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
|
|
5272
|
+
(!isNullOrUndefined(level) && level !== record.level)) {
|
|
5273
|
+
return;
|
|
5274
|
+
}
|
|
5275
|
+
const records = findChildrenRecords(record).filter((e) => {
|
|
5276
|
+
return e.hasChildRecords;
|
|
5277
|
+
});
|
|
5278
|
+
records.unshift(record);
|
|
5279
|
+
for (let i = 0; i < records.length; i++) {
|
|
5280
|
+
this.expandCollapse(action, null, records[i]);
|
|
5281
|
+
}
|
|
5282
|
+
}
|
|
5203
5283
|
setHeightForFrozenContent() {
|
|
5204
5284
|
const freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5205
5285
|
if (this.grid.getFrozenColumns() > 0 || freeze) {
|
|
@@ -5223,13 +5303,17 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5223
5303
|
*
|
|
5224
5304
|
* @param {HTMLTableRowElement} row - Collapse the given row
|
|
5225
5305
|
* @param {Object} record - Collapse the given record
|
|
5306
|
+
* @param {Object} key - Primary key value
|
|
5226
5307
|
* @returns {void}
|
|
5227
5308
|
*/
|
|
5228
|
-
collapseRow(row, record) {
|
|
5309
|
+
collapseRow(row, record, key) {
|
|
5229
5310
|
record = this.getCollapseExpandRecords(row, record);
|
|
5230
5311
|
const args = { data: record, row: row, cancel: false };
|
|
5231
5312
|
this.trigger(collapsing, args, (collapsingArgs) => {
|
|
5232
5313
|
if (!collapsingArgs.cancel) {
|
|
5314
|
+
if (collapsingArgs.collapseAll) {
|
|
5315
|
+
this.expandCollapseAllChildren(record, 'collapse', key);
|
|
5316
|
+
}
|
|
5233
5317
|
this.expandCollapse('collapse', row, record);
|
|
5234
5318
|
const collapseArgs = { data: record, row: row };
|
|
5235
5319
|
if (!isRemoteData(this)) {
|
|
@@ -5260,22 +5344,53 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5260
5344
|
}
|
|
5261
5345
|
return e.hasChildRecords && e.level === level;
|
|
5262
5346
|
});
|
|
5263
|
-
this.
|
|
5347
|
+
this.expandAction(rec, null, level, true);
|
|
5264
5348
|
}
|
|
5265
5349
|
else {
|
|
5266
5350
|
const rec = this.getRecordDetails(level);
|
|
5267
|
-
const row = getObject('rows', rec);
|
|
5268
5351
|
const record = getObject('records', rec);
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5352
|
+
this.expandAction(record, null, level);
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
/**
|
|
5356
|
+
* Expands the records by given primary key value
|
|
5357
|
+
*
|
|
5358
|
+
* @param {Object} key - Expands the parent rows with given primary key value
|
|
5359
|
+
* @returns {void}
|
|
5360
|
+
*/
|
|
5361
|
+
expandByKey(key) {
|
|
5362
|
+
this.expandCollapseActionByKey(key, 'Expand');
|
|
5363
|
+
}
|
|
5364
|
+
expandAction(record, key, level, isPaging = false) {
|
|
5365
|
+
for (let i = 0; i < record.length; i++) {
|
|
5366
|
+
if (!isNullOrUndefined(record[i].parentItem)) {
|
|
5367
|
+
const puniqueID = record[i].parentItem.uniqueID;
|
|
5368
|
+
let parentItem = this.flatData.filter((e) => {
|
|
5369
|
+
return e.uniqueID === puniqueID;
|
|
5370
|
+
});
|
|
5371
|
+
if (isRemoteData(this)) {
|
|
5372
|
+
parentItem = this.getCurrentViewRecords().filter((e) => {
|
|
5373
|
+
return e.uniqueID === puniqueID;
|
|
5374
|
+
});
|
|
5375
|
+
}
|
|
5376
|
+
if (parentItem[0].expanded === false) {
|
|
5377
|
+
record.push(parentItem[0]);
|
|
5378
|
+
parentItem[0].expanded = true;
|
|
5379
|
+
}
|
|
5380
|
+
else {
|
|
5381
|
+
if (!getExpandStatus(this, parentItem[0], this.parentData)) {
|
|
5382
|
+
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
5383
|
+
record.push(parentItem[0]);
|
|
5384
|
+
}
|
|
5275
5385
|
}
|
|
5276
5386
|
}
|
|
5277
|
-
this.expandRow(row[i], record[i]);
|
|
5278
5387
|
}
|
|
5388
|
+
if (!isPaging) {
|
|
5389
|
+
this.expandRow(null, record[i], key, level);
|
|
5390
|
+
}
|
|
5391
|
+
}
|
|
5392
|
+
if (isPaging) {
|
|
5393
|
+
this.expandRow(null, record, key, level);
|
|
5279
5394
|
}
|
|
5280
5395
|
}
|
|
5281
5396
|
getRecordDetails(level) {
|
|
@@ -5303,14 +5418,45 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5303
5418
|
}
|
|
5304
5419
|
return e.hasChildRecords && e.level === level;
|
|
5305
5420
|
});
|
|
5306
|
-
this.
|
|
5421
|
+
this.collapseAction(record, null, true);
|
|
5307
5422
|
}
|
|
5308
5423
|
else {
|
|
5309
5424
|
const rec = this.getRecordDetails(level);
|
|
5310
|
-
const rows = getObject('rows', rec);
|
|
5311
5425
|
const records = getObject('records', rec);
|
|
5312
|
-
|
|
5313
|
-
|
|
5426
|
+
this.collapseAction(records);
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5429
|
+
/**
|
|
5430
|
+
* Collapses the records by given primary key value
|
|
5431
|
+
*
|
|
5432
|
+
* @param {Object} key - Collapses the parent rows with given primary key value
|
|
5433
|
+
* @returns {void}
|
|
5434
|
+
*/
|
|
5435
|
+
collapseByKey(key) {
|
|
5436
|
+
this.expandCollapseActionByKey(key, 'Collapse');
|
|
5437
|
+
}
|
|
5438
|
+
expandCollapseActionByKey(key, action) {
|
|
5439
|
+
const primaryKeyField = this.getPrimaryKeyFieldNames()[0];
|
|
5440
|
+
const dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
|
|
5441
|
+
if (!isNullOrUndefined(primaryKeyField)) {
|
|
5442
|
+
const rec = dataSource.filter((e) => {
|
|
5443
|
+
return e[primaryKeyField].toString() === key.toString();
|
|
5444
|
+
});
|
|
5445
|
+
if (action === 'Expand') {
|
|
5446
|
+
this.expandAction(rec, key, null);
|
|
5447
|
+
}
|
|
5448
|
+
else {
|
|
5449
|
+
this.collapseAction(rec, key);
|
|
5450
|
+
}
|
|
5451
|
+
}
|
|
5452
|
+
}
|
|
5453
|
+
collapseAction(record, key, isPaging = false) {
|
|
5454
|
+
if (isPaging) {
|
|
5455
|
+
this.collapseRow(null, record);
|
|
5456
|
+
}
|
|
5457
|
+
else {
|
|
5458
|
+
for (let i = 0; i < record.length; i++) {
|
|
5459
|
+
this.collapseRow(null, record[i], key);
|
|
5314
5460
|
}
|
|
5315
5461
|
}
|
|
5316
5462
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
@@ -6205,6 +6351,9 @@ __decorate([
|
|
|
6205
6351
|
__decorate([
|
|
6206
6352
|
Property(false)
|
|
6207
6353
|
], TreeGrid.prototype, "enableAutoFill", void 0);
|
|
6354
|
+
__decorate([
|
|
6355
|
+
Property(false)
|
|
6356
|
+
], TreeGrid.prototype, "enableAdaptiveUI", void 0);
|
|
6208
6357
|
__decorate([
|
|
6209
6358
|
Property(false)
|
|
6210
6359
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
@@ -7749,6 +7898,12 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
7749
7898
|
return super.getData();
|
|
7750
7899
|
}
|
|
7751
7900
|
generateRows(data, notifyArgs) {
|
|
7901
|
+
if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
|
|
7902
|
+
this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
|
|
7903
|
+
}
|
|
7904
|
+
else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext && notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
|
|
7905
|
+
this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
|
|
7906
|
+
}
|
|
7752
7907
|
const info = this.getDataInfo();
|
|
7753
7908
|
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
7754
7909
|
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
@@ -9578,11 +9733,6 @@ class BatchEdit {
|
|
|
9578
9733
|
const data = (this.parent.grid.dataSource instanceof DataManager ?
|
|
9579
9734
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
9580
9735
|
const primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
9581
|
-
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
9582
|
-
const row = this.parent[targetElement].closest('tr');
|
|
9583
|
-
this.parent.collapseRow(row);
|
|
9584
|
-
this.parent[targetElement] = null;
|
|
9585
|
-
}
|
|
9586
9736
|
if (!isNullOrUndefined(this.batchAddedRecords)) {
|
|
9587
9737
|
for (let i = 0; i < this.batchAddedRecords.length; i++) {
|
|
9588
9738
|
index = data.map((e) => { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
|
|
@@ -9602,6 +9752,11 @@ class BatchEdit {
|
|
|
9602
9752
|
}
|
|
9603
9753
|
}
|
|
9604
9754
|
}
|
|
9755
|
+
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
9756
|
+
const row = this.parent[targetElement].closest('tr');
|
|
9757
|
+
this.parent.collapseRow(row);
|
|
9758
|
+
this.parent[targetElement] = null;
|
|
9759
|
+
}
|
|
9605
9760
|
if (!isNullOrUndefined(this.batchDeletedRecords)) {
|
|
9606
9761
|
for (let i = 0; i < this.batchDeletedRecords.length; i++) {
|
|
9607
9762
|
if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
|
|
@@ -10476,13 +10631,23 @@ class Edit$1 {
|
|
|
10476
10631
|
}
|
|
10477
10632
|
if (args.requestType === 'delete') {
|
|
10478
10633
|
const data = args.data;
|
|
10634
|
+
if (isNullOrUndefined(args.data[0].uniqueID)) {
|
|
10635
|
+
const primaryKeys = this.parent.getPrimaryKeyFieldNames();
|
|
10636
|
+
for (let i = 0; i < data.length; i++) {
|
|
10637
|
+
this.parent.flatData.filter((e) => {
|
|
10638
|
+
if (e[primaryKeys[0]] === args.data[i][primaryKeys[0]]) {
|
|
10639
|
+
data[i] = e;
|
|
10640
|
+
}
|
|
10641
|
+
});
|
|
10642
|
+
}
|
|
10643
|
+
}
|
|
10479
10644
|
for (let i = 0; i < data.length; i++) {
|
|
10480
10645
|
this.deleteUniqueID(data[i].uniqueID);
|
|
10481
10646
|
const childs = findChildrenRecords(data[i]);
|
|
10482
10647
|
for (let c = 0; c < childs.length; c++) {
|
|
10483
10648
|
this.deleteUniqueID(childs[c].uniqueID);
|
|
10484
10649
|
}
|
|
10485
|
-
args.data = [...data, ...childs];
|
|
10650
|
+
args.data = [...args.data, ...childs];
|
|
10486
10651
|
}
|
|
10487
10652
|
}
|
|
10488
10653
|
if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {
|
|
@@ -10527,6 +10692,7 @@ class Edit$1 {
|
|
|
10527
10692
|
}
|
|
10528
10693
|
if (this.isAddedRowByMethod && args.index !== 0) {
|
|
10529
10694
|
this.addRowRecord = this.parent.flatData[args.index];
|
|
10695
|
+
this.addRowIndex = args.index;
|
|
10530
10696
|
}
|
|
10531
10697
|
if (this.parent.editSettings.newRowPosition === 'Child' && isNullOrUndefined(this.addRowRecord)
|
|
10532
10698
|
&& !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {
|
|
@@ -10555,6 +10721,10 @@ class Edit$1 {
|
|
|
10555
10721
|
let position = null;
|
|
10556
10722
|
value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;
|
|
10557
10723
|
const currentData = this.parent.grid.getCurrentViewRecords();
|
|
10724
|
+
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
10725
|
+
this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
|
|
10726
|
+
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
|
|
10727
|
+
}
|
|
10558
10728
|
let index = this.addRowIndex;
|
|
10559
10729
|
value.uniqueID = getUid(this.parent.element.id + '_data_');
|
|
10560
10730
|
setValue('uniqueIDCollection.' + value.uniqueID, value, this.parent);
|
|
@@ -11057,7 +11227,10 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11057
11227
|
if (isNullOrUndefined(this.observer[containerRect])) {
|
|
11058
11228
|
this.observer[containerRect] = this.observers[containerRect];
|
|
11059
11229
|
}
|
|
11060
|
-
|
|
11230
|
+
if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
|
|
11231
|
+
isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
|
|
11232
|
+
super[selectVirtualRow](args);
|
|
11233
|
+
}
|
|
11061
11234
|
}
|
|
11062
11235
|
refreshCell(rowObj) {
|
|
11063
11236
|
rowObj.cells = this.generateCells();
|
|
@@ -11523,6 +11696,11 @@ class VirtualScroll$1 {
|
|
|
11523
11696
|
}
|
|
11524
11697
|
//if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
|
|
11525
11698
|
//this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
|
|
11699
|
+
if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||
|
|
11700
|
+
(pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&
|
|
11701
|
+
(startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {
|
|
11702
|
+
startIndex = 0;
|
|
11703
|
+
}
|
|
11526
11704
|
if (!isNullOrUndefined(this.expandCollapseRec)) {
|
|
11527
11705
|
const resourceCount = this.parent.getRows();
|
|
11528
11706
|
let sIndex = visualData.indexOf(this.expandCollapseRec);
|