@syncfusion/ej2-treegrid 20.1.60 → 20.2.36
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 +5 -58
- 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 +187 -110
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +190 -113
- 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/helpers/e2e/index.js +8 -6
- package/helpers/e2e/treegridhelper.js +82 -65
- package/package.json +9 -9
- package/src/treegrid/actions/batch-edit.js +6 -1
- package/src/treegrid/actions/rowdragdrop.js +46 -9
- package/src/treegrid/actions/sort.js +11 -0
- package/src/treegrid/base/data.js +12 -0
- package/src/treegrid/base/treegrid.js +4 -3
- package/src/treegrid/renderer/virtual-tree-content-render.js +12 -2
- package/styles/bootstrap-dark.css +9 -0
- package/styles/bootstrap.css +9 -0
- package/styles/bootstrap4.css +9 -0
- package/styles/bootstrap5-dark.css +9 -0
- package/styles/bootstrap5.css +9 -0
- package/styles/fabric-dark.css +9 -0
- package/styles/fabric.css +9 -0
- package/styles/fluent-dark.css +9 -0
- package/styles/fluent.css +9 -0
- package/styles/highcontrast-light.css +9 -0
- package/styles/highcontrast.css +9 -0
- package/styles/material-dark.css +9 -0
- package/styles/material.css +9 -0
- package/styles/tailwind-dark.css +9 -0
- package/styles/tailwind.css +9 -0
- package/styles/treegrid/_fusionnew-definition.scss +29 -0
- package/styles/treegrid/_icons.scss +11 -0
- package/styles/treegrid/_material3-definition.scss +29 -0
- package/styles/treegrid/bootstrap-dark.css +9 -0
- package/styles/treegrid/bootstrap.css +9 -0
- package/styles/treegrid/bootstrap4.css +9 -0
- package/styles/treegrid/bootstrap5-dark.css +9 -0
- package/styles/treegrid/bootstrap5.css +9 -0
- package/styles/treegrid/fabric-dark.css +9 -0
- package/styles/treegrid/fabric.css +9 -0
- package/styles/treegrid/fluent-dark.css +9 -0
- package/styles/treegrid/fluent.css +9 -0
- package/styles/treegrid/highcontrast-light.css +9 -0
- package/styles/treegrid/highcontrast.css +9 -0
- package/styles/treegrid/icons/_bootstrap-dark.scss +11 -0
- package/styles/treegrid/icons/_bootstrap.scss +11 -0
- package/styles/treegrid/icons/_bootstrap4.scss +11 -0
- package/styles/treegrid/icons/_bootstrap5.scss +11 -0
- package/styles/treegrid/icons/_fabric-dark.scss +11 -0
- package/styles/treegrid/icons/_fabric.scss +11 -0
- package/styles/treegrid/icons/_fluent.scss +11 -0
- package/styles/treegrid/icons/_fusionnew.scss +26 -0
- package/styles/treegrid/icons/_highcontrast-light.scss +11 -0
- package/styles/treegrid/icons/_highcontrast.scss +11 -0
- package/styles/treegrid/icons/_material-dark.scss +11 -0
- package/styles/treegrid/icons/_material.scss +11 -0
- package/styles/treegrid/icons/_material3.scss +26 -0
- package/styles/treegrid/icons/_tailwind-dark.scss +11 -0
- package/styles/treegrid/icons/_tailwind.scss +11 -0
- package/styles/treegrid/material-dark.css +9 -0
- package/styles/treegrid/material.css +9 -0
- package/styles/treegrid/tailwind-dark.css +9 -0
- package/styles/treegrid/tailwind.css +9 -0
|
@@ -1271,100 +1271,6 @@ class Selection {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
|
-
/**
|
|
1275
|
-
* TreeGrid Freeze module
|
|
1276
|
-
*
|
|
1277
|
-
* @hidden
|
|
1278
|
-
*/
|
|
1279
|
-
class Freeze$1 {
|
|
1280
|
-
/**
|
|
1281
|
-
* Constructor for render module
|
|
1282
|
-
*
|
|
1283
|
-
* @param {TreeGrid} parent - Tree Grid instance
|
|
1284
|
-
*/
|
|
1285
|
-
constructor(parent) {
|
|
1286
|
-
Grid.Inject(Freeze);
|
|
1287
|
-
this.parent = parent;
|
|
1288
|
-
this.addEventListener();
|
|
1289
|
-
}
|
|
1290
|
-
addEventListener() {
|
|
1291
|
-
this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
|
|
1292
|
-
this.parent.on('dataBoundArg', this.dataBoundArg, this);
|
|
1293
|
-
this.parent.grid.on('dblclick', this.dblClickHandler, this);
|
|
1294
|
-
}
|
|
1295
|
-
removeEventListener() {
|
|
1296
|
-
if (this.parent.isDestroyed) {
|
|
1297
|
-
return;
|
|
1298
|
-
}
|
|
1299
|
-
this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
|
|
1300
|
-
this.parent.off('dataBoundArg', this.dataBoundArg);
|
|
1301
|
-
this.parent.grid.off('dblclick', this.dblClickHandler);
|
|
1302
|
-
}
|
|
1303
|
-
rowExpandCollapse(args) {
|
|
1304
|
-
const movableRows = this.parent.getMovableDataRows();
|
|
1305
|
-
const frozenrows = this.parent.getRows();
|
|
1306
|
-
let rows;
|
|
1307
|
-
let frozenRightRows;
|
|
1308
|
-
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
1309
|
-
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
1310
|
-
if (freeze) {
|
|
1311
|
-
frozenRightRows = this.parent.getFrozenRightRows().filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
|
|
1312
|
-
}
|
|
1313
|
-
if (!args.detailrows.length) {
|
|
1314
|
-
rows = movableRows.filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
|
|
1315
|
-
}
|
|
1316
|
-
else {
|
|
1317
|
-
rows = args.detailrows;
|
|
1318
|
-
}
|
|
1319
|
-
for (let i = 0; i < rows.length; i++) {
|
|
1320
|
-
const rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
|
|
1321
|
-
rows[i].style.display = args.action;
|
|
1322
|
-
if (freeze) {
|
|
1323
|
-
frozenRightRows[i].style.display = args.action;
|
|
1324
|
-
}
|
|
1325
|
-
const queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
|
|
1326
|
-
: '.e-treecolumn-container .e-treegridexpand';
|
|
1327
|
-
if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
|
|
1328
|
-
const cRow = [];
|
|
1329
|
-
for (let i = 0; i < movableRows.length; i++) {
|
|
1330
|
-
if (movableRows[i].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
|
|
1331
|
-
cRow.push(movableRows[i]);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
if (cRow.length) {
|
|
1335
|
-
this.rowExpandCollapse({ detailrows: cRow, action: args.action });
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
dblClickHandler(e) {
|
|
1341
|
-
if (parentsUntil(e.target, 'e-rowcell') &&
|
|
1342
|
-
this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
|
|
1343
|
-
this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
dataBoundArg() {
|
|
1347
|
-
const checkboxColumn = this.parent.getColumns().filter((e) => {
|
|
1348
|
-
return e.showCheckbox;
|
|
1349
|
-
});
|
|
1350
|
-
if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
|
|
1351
|
-
addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
destroy() {
|
|
1355
|
-
this.removeEventListener();
|
|
1356
|
-
}
|
|
1357
|
-
/**
|
|
1358
|
-
* For internal use only - Get the module name.
|
|
1359
|
-
*
|
|
1360
|
-
* @private
|
|
1361
|
-
* @returns {string} Returns Freeze module name
|
|
1362
|
-
*/
|
|
1363
|
-
getModuleName() {
|
|
1364
|
-
return 'freeze';
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
1274
|
/**
|
|
1369
1275
|
* TreeGrid Print module
|
|
1370
1276
|
*
|
|
@@ -2319,6 +2225,18 @@ class DataManipulation {
|
|
|
2319
2225
|
srtQry.sortBy(this.parent.grid.sortSettings.columns[srt].field, compFun);
|
|
2320
2226
|
}
|
|
2321
2227
|
const modifiedData = new DataManager(parentData).executeLocal(srtQry);
|
|
2228
|
+
if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
|
|
2229
|
+
this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
|
|
2230
|
+
var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
|
|
2231
|
+
modifiedData.splice(dragdIndex, 1);
|
|
2232
|
+
var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
|
|
2233
|
+
if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
|
|
2234
|
+
modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
2235
|
+
}
|
|
2236
|
+
else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
|
|
2237
|
+
modifiedData.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2322
2240
|
const sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };
|
|
2323
2241
|
this.parent.notify('createSort', sortArgs);
|
|
2324
2242
|
results = sortArgs.modifiedData;
|
|
@@ -3413,7 +3331,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3413
3331
|
requiredModules() {
|
|
3414
3332
|
const modules = [];
|
|
3415
3333
|
const splitFrozenCount = 'splitFrozenCount';
|
|
3416
|
-
this.freezeModule = new Freeze$1(this);
|
|
3417
3334
|
this.grid[splitFrozenCount](this.getGridColumns(this.columns));
|
|
3418
3335
|
if (this.isDestroyed) {
|
|
3419
3336
|
return modules;
|
|
@@ -3464,8 +3381,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3464
3381
|
member: 'ExcelExport', args: [this]
|
|
3465
3382
|
});
|
|
3466
3383
|
}
|
|
3384
|
+
const freezePresent = this.injectedModules.filter((e) => {
|
|
3385
|
+
return e.prototype.getModuleName() === 'freeze';
|
|
3386
|
+
});
|
|
3467
3387
|
if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
|
|
3468
|
-
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() ||
|
|
3388
|
+
this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || freezePresent.length) {
|
|
3469
3389
|
modules.push({
|
|
3470
3390
|
member: 'freeze', args: [this]
|
|
3471
3391
|
});
|
|
@@ -7084,7 +7004,8 @@ class RowDD$1 {
|
|
|
7084
7004
|
this.parent[dropPosition] = this.dropPosition;
|
|
7085
7005
|
const data = [];
|
|
7086
7006
|
for (let i = 0; i < fromIndexes.length; i++) {
|
|
7087
|
-
|
|
7007
|
+
const index = this.parent.getRowByIndex(fromIndexes[i]).rowIndex;
|
|
7008
|
+
data[i] = this.parent.getCurrentViewRecords()[index];
|
|
7088
7009
|
}
|
|
7089
7010
|
const isByMethod = true;
|
|
7090
7011
|
const args = {
|
|
@@ -7188,6 +7109,9 @@ class RowDD$1 {
|
|
|
7188
7109
|
else {
|
|
7189
7110
|
dropIndex = this.selectedRow.rowIndex - 1;
|
|
7190
7111
|
}
|
|
7112
|
+
if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
|
|
7113
|
+
dropIndex = parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10) - 1;
|
|
7114
|
+
}
|
|
7191
7115
|
tObj[action] = 'indenting';
|
|
7192
7116
|
tObj[droppedIndex] = dropIndex;
|
|
7193
7117
|
this.eventTrigger('indenting', dropIndex);
|
|
@@ -7204,6 +7128,9 @@ class RowDD$1 {
|
|
|
7204
7128
|
dropIndex = i;
|
|
7205
7129
|
}
|
|
7206
7130
|
}
|
|
7131
|
+
if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop && this.selectedRecord) {
|
|
7132
|
+
dropIndex = parseInt(this.parent.getRows()[dropIndex].getAttribute('aria-rowindex'), 10);
|
|
7133
|
+
}
|
|
7207
7134
|
tObj[action] = 'outdenting';
|
|
7208
7135
|
tObj[droppedIndex] = dropIndex;
|
|
7209
7136
|
this.eventTrigger('outdenting', dropIndex);
|
|
@@ -7220,10 +7147,20 @@ class RowDD$1 {
|
|
|
7220
7147
|
this.parent.trigger(actionBegin, actionArgs, (actionArgs) => {
|
|
7221
7148
|
if (!actionArgs.cancel) {
|
|
7222
7149
|
if (actionArgs.action === 'indenting') {
|
|
7223
|
-
|
|
7150
|
+
if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
|
|
7151
|
+
this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10)], dropIndex, 'child');
|
|
7152
|
+
}
|
|
7153
|
+
else {
|
|
7154
|
+
this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'child');
|
|
7155
|
+
}
|
|
7224
7156
|
}
|
|
7225
7157
|
else if (actionArgs.action === 'outdenting') {
|
|
7226
|
-
|
|
7158
|
+
if (this.parent.enableVirtualization && this.parent.allowRowDragAndDrop) {
|
|
7159
|
+
this.reorderRows([parseInt(this.selectedRow.getAttribute('aria-rowindex'), 10)], dropIndex, 'below');
|
|
7160
|
+
}
|
|
7161
|
+
else {
|
|
7162
|
+
this.reorderRows([this.selectedRow.rowIndex], dropIndex, 'below');
|
|
7163
|
+
}
|
|
7227
7164
|
}
|
|
7228
7165
|
}
|
|
7229
7166
|
});
|
|
@@ -7418,16 +7355,24 @@ class RowDD$1 {
|
|
|
7418
7355
|
removeLastrowBorder(element) {
|
|
7419
7356
|
const isEmptyRow = element && (element.classList.contains('e-emptyrow') || element.classList.contains('e-columnheader')
|
|
7420
7357
|
|| element.classList.contains('e-detailrow'));
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7358
|
+
let islastRowIndex;
|
|
7359
|
+
if (this.parent.enableVirtualization) {
|
|
7360
|
+
islastRowIndex = element && !isEmptyRow &&
|
|
7361
|
+
this.parent.getRows()[this.parent.getCurrentViewRecords().length - 1].getAttribute('data-uid') !==
|
|
7362
|
+
element.getAttribute('data-uid');
|
|
7363
|
+
}
|
|
7364
|
+
else {
|
|
7365
|
+
islastRowIndex = element && !isEmptyRow &&
|
|
7366
|
+
this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==
|
|
7367
|
+
element.getAttribute('data-uid');
|
|
7368
|
+
}
|
|
7424
7369
|
const canremove = islastRowIndex || this.dropPosition === 'topSegment';
|
|
7425
7370
|
if (this.parent.element.getElementsByClassName('e-lastrow-border').length > 0 && element && (islastRowIndex || canremove)) {
|
|
7426
7371
|
this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();
|
|
7427
7372
|
}
|
|
7428
7373
|
}
|
|
7429
7374
|
updateIcon(row, index, args) {
|
|
7430
|
-
|
|
7375
|
+
let rowEle = args.target ? closest(args.target, 'tr') : null;
|
|
7431
7376
|
this.dropPosition = undefined;
|
|
7432
7377
|
let rowPositionHeight = 0;
|
|
7433
7378
|
this.removeFirstrowBorder(rowEle);
|
|
@@ -7454,7 +7399,12 @@ class RowDD$1 {
|
|
|
7454
7399
|
rowPositionHeight = rowEle.offsetTop - scrollTop;
|
|
7455
7400
|
}
|
|
7456
7401
|
// let scrollTop = (tObj.grid.scrollModule as any).content.scrollTop;
|
|
7457
|
-
|
|
7402
|
+
if (this.parent.enableVirtualization) {
|
|
7403
|
+
rowTop = rowEle.getBoundingClientRect().top;
|
|
7404
|
+
}
|
|
7405
|
+
else {
|
|
7406
|
+
rowTop = rowPositionHeight + contentHeight + roundOff;
|
|
7407
|
+
}
|
|
7458
7408
|
const rowBottom = rowTop + row[0].offsetHeight;
|
|
7459
7409
|
const difference = rowBottom - rowTop;
|
|
7460
7410
|
const divide = difference / 3;
|
|
@@ -7534,7 +7484,7 @@ class RowDD$1 {
|
|
|
7534
7484
|
addLastRowborder(trElement) {
|
|
7535
7485
|
const isEmptyRow = trElement && (trElement.classList.contains('e-emptyrow') ||
|
|
7536
7486
|
trElement.classList.contains('e-columnheader') || trElement.classList.contains('e-detailrow'));
|
|
7537
|
-
if (trElement && !isEmptyRow && this.parent.
|
|
7487
|
+
if (trElement && !isEmptyRow && this.parent.getRows()[this.parent.getCurrentViewRecords().length - 1].getAttribute('data-uid') ===
|
|
7538
7488
|
trElement.getAttribute('data-uid')) {
|
|
7539
7489
|
const bottomborder = this.parent.createElement('div', { className: 'e-lastrow-border' });
|
|
7540
7490
|
const gridcontentEle = this.parent.getContent();
|
|
@@ -7876,7 +7826,13 @@ class RowDD$1 {
|
|
|
7876
7826
|
}
|
|
7877
7827
|
else {
|
|
7878
7828
|
args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;
|
|
7879
|
-
this.
|
|
7829
|
+
if (this.parent.enableVirtualization) {
|
|
7830
|
+
const index = this.parent.getRowByIndex(args.dropIndex).rowIndex;
|
|
7831
|
+
this.droppedRecord = tObj.getCurrentViewRecords()[index];
|
|
7832
|
+
}
|
|
7833
|
+
else {
|
|
7834
|
+
this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];
|
|
7835
|
+
}
|
|
7880
7836
|
}
|
|
7881
7837
|
let dragRecords = [];
|
|
7882
7838
|
droppedRecord = this.droppedRecord;
|
|
@@ -7953,6 +7909,7 @@ class RowDD$1 {
|
|
|
7953
7909
|
childRecords.splice(droppedRecordIndex, 0, draggedRecord);
|
|
7954
7910
|
draggedRecord.parentItem = droppedRecord.parentItem;
|
|
7955
7911
|
draggedRecord.parentUniqueID = droppedRecord.parentUniqueID;
|
|
7912
|
+
draggedRecord.level = droppedRecord.level;
|
|
7956
7913
|
if (this.parent.parentIdMapping) {
|
|
7957
7914
|
draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];
|
|
7958
7915
|
draggedRecord.parentItem = droppedRecord.parentItem;
|
|
@@ -9667,7 +9624,18 @@ class Sort$1 {
|
|
|
9667
9624
|
this.flatSortedData[this.storedIndex] = data[d];
|
|
9668
9625
|
}
|
|
9669
9626
|
if (data[d].hasChildRecords) {
|
|
9670
|
-
|
|
9627
|
+
let childSort = (new DataManager(data[d].childRecords).executeLocal(srtQry));
|
|
9628
|
+
if (this.parent.allowRowDragAndDrop && data[d].childRecords.indexOf(this.parent.rowDragAndDropModule['draggedRecord']) !== -1 && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
|
|
9629
|
+
var dragdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
|
|
9630
|
+
childSort.splice(dragdIndex, 1);
|
|
9631
|
+
var dropdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
|
|
9632
|
+
if (this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
|
|
9633
|
+
childSort.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
9634
|
+
}
|
|
9635
|
+
else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
|
|
9636
|
+
childSort.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
9637
|
+
}
|
|
9638
|
+
}
|
|
9671
9639
|
this.iterateSort(childSort, srtQry);
|
|
9672
9640
|
}
|
|
9673
9641
|
}
|
|
@@ -10484,7 +10452,12 @@ class BatchEdit {
|
|
|
10484
10452
|
nextCellIndex(args) {
|
|
10485
10453
|
const index = 'index';
|
|
10486
10454
|
const rowIndex = 'rowIndex';
|
|
10487
|
-
|
|
10455
|
+
if (this.parent.getSelectedRows().length) {
|
|
10456
|
+
args[index] = this.parent.getSelectedRows()[0][rowIndex];
|
|
10457
|
+
}
|
|
10458
|
+
else {
|
|
10459
|
+
args[index] = this.batchIndex;
|
|
10460
|
+
}
|
|
10488
10461
|
}
|
|
10489
10462
|
}
|
|
10490
10463
|
|
|
@@ -11976,7 +11949,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
11976
11949
|
firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('aria-rowindex');
|
|
11977
11950
|
}
|
|
11978
11951
|
if (firsttdinx === 0) {
|
|
11979
|
-
this.
|
|
11952
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
11953
|
+
this.translateY = scrollArgs.offset.top - this.parent.getRowHeight() * 2;
|
|
11954
|
+
}
|
|
11955
|
+
else {
|
|
11956
|
+
this.translateY = scrollArgs.offset.top;
|
|
11957
|
+
}
|
|
11980
11958
|
}
|
|
11981
11959
|
else {
|
|
11982
11960
|
const height = this.parent.getRowHeight();
|
|
@@ -12002,7 +11980,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
12002
11980
|
this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
|
|
12003
11981
|
}
|
|
12004
11982
|
else {
|
|
12005
|
-
this.
|
|
11983
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
11984
|
+
this.translateY = scrollArgs.offset.top - this.parent.getRowHeight() * 2;
|
|
11985
|
+
}
|
|
11986
|
+
else {
|
|
11987
|
+
this.translateY = scrollArgs.offset.top;
|
|
11988
|
+
}
|
|
12006
11989
|
}
|
|
12007
11990
|
}
|
|
12008
11991
|
if (((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))
|
|
@@ -12364,6 +12347,100 @@ class TreeVirtual extends VirtualScroll {
|
|
|
12364
12347
|
}
|
|
12365
12348
|
}
|
|
12366
12349
|
|
|
12350
|
+
/**
|
|
12351
|
+
* TreeGrid Freeze module
|
|
12352
|
+
*
|
|
12353
|
+
* @hidden
|
|
12354
|
+
*/
|
|
12355
|
+
class Freeze$1 {
|
|
12356
|
+
/**
|
|
12357
|
+
* Constructor for render module
|
|
12358
|
+
*
|
|
12359
|
+
* @param {TreeGrid} parent - Tree Grid instance
|
|
12360
|
+
*/
|
|
12361
|
+
constructor(parent) {
|
|
12362
|
+
Grid.Inject(Freeze);
|
|
12363
|
+
this.parent = parent;
|
|
12364
|
+
this.addEventListener();
|
|
12365
|
+
}
|
|
12366
|
+
addEventListener() {
|
|
12367
|
+
this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
|
|
12368
|
+
this.parent.on('dataBoundArg', this.dataBoundArg, this);
|
|
12369
|
+
this.parent.grid.on('dblclick', this.dblClickHandler, this);
|
|
12370
|
+
}
|
|
12371
|
+
removeEventListener() {
|
|
12372
|
+
if (this.parent.isDestroyed) {
|
|
12373
|
+
return;
|
|
12374
|
+
}
|
|
12375
|
+
this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
|
|
12376
|
+
this.parent.off('dataBoundArg', this.dataBoundArg);
|
|
12377
|
+
this.parent.grid.off('dblclick', this.dblClickHandler);
|
|
12378
|
+
}
|
|
12379
|
+
rowExpandCollapse(args) {
|
|
12380
|
+
const movableRows = this.parent.getMovableDataRows();
|
|
12381
|
+
const frozenrows = this.parent.getRows();
|
|
12382
|
+
let rows;
|
|
12383
|
+
let frozenRightRows;
|
|
12384
|
+
const freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
|
|
12385
|
+
this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
12386
|
+
if (freeze) {
|
|
12387
|
+
frozenRightRows = this.parent.getFrozenRightRows().filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
|
|
12388
|
+
}
|
|
12389
|
+
if (!args.detailrows.length) {
|
|
12390
|
+
rows = movableRows.filter((e) => e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1)));
|
|
12391
|
+
}
|
|
12392
|
+
else {
|
|
12393
|
+
rows = args.detailrows;
|
|
12394
|
+
}
|
|
12395
|
+
for (let i = 0; i < rows.length; i++) {
|
|
12396
|
+
const rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
|
|
12397
|
+
rows[i].style.display = args.action;
|
|
12398
|
+
if (freeze) {
|
|
12399
|
+
frozenRightRows[i].style.display = args.action;
|
|
12400
|
+
}
|
|
12401
|
+
const queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
|
|
12402
|
+
: '.e-treecolumn-container .e-treegridexpand';
|
|
12403
|
+
if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
|
|
12404
|
+
const cRow = [];
|
|
12405
|
+
for (let i = 0; i < movableRows.length; i++) {
|
|
12406
|
+
if (movableRows[i].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
|
|
12407
|
+
cRow.push(movableRows[i]);
|
|
12408
|
+
}
|
|
12409
|
+
}
|
|
12410
|
+
if (cRow.length) {
|
|
12411
|
+
this.rowExpandCollapse({ detailrows: cRow, action: args.action });
|
|
12412
|
+
}
|
|
12413
|
+
}
|
|
12414
|
+
}
|
|
12415
|
+
}
|
|
12416
|
+
dblClickHandler(e) {
|
|
12417
|
+
if (parentsUntil(e.target, 'e-rowcell') &&
|
|
12418
|
+
this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
|
|
12419
|
+
this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
|
|
12420
|
+
}
|
|
12421
|
+
}
|
|
12422
|
+
dataBoundArg() {
|
|
12423
|
+
const checkboxColumn = this.parent.getColumns().filter((e) => {
|
|
12424
|
+
return e.showCheckbox;
|
|
12425
|
+
});
|
|
12426
|
+
if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
|
|
12427
|
+
addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
|
|
12428
|
+
}
|
|
12429
|
+
}
|
|
12430
|
+
destroy() {
|
|
12431
|
+
this.removeEventListener();
|
|
12432
|
+
}
|
|
12433
|
+
/**
|
|
12434
|
+
* For internal use only - Get the module name.
|
|
12435
|
+
*
|
|
12436
|
+
* @private
|
|
12437
|
+
* @returns {string} Returns Freeze module name
|
|
12438
|
+
*/
|
|
12439
|
+
getModuleName() {
|
|
12440
|
+
return 'freeze';
|
|
12441
|
+
}
|
|
12442
|
+
}
|
|
12443
|
+
|
|
12367
12444
|
/**
|
|
12368
12445
|
* TreeGrid ColumnChooser module
|
|
12369
12446
|
*
|