@syncfusion/ej2-treegrid 19.3.55 → 19.4.41
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 -47
- 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 +182 -28
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +196 -31
- 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 +20 -7
- 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 +146 -19
- 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 +2 -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 +31 -26
- package/styles/bootstrap5.css +31 -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 +31 -26
- package/styles/treegrid/bootstrap5.css +31 -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) {
|
|
@@ -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
|
}
|
|
@@ -3883,8 +3903,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3883
3903
|
this.notify('clearFilters', { flatData: this.grid.dataSource });
|
|
3884
3904
|
this.grid.setProperties({ dataSource: this.dataResults.result }, true);
|
|
3885
3905
|
if (isNullOrUndefined(this.grid['changedProperties'].dataSource)) {
|
|
3886
|
-
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 :
|
|
3887
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();
|
|
3888
3911
|
}
|
|
3889
3912
|
}
|
|
3890
3913
|
const callBackPromise = new Deferred();
|
|
@@ -4328,6 +4351,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4328
4351
|
case 'enableAutoFill':
|
|
4329
4352
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
4330
4353
|
break;
|
|
4354
|
+
case 'enableAdaptiveUI':
|
|
4355
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
4356
|
+
break;
|
|
4331
4357
|
case 'enableImmutableMode':
|
|
4332
4358
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
4333
4359
|
break;
|
|
@@ -4455,7 +4481,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4455
4481
|
for (let i = 0; i < keyEntity.length; i++) {
|
|
4456
4482
|
const currentObject = this[keyEntity[i]];
|
|
4457
4483
|
for (let k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
4458
|
-
|
|
4484
|
+
const objVal = val[k];
|
|
4459
4485
|
delete currentObject[objVal];
|
|
4460
4486
|
}
|
|
4461
4487
|
}
|
|
@@ -4923,6 +4949,31 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4923
4949
|
this[merge$$1] = undefined; // Workaround for blazor updateModel
|
|
4924
4950
|
return this.columnModel;
|
|
4925
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
|
+
}
|
|
4926
4977
|
/**
|
|
4927
4978
|
* Gets the content div of the TreeGrid.
|
|
4928
4979
|
*
|
|
@@ -5191,9 +5242,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5191
5242
|
*
|
|
5192
5243
|
* @param {HTMLTableRowElement} row - Expands the given row
|
|
5193
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
|
|
5194
5247
|
* @returns {void}
|
|
5195
5248
|
*/
|
|
5196
|
-
expandRow(row, record) {
|
|
5249
|
+
expandRow(row, record, key, level) {
|
|
5197
5250
|
record = this.getCollapseExpandRecords(row, record);
|
|
5198
5251
|
if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
5199
5252
|
this.lastRowBorder(row, false);
|
|
@@ -5202,6 +5255,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5202
5255
|
this.trigger(expanding, args, (expandingArgs) => {
|
|
5203
5256
|
if (!expandingArgs.cancel) {
|
|
5204
5257
|
this.expandCollapse('expand', row, record);
|
|
5258
|
+
if (expandingArgs.expandAll) {
|
|
5259
|
+
this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
5260
|
+
}
|
|
5205
5261
|
const children = 'Children';
|
|
5206
5262
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[children]))) {
|
|
5207
5263
|
const collapseArgs = { data: record, row: row };
|
|
@@ -5211,6 +5267,19 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5211
5267
|
}
|
|
5212
5268
|
});
|
|
5213
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
|
+
}
|
|
5214
5283
|
setHeightForFrozenContent() {
|
|
5215
5284
|
const freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
5216
5285
|
if (this.grid.getFrozenColumns() > 0 || freeze) {
|
|
@@ -5234,13 +5303,17 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5234
5303
|
*
|
|
5235
5304
|
* @param {HTMLTableRowElement} row - Collapse the given row
|
|
5236
5305
|
* @param {Object} record - Collapse the given record
|
|
5306
|
+
* @param {Object} key - Primary key value
|
|
5237
5307
|
* @returns {void}
|
|
5238
5308
|
*/
|
|
5239
|
-
collapseRow(row, record) {
|
|
5309
|
+
collapseRow(row, record, key) {
|
|
5240
5310
|
record = this.getCollapseExpandRecords(row, record);
|
|
5241
5311
|
const args = { data: record, row: row, cancel: false };
|
|
5242
5312
|
this.trigger(collapsing, args, (collapsingArgs) => {
|
|
5243
5313
|
if (!collapsingArgs.cancel) {
|
|
5314
|
+
if (collapsingArgs.collapseAll) {
|
|
5315
|
+
this.expandCollapseAllChildren(record, 'collapse', key);
|
|
5316
|
+
}
|
|
5244
5317
|
this.expandCollapse('collapse', row, record);
|
|
5245
5318
|
const collapseArgs = { data: record, row: row };
|
|
5246
5319
|
if (!isRemoteData(this)) {
|
|
@@ -5271,22 +5344,53 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5271
5344
|
}
|
|
5272
5345
|
return e.hasChildRecords && e.level === level;
|
|
5273
5346
|
});
|
|
5274
|
-
this.
|
|
5347
|
+
this.expandAction(rec, null, level, true);
|
|
5275
5348
|
}
|
|
5276
5349
|
else {
|
|
5277
5350
|
const rec = this.getRecordDetails(level);
|
|
5278
|
-
const row = getObject('rows', rec);
|
|
5279
5351
|
const record = getObject('records', rec);
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
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
|
+
}
|
|
5286
5385
|
}
|
|
5287
5386
|
}
|
|
5288
|
-
this.expandRow(row[i], record[i]);
|
|
5289
5387
|
}
|
|
5388
|
+
if (!isPaging) {
|
|
5389
|
+
this.expandRow(null, record[i], key, level);
|
|
5390
|
+
}
|
|
5391
|
+
}
|
|
5392
|
+
if (isPaging) {
|
|
5393
|
+
this.expandRow(null, record, key, level);
|
|
5290
5394
|
}
|
|
5291
5395
|
}
|
|
5292
5396
|
getRecordDetails(level) {
|
|
@@ -5314,14 +5418,45 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
5314
5418
|
}
|
|
5315
5419
|
return e.hasChildRecords && e.level === level;
|
|
5316
5420
|
});
|
|
5317
|
-
this.
|
|
5421
|
+
this.collapseAction(record, null, true);
|
|
5318
5422
|
}
|
|
5319
5423
|
else {
|
|
5320
5424
|
const rec = this.getRecordDetails(level);
|
|
5321
|
-
const rows = getObject('rows', rec);
|
|
5322
5425
|
const records = getObject('records', rec);
|
|
5323
|
-
|
|
5324
|
-
|
|
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);
|
|
5325
5460
|
}
|
|
5326
5461
|
}
|
|
5327
5462
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
@@ -6216,6 +6351,9 @@ __decorate([
|
|
|
6216
6351
|
__decorate([
|
|
6217
6352
|
Property(false)
|
|
6218
6353
|
], TreeGrid.prototype, "enableAutoFill", void 0);
|
|
6354
|
+
__decorate([
|
|
6355
|
+
Property(false)
|
|
6356
|
+
], TreeGrid.prototype, "enableAdaptiveUI", void 0);
|
|
6219
6357
|
__decorate([
|
|
6220
6358
|
Property(false)
|
|
6221
6359
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
@@ -7760,6 +7898,12 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
|
|
|
7760
7898
|
return super.getData();
|
|
7761
7899
|
}
|
|
7762
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
|
+
}
|
|
7763
7907
|
const info = this.getDataInfo();
|
|
7764
7908
|
if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
|
|
7765
7909
|
if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
|
|
@@ -9589,11 +9733,6 @@ class BatchEdit {
|
|
|
9589
9733
|
const data = (this.parent.grid.dataSource instanceof DataManager ?
|
|
9590
9734
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
9591
9735
|
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
9736
|
if (!isNullOrUndefined(this.batchAddedRecords)) {
|
|
9598
9737
|
for (let i = 0; i < this.batchAddedRecords.length; i++) {
|
|
9599
9738
|
index = data.map((e) => { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
|
|
@@ -9613,6 +9752,11 @@ class BatchEdit {
|
|
|
9613
9752
|
}
|
|
9614
9753
|
}
|
|
9615
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
|
+
}
|
|
9616
9760
|
if (!isNullOrUndefined(this.batchDeletedRecords)) {
|
|
9617
9761
|
for (let i = 0; i < this.batchDeletedRecords.length; i++) {
|
|
9618
9762
|
if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
|
|
@@ -10487,13 +10631,23 @@ class Edit$1 {
|
|
|
10487
10631
|
}
|
|
10488
10632
|
if (args.requestType === 'delete') {
|
|
10489
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
|
+
}
|
|
10490
10644
|
for (let i = 0; i < data.length; i++) {
|
|
10491
10645
|
this.deleteUniqueID(data[i].uniqueID);
|
|
10492
10646
|
const childs = findChildrenRecords(data[i]);
|
|
10493
10647
|
for (let c = 0; c < childs.length; c++) {
|
|
10494
10648
|
this.deleteUniqueID(childs[c].uniqueID);
|
|
10495
10649
|
}
|
|
10496
|
-
args.data = [...data, ...childs];
|
|
10650
|
+
args.data = [...args.data, ...childs];
|
|
10497
10651
|
}
|
|
10498
10652
|
}
|
|
10499
10653
|
if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {
|
|
@@ -10569,8 +10723,7 @@ class Edit$1 {
|
|
|
10569
10723
|
const currentData = this.parent.grid.getCurrentViewRecords();
|
|
10570
10724
|
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
10571
10725
|
this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
|
|
10572
|
-
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
|
|
10573
|
-
|
|
10726
|
+
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
|
|
10574
10727
|
}
|
|
10575
10728
|
let index = this.addRowIndex;
|
|
10576
10729
|
value.uniqueID = getUid(this.parent.element.id + '_data_');
|
|
@@ -11074,7 +11227,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11074
11227
|
if (isNullOrUndefined(this.observer[containerRect])) {
|
|
11075
11228
|
this.observer[containerRect] = this.observers[containerRect];
|
|
11076
11229
|
}
|
|
11077
|
-
if (
|
|
11230
|
+
if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
|
|
11231
|
+
isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
|
|
11078
11232
|
super[selectVirtualRow](args);
|
|
11079
11233
|
}
|
|
11080
11234
|
}
|