@syncfusion/ej2-treegrid 20.2.36 → 20.2.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/CHANGELOG.md +28 -0
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +140 -79
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +139 -78
- 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 +37 -15
- package/src/treegrid/actions/context-menu.js +1 -0
- package/src/treegrid/actions/edit.d.ts +1 -0
- package/src/treegrid/actions/edit.js +49 -28
- package/src/treegrid/actions/infinite-scroll.js +6 -3
- package/src/treegrid/actions/rowdragdrop.js +5 -5
- package/src/treegrid/actions/selection.js +7 -2
- package/src/treegrid/base/constant.d.ts +2 -0
- package/src/treegrid/base/constant.js +2 -0
- package/src/treegrid/base/data.js +2 -2
- package/src/treegrid/base/treegrid.d.ts +1 -0
- package/src/treegrid/base/treegrid.js +15 -8
- package/src/treegrid/renderer/render.js +2 -2
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +1 -1
- package/src/treegrid/renderer/virtual-tree-content-render.js +11 -11
- package/src/treegrid/utils.js +1 -1
|
@@ -41,7 +41,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
41
41
|
return new TreeVirtualRowModelGenerator(this.parent);
|
|
42
42
|
};
|
|
43
43
|
VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {
|
|
44
|
-
return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('
|
|
44
|
+
return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('data-rowindex'), 10) === index; })[0];
|
|
45
45
|
};
|
|
46
46
|
VirtualTreeContentRenderer.prototype.addEventListener = function () {
|
|
47
47
|
this.parent.on(events.virtualActionArgs, this.virtualOtherAction, this);
|
|
@@ -126,7 +126,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
126
126
|
getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && this.startIndex === -1)) {
|
|
129
|
+
if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && (this.startIndex === -1 || this.startIndex === 0 && this['preStartIndex'] === 0))) {
|
|
130
130
|
this.contents.scrollTop = 0;
|
|
131
131
|
this.isDataSourceChanged = false;
|
|
132
132
|
}
|
|
@@ -220,7 +220,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
220
220
|
return new Cell(opt);
|
|
221
221
|
};
|
|
222
222
|
VirtualTreeContentRenderer.prototype.beginEdit = function (e) {
|
|
223
|
-
var selector = '.e-row[
|
|
223
|
+
var selector = '.e-row[data-rowindex="' + e.index + '"]';
|
|
224
224
|
var index = this.parent.getContent().querySelector(selector).rowIndex;
|
|
225
225
|
var rowData = this.parent.getCurrentViewRecords()[index];
|
|
226
226
|
e.data = rowData;
|
|
@@ -228,14 +228,14 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
228
228
|
VirtualTreeContentRenderer.prototype.beginAdd = function (args) {
|
|
229
229
|
var addAction = 'addActionBegin';
|
|
230
230
|
var isAdd = 'isAdd';
|
|
231
|
-
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex,
|
|
231
|
+
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
|
|
232
232
|
this.parent.notify('get-row-position', addArgs);
|
|
233
233
|
this.rowPosition = addArgs.newRowPosition;
|
|
234
234
|
this.addRowIndex = addArgs.addRowIndex;
|
|
235
|
-
this.
|
|
235
|
+
this.dataRowIndex = addArgs.dataRowIndex;
|
|
236
236
|
var rows = this.parent.getRows();
|
|
237
|
-
var firstAriaIndex = rows.length ? +rows[0].getAttribute('
|
|
238
|
-
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('
|
|
237
|
+
var firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;
|
|
238
|
+
var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;
|
|
239
239
|
var withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;
|
|
240
240
|
if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
|
|
241
241
|
this[isAdd] = true;
|
|
@@ -286,11 +286,11 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
286
286
|
};
|
|
287
287
|
VirtualTreeContentRenderer.prototype.onActionComplete = function (args) {
|
|
288
288
|
if (args.requestType === 'add') {
|
|
289
|
-
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex,
|
|
289
|
+
var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, dataRowIndex: this.dataRowIndex };
|
|
290
290
|
this.parent.notify('get-row-position', addArgs);
|
|
291
291
|
this.rowPosition = addArgs.newRowPosition;
|
|
292
292
|
this.addRowIndex = addArgs.addRowIndex;
|
|
293
|
-
this.
|
|
293
|
+
this.dataRowIndex = addArgs.dataRowIndex;
|
|
294
294
|
}
|
|
295
295
|
var actionComplete = 'actionComplete';
|
|
296
296
|
_super.prototype[actionComplete].call(this, args);
|
|
@@ -353,7 +353,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
353
353
|
!isNullOrUndefined(this.parent.getContent().querySelectorAll('.e-content tr')[rowPt])) {
|
|
354
354
|
var attr = this.parent.getContent().querySelectorAll('.e-content tr')[rowPt]
|
|
355
355
|
.querySelector('td').getAttribute('index');
|
|
356
|
-
firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('
|
|
356
|
+
firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
|
|
357
357
|
}
|
|
358
358
|
if (firsttdinx === 0) {
|
|
359
359
|
if (this.parent.allowRowDragAndDrop) {
|
|
@@ -452,7 +452,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
|
|
|
452
452
|
var isAdd = 'isAdd';
|
|
453
453
|
if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {
|
|
454
454
|
if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {
|
|
455
|
-
if (this.
|
|
455
|
+
if (this.dataRowIndex >= this.startIndex) {
|
|
456
456
|
this.restoreNewRow();
|
|
457
457
|
}
|
|
458
458
|
else if (this.addRowIndex && this.addRowIndex > -1) {
|
package/src/treegrid/utils.js
CHANGED
|
@@ -121,7 +121,7 @@ export function findChildrenRecords(records) {
|
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
123
123
|
if (!isNullOrUndefined(records.childRecords)) {
|
|
124
|
-
var childRecords = records.childRecords;
|
|
124
|
+
var childRecords = records.childRecords.filter(function (items) { return !items.isSummaryRow; });
|
|
125
125
|
var keys = Object.keys(childRecords);
|
|
126
126
|
for (var i = 0, len = keys.length; i < len; i++) {
|
|
127
127
|
datas.push(childRecords[i]);
|