@syncfusion/ej2-treegrid 20.3.60 → 20.4.38
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/.eslintrc.json +16 -1
- package/CHANGELOG.md +8 -53
- package/README.md +64 -51
- package/dist/ej2-treegrid.min.js +2 -2
- 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 +1191 -908
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1249 -944
- 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 +16 -10
- package/src/treegrid/actions/batch-edit.js +82 -82
- package/src/treegrid/actions/clipboard.js +34 -33
- package/src/treegrid/actions/context-menu.js +1 -1
- package/src/treegrid/actions/crud-actions.js +62 -55
- package/src/treegrid/actions/detail-row.js +7 -7
- package/src/treegrid/actions/edit.js +61 -60
- package/src/treegrid/actions/excel-export.js +2 -2
- package/src/treegrid/actions/filter.js +13 -13
- package/src/treegrid/actions/freeze-column.js +9 -8
- package/src/treegrid/actions/infinite-scroll.js +19 -19
- package/src/treegrid/actions/logger.js +10 -10
- package/src/treegrid/actions/page.js +8 -8
- package/src/treegrid/actions/reorder.js +2 -2
- package/src/treegrid/actions/rowdragdrop.js +88 -82
- package/src/treegrid/actions/selection.js +34 -32
- package/src/treegrid/actions/sort.js +7 -6
- package/src/treegrid/actions/summary.js +24 -24
- package/src/treegrid/actions/toolbar.js +2 -2
- package/src/treegrid/base/data.js +242 -55
- package/src/treegrid/base/treegrid-model.d.ts +20 -4
- package/src/treegrid/base/treegrid.d.ts +24 -5
- package/src/treegrid/base/treegrid.js +226 -191
- package/src/treegrid/models/column.js +3 -3
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/loading-indicator-model.d.ts +19 -0
- package/src/treegrid/models/loading-indicator.d.ts +16 -0
- package/src/treegrid/models/loading-indicator.js +34 -0
- package/src/treegrid/renderer/render.js +20 -19
- package/src/treegrid/renderer/virtual-row-model-generator.js +6 -5
- package/src/treegrid/renderer/virtual-tree-content-render.js +128 -99
- package/src/treegrid/utils.js +12 -11
|
@@ -129,7 +129,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
129
129
|
else {
|
|
130
130
|
var keys = Object.keys(data);
|
|
131
131
|
for (var i = 0; i < keys.length; i++) {
|
|
132
|
-
var tempData = data[i];
|
|
132
|
+
var tempData = data[parseInt(i.toString(), 10)];
|
|
133
133
|
this.hierarchyData.push(extend({}, tempData));
|
|
134
134
|
if (!isNullOrUndefined(tempData[this.parent.idMapping])) {
|
|
135
135
|
this.taskIds.push(tempData[this.parent.idMapping]);
|
|
@@ -141,12 +141,12 @@ var DataManipulation = /** @class */ (function () {
|
|
|
141
141
|
var mappingData = new DataManager(this.hierarchyData).executeLocal(new Query()
|
|
142
142
|
.group(this.parent.parentIdMapping));
|
|
143
143
|
for (var i = 0; i < mappingData.length; i++) {
|
|
144
|
-
var groupData = mappingData[i];
|
|
144
|
+
var groupData = mappingData[parseInt(i.toString(), 10)];
|
|
145
145
|
var index = this.taskIds.indexOf(groupData.key);
|
|
146
146
|
if (!isNullOrUndefined(groupData.key)) {
|
|
147
147
|
if (index > -1) {
|
|
148
148
|
var childData = (groupData.items);
|
|
149
|
-
this.hierarchyData[index][this.parent.childMapping] = childData;
|
|
149
|
+
this.hierarchyData[parseInt(index.toString(), 10)][this.parent.childMapping] = childData;
|
|
150
150
|
continue;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -156,7 +156,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
156
156
|
}
|
|
157
157
|
if (!Object.keys(this.hierarchyData).length) {
|
|
158
158
|
var isGantt = 'isGantt';
|
|
159
|
-
var referenceData = !(this.parent.dataSource instanceof DataManager) && this.parent[isGantt];
|
|
159
|
+
var referenceData = !(this.parent.dataSource instanceof DataManager) && this.parent["" + isGantt];
|
|
160
160
|
this.parent.flatData = referenceData ? (this.parent.dataSource) : [];
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
@@ -196,7 +196,14 @@ var DataManipulation = /** @class */ (function () {
|
|
|
196
196
|
* @returns {void}
|
|
197
197
|
*/
|
|
198
198
|
DataManipulation.prototype.updateParentRemoteData = function (args) {
|
|
199
|
+
var actionArgs = 'actionArgs';
|
|
200
|
+
if (isRemoteData(this.parent) && this.parent.enableVirtualization && args["" + actionArgs].requestType === 'virtualscroll') {
|
|
201
|
+
this.parent.hideSpinner();
|
|
202
|
+
}
|
|
199
203
|
var records = args.result;
|
|
204
|
+
if (isRemoteData(this.parent) && this.parent.enableVirtualization && (args["" + actionArgs].requestType === 'virtualscroll' || args["" + actionArgs].action === 'clearFilter' || args["" + actionArgs].searchString === '')) {
|
|
205
|
+
this.parent.query.expands = [];
|
|
206
|
+
}
|
|
200
207
|
if (!this.parent.hasChildMapping && !this.parentItems.length &&
|
|
201
208
|
(!this.parent.loadChildOnDemand)) {
|
|
202
209
|
this.zerothLevelData = args;
|
|
@@ -204,31 +211,72 @@ var DataManipulation = /** @class */ (function () {
|
|
|
204
211
|
}
|
|
205
212
|
else {
|
|
206
213
|
if (!this.parent.loadChildOnDemand) {
|
|
207
|
-
|
|
208
|
-
if (isCountRequired(
|
|
209
|
-
|
|
214
|
+
var _loop_1 = function (rec) {
|
|
215
|
+
if (isCountRequired(this_1.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&
|
|
216
|
+
this_1.parent.initialRender) {
|
|
217
|
+
records[parseInt(rec.toString(), 10)].expanded = false;
|
|
218
|
+
}
|
|
219
|
+
if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization) {
|
|
220
|
+
var childRecords_1 = [];
|
|
221
|
+
var parent_1 = this_1.parent;
|
|
222
|
+
records.filter(function (e) {
|
|
223
|
+
if (e["" + parent_1.parentIdMapping] === records[parseInt(rec.toString(), 10)]["" + parent_1.idMapping]) {
|
|
224
|
+
childRecords_1.push(e);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
if (childRecords_1.length) {
|
|
228
|
+
records[parseInt(rec.toString(), 10)].expanded = true;
|
|
229
|
+
}
|
|
230
|
+
else if (records[parseInt(rec.toString(), 10)].hasChildRecords) {
|
|
231
|
+
records[parseInt(rec.toString(), 10)].expanded = false;
|
|
232
|
+
}
|
|
210
233
|
}
|
|
211
|
-
if (isNullOrUndefined(records[rec].index)) {
|
|
212
|
-
records[rec].taskData = extend({}, records[rec]);
|
|
213
|
-
records[rec].uniqueID = getUid(
|
|
214
|
-
setValue('uniqueIDCollection.' + records[rec].uniqueID, records[rec],
|
|
215
|
-
records[rec].level = 0;
|
|
216
|
-
records[rec].
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
234
|
+
if (isNullOrUndefined(records[parseInt(rec.toString(), 10)].index)) {
|
|
235
|
+
records[parseInt(rec.toString(), 10)].taskData = extend({}, records[parseInt(rec.toString(), 10)]);
|
|
236
|
+
records[parseInt(rec.toString(), 10)].uniqueID = getUid(this_1.parent.element.id + '_data_');
|
|
237
|
+
setValue('uniqueIDCollection.' + records[parseInt(rec.toString(), 10)].uniqueID, records[parseInt(rec.toString(), 10)], this_1.parent);
|
|
238
|
+
records[parseInt(rec.toString(), 10)].level = 0;
|
|
239
|
+
if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization && records[parseInt(rec.toString(), 10)]["" + this_1.parent.parentIdMapping] && records[parseInt(rec.toString(), 10)].level === 0) {
|
|
240
|
+
records[parseInt(rec.toString(), 10)].level = records[parseInt(rec.toString(), 10)].level + 1;
|
|
241
|
+
}
|
|
242
|
+
records[parseInt(rec.toString(), 10)].index = Math.ceil(Math.random() * 1000);
|
|
243
|
+
if ((records[parseInt(rec.toString(), 10)][this_1.parent.hasChildMapping] ||
|
|
244
|
+
this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)][this_1.parent.idMapping]) !== -1)) {
|
|
245
|
+
records[parseInt(rec.toString(), 10)].hasChildRecords = true;
|
|
220
246
|
}
|
|
221
|
-
records[rec].checkboxState = 'uncheck';
|
|
247
|
+
records[parseInt(rec.toString(), 10)].checkboxState = 'uncheck';
|
|
222
248
|
}
|
|
249
|
+
};
|
|
250
|
+
var this_1 = this;
|
|
251
|
+
for (var rec = 0; rec < records.length; rec++) {
|
|
252
|
+
_loop_1(rec);
|
|
223
253
|
}
|
|
224
254
|
}
|
|
225
255
|
else {
|
|
226
|
-
|
|
256
|
+
var dataResults = 'dataResults';
|
|
257
|
+
var expandRecord = 'expandRecord';
|
|
258
|
+
if (!isNullOrUndefined(records) && !((this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent["" + dataResults]["" + expandRecord])) &&
|
|
259
|
+
!(isRemoteData(this.parent) && this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization)) {
|
|
227
260
|
this.convertToFlatData(records);
|
|
228
261
|
}
|
|
229
262
|
}
|
|
230
263
|
}
|
|
231
|
-
|
|
264
|
+
if (isRemoteData(this.parent) && this.parent.loadChildOnDemand && args["" + actionArgs].isExpandCollapse && this.parent.enableVirtualization) {
|
|
265
|
+
args.result = records;
|
|
266
|
+
}
|
|
267
|
+
else if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {
|
|
268
|
+
args.result = records;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;
|
|
272
|
+
}
|
|
273
|
+
if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand
|
|
274
|
+
&& this.parent.grid.aggregates.length && this.parent.grid.sortSettings.columns.length === 0
|
|
275
|
+
&& this.parent.grid.filterSettings.columns.length === 0 && !this.parent.grid.searchSettings.key.length) {
|
|
276
|
+
var query = 'query';
|
|
277
|
+
var summaryQuery = args["" + query].queries.filter(function (q) { q.fn === 'onAggregates'; });
|
|
278
|
+
args.result = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.parent.flatData, true);
|
|
279
|
+
}
|
|
232
280
|
this.parent.notify('updateResults', args);
|
|
233
281
|
};
|
|
234
282
|
/**
|
|
@@ -244,6 +292,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
244
292
|
*/
|
|
245
293
|
DataManipulation.prototype.collectExpandingRecs = function (rowDetails, isChild) {
|
|
246
294
|
var gridRows = this.parent.getRows();
|
|
295
|
+
var name = 'name';
|
|
247
296
|
if (this.parent.rowTemplate) {
|
|
248
297
|
var rows = this.parent.getContentTable().rows;
|
|
249
298
|
gridRows = [].slice.call(rows);
|
|
@@ -254,11 +303,12 @@ var DataManipulation = /** @class */ (function () {
|
|
|
254
303
|
rowDetails.record.expanded = true;
|
|
255
304
|
}
|
|
256
305
|
for (var i = 0; i < rowDetails.rows.length; i++) {
|
|
257
|
-
rowDetails.rows[i].style.display = 'table-row';
|
|
306
|
+
rowDetails.rows[parseInt(i.toString(), 10)].style.display = 'table-row';
|
|
258
307
|
if (this.parent.loadChildOnDemand) {
|
|
259
|
-
var targetEle = rowDetails.rows[i].getElementsByClassName('e-treegridcollapse')[0];
|
|
260
|
-
childRecord = this.parent.rowTemplate ?
|
|
261
|
-
this.parent.grid.
|
|
308
|
+
var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
|
|
309
|
+
childRecord = this.parent.rowTemplate ?
|
|
310
|
+
this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
|
|
311
|
+
this.parent.grid.getRowObjectFromUID(rowDetails.rows[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;
|
|
262
312
|
if (!isNullOrUndefined(targetEle) && childRecord.expanded) {
|
|
263
313
|
addClass([targetEle], 'e-treegridexpand');
|
|
264
314
|
removeClass([targetEle], 'e-treegridcollapse');
|
|
@@ -271,14 +321,14 @@ var DataManipulation = /** @class */ (function () {
|
|
|
271
321
|
this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);
|
|
272
322
|
}
|
|
273
323
|
}
|
|
274
|
-
var expandingTd = rowDetails.rows[i].querySelector('.e-detailrowcollapse');
|
|
324
|
+
var expandingTd = rowDetails.rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowcollapse');
|
|
275
325
|
if (!isNullOrUndefined(expandingTd)) {
|
|
276
326
|
this.parent.grid.detailRowModule.expand(expandingTd);
|
|
277
327
|
}
|
|
278
328
|
}
|
|
279
329
|
}
|
|
280
330
|
else {
|
|
281
|
-
this.fetchRemoteChildData({ record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
|
|
331
|
+
this.fetchRemoteChildData({ action: rowDetails["" + name], record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
|
|
282
332
|
}
|
|
283
333
|
};
|
|
284
334
|
DataManipulation.prototype.fetchRemoteChildData = function (rowDetails) {
|
|
@@ -289,11 +339,32 @@ var DataManipulation = /** @class */ (function () {
|
|
|
289
339
|
var clonequries = qry.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });
|
|
290
340
|
qry.queries = clonequries;
|
|
291
341
|
qry.isCountRequired = true;
|
|
342
|
+
if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
343
|
+
qry.take(this.parent.pageSettings.pageSize);
|
|
344
|
+
var expandDetail_1 = [];
|
|
345
|
+
expandDetail_1.push('ExpandingAction', rowDetails.record[this.parent.idMapping]);
|
|
346
|
+
qry.expand(expandDetail_1);
|
|
347
|
+
}
|
|
348
|
+
else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {
|
|
349
|
+
qry.take(this.parent.grid.pageSettings.pageSize);
|
|
350
|
+
var expandDetail = [];
|
|
351
|
+
expandDetail.push('CollapsingAction', rowDetails.record[this.parent.idMapping]);
|
|
352
|
+
qry.expand(expandDetail);
|
|
353
|
+
}
|
|
292
354
|
qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);
|
|
293
355
|
showSpinner(this.parent.element);
|
|
294
356
|
dm.executeQuery(qry).then(function (e) {
|
|
357
|
+
var remoteExpandedData = 'remoteExpandedData';
|
|
358
|
+
var remoteCollapsedData = 'remoteCollapsedData';
|
|
359
|
+
var level = 'level';
|
|
295
360
|
var datas = _this.parent.grid.currentViewData.slice();
|
|
296
361
|
var inx = datas.indexOf(rowDetails.record);
|
|
362
|
+
if (_this.parent.enableVirtualization && (rowDetails.action === 'collapse' || rowDetails.action === 'remoteExpand')) {
|
|
363
|
+
datas = [];
|
|
364
|
+
for (var i = 0; i < inx; i++) {
|
|
365
|
+
datas.push(_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
297
368
|
if (inx === -1) {
|
|
298
369
|
_this.parent.grid.getRowsObject().forEach(function (rows) {
|
|
299
370
|
if (rows.data.uniqueID === rowDetails.record.uniqueID) {
|
|
@@ -305,23 +376,107 @@ var DataManipulation = /** @class */ (function () {
|
|
|
305
376
|
var result = e.result;
|
|
306
377
|
rowDetails.record.childRecords = result;
|
|
307
378
|
for (var r = 0; r < result.length; r++) {
|
|
308
|
-
result[r
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
379
|
+
if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
|
|
380
|
+
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
381
|
+
}
|
|
382
|
+
else if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'collapse') {
|
|
383
|
+
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
384
|
+
if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
385
|
+
_this.parent["" + remoteExpandedData].splice(i, 1);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
result[parseInt(r.toString(), 10)].taskData = extend({}, result[parseInt(r.toString(), 10)]);
|
|
390
|
+
if (result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping] && _this.parent.enableVirtualization && _this.parent["" + remoteExpandedData].length) {
|
|
391
|
+
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
392
|
+
if (result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
393
|
+
result[parseInt(r.toString(), 10)].level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
|
|
394
|
+
var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
|
|
395
|
+
result[parseInt(r.toString(), 10)].parentItem = parentData;
|
|
396
|
+
result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
else if (_this.parent.enableVirtualization) {
|
|
401
|
+
if ((result[parseInt(r.toString(), 10)]["" + _this.parent.hasChildMapping] ||
|
|
402
|
+
_this.parentItems.indexOf(result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping]) !== -1)
|
|
403
|
+
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
404
|
+
if (isNullOrUndefined(result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping])) {
|
|
405
|
+
result[parseInt(r.toString(), 10)].level = 0;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
result[parseInt(r.toString(), 10)].level = rowDetails.record.level;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
var parentData = extend({}, rowDetails.record);
|
|
413
|
+
delete parentData.childRecords;
|
|
414
|
+
result[parseInt(r.toString(), 10)].parentItem = parentData;
|
|
415
|
+
result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
result[parseInt(r.toString(), 10)].level = rowDetails.record.level + 1;
|
|
420
|
+
var parentData = extend({}, rowDetails.record);
|
|
421
|
+
delete parentData.childRecords;
|
|
422
|
+
result[parseInt(r.toString(), 10)].parentItem = parentData;
|
|
423
|
+
result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
|
|
424
|
+
}
|
|
425
|
+
result[parseInt(r.toString(), 10)].index = Math.ceil(Math.random() * 1000);
|
|
426
|
+
result[parseInt(r.toString(), 10)].uniqueID = getUid(_this.parent.element.id + '_data_');
|
|
427
|
+
result[parseInt(r.toString(), 10)].checkboxState = 'uncheck';
|
|
428
|
+
if (_this.parent.enableVirtualization && isNullOrUndefined(result[parseInt(r.toString(), 10)].level)) {
|
|
429
|
+
for (var p = 0; p < _this.parent.grid.currentViewData.length; p++) {
|
|
430
|
+
if (_this.parent.grid.currentViewData[parseInt(p.toString(), 10)]["" + _this.parent.idMapping] === result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping]) {
|
|
431
|
+
result[parseInt(r.toString(), 10)].level = _this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
setValue('uniqueIDCollection.' + result[parseInt(r.toString(), 10)].uniqueID, result[parseInt(r.toString(), 10)], _this.parent);
|
|
318
436
|
// delete result[r].parentItem.childRecords;
|
|
319
|
-
if ((result[r][_this.parent.hasChildMapping] ||
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
result[r].
|
|
437
|
+
if ((result[parseInt(r.toString(), 10)]["" + _this.parent.hasChildMapping] ||
|
|
438
|
+
_this.parentItems.indexOf(result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping]) !== -1)
|
|
439
|
+
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
440
|
+
result[parseInt(r.toString(), 10)].hasChildRecords = true;
|
|
441
|
+
if (_this.parent.enableVirtualization && _this.parent.loadChildOnDemand) {
|
|
442
|
+
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
443
|
+
if (result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
444
|
+
result[parseInt(r.toString(), 10)].expanded = _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] !== rowDetails.record["" + _this.parent.idMapping] && result[parseInt(r.toString(), 10)].expanded !== false) {
|
|
448
|
+
result[parseInt(r.toString(), 10)].expanded = true;
|
|
449
|
+
}
|
|
450
|
+
else if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
|
|
451
|
+
result[parseInt(r.toString(), 10)].expanded = false;
|
|
452
|
+
_this.parent["" + remoteCollapsedData].push(rowDetails.record);
|
|
453
|
+
}
|
|
454
|
+
else if (rowDetails.action === 'remoteExpand') {
|
|
455
|
+
for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {
|
|
456
|
+
if (_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] === result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
457
|
+
result.splice(r, 1, _this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
if (result[parseInt(r.toString(), 10)][_this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
|
|
461
|
+
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
462
|
+
if (rowDetails.record["" + _this.parent.idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
463
|
+
_this.parent["" + remoteCollapsedData].splice(i, 1);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (result[parseInt(r.toString(), 10)].expanded !== false) {
|
|
468
|
+
result[parseInt(r.toString(), 10)].expanded = true;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
else if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action !== 'collapse') {
|
|
473
|
+
result[parseInt(r.toString(), 10)].expanded = true;
|
|
474
|
+
}
|
|
475
|
+
else if (!(_this.parent.enableVirtualization && _this.parent.loadChildOnDemand)) {
|
|
476
|
+
result[parseInt(r.toString(), 10)].expanded = false;
|
|
477
|
+
}
|
|
323
478
|
}
|
|
324
|
-
datas.splice(inx + r + 1, 0, result[r]);
|
|
479
|
+
datas.splice(inx + r + 1, 0, result[parseInt(r.toString(), 10)]);
|
|
325
480
|
}
|
|
326
481
|
setValue('result', datas, e);
|
|
327
482
|
setValue('action', 'beforecontentrender', e);
|
|
@@ -335,9 +490,12 @@ var DataManipulation = /** @class */ (function () {
|
|
|
335
490
|
}
|
|
336
491
|
if (!isNullOrUndefined(gridQuery)) {
|
|
337
492
|
var summaryQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onAggregates'; });
|
|
338
|
-
e[result_1] = _this.parent.summaryModule.calculateSummaryValue(summaryQuery, e[result_1], true);
|
|
493
|
+
e["" + result_1] = _this.parent.summaryModule.calculateSummaryValue(summaryQuery, e["" + result_1], true);
|
|
339
494
|
}
|
|
340
495
|
}
|
|
496
|
+
if (_this.parent.enableVirtualization) {
|
|
497
|
+
_this.parent.grid.pageSettings.totalRecordsCount = e.count;
|
|
498
|
+
}
|
|
341
499
|
e.count = _this.parent.grid.pageSettings.totalRecordsCount;
|
|
342
500
|
var virtualArgs = {};
|
|
343
501
|
if (_this.parent.enableVirtualization) {
|
|
@@ -365,13 +523,22 @@ var DataManipulation = /** @class */ (function () {
|
|
|
365
523
|
};
|
|
366
524
|
DataManipulation.prototype.beginSorting = function () {
|
|
367
525
|
this.isSortAction = true;
|
|
526
|
+
if (isRemoteData(this.parent) && this.parent.enableVirtualization) {
|
|
527
|
+
var index = this.parent.query.queries.indexOf(this.parent.query.queries.filter(function (q) { return q.fn === 'onSortBy'; })[0]);
|
|
528
|
+
if (index !== -1) {
|
|
529
|
+
this.parent.query.queries.splice(index, 1);
|
|
530
|
+
}
|
|
531
|
+
if (this.parent.grid.sortSettings.columns.length === 0) {
|
|
532
|
+
this.parent.query.sortBy(null, null);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
368
535
|
};
|
|
369
536
|
DataManipulation.prototype.createRecords = function (data, parentRecords) {
|
|
370
537
|
var treeGridData = [];
|
|
371
538
|
var keys = Object.keys(data);
|
|
372
539
|
for (var i = 0, len = keys.length; i < len; i++) {
|
|
373
|
-
var currentData = extend({}, data[i]);
|
|
374
|
-
currentData.taskData = data[i];
|
|
540
|
+
var currentData = extend({}, data[parseInt(i.toString(), 10)]);
|
|
541
|
+
currentData.taskData = data[parseInt(i.toString(), 10)];
|
|
375
542
|
var level = 0;
|
|
376
543
|
this.storedIndex++;
|
|
377
544
|
if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
|
|
@@ -412,7 +579,27 @@ var DataManipulation = /** @class */ (function () {
|
|
|
412
579
|
currentData.level = level;
|
|
413
580
|
}
|
|
414
581
|
currentData.checkboxState = 'uncheck';
|
|
415
|
-
|
|
582
|
+
var remoteCollapsedData = 'remoteCollapsedData';
|
|
583
|
+
if (this.parent.enableVirtualization && this.parent.loadChildOnDemand && isRemoteData(this.parent)
|
|
584
|
+
&& !this.parent.initialRender) {
|
|
585
|
+
if (!currentData.hasChildRecords && isNullOrUndefined(currentData["" + this.parent.parentIdMapping])) {
|
|
586
|
+
currentData.hasChildRecords = true;
|
|
587
|
+
for (var c = 0; c < this.parent["" + remoteCollapsedData].length; c++) {
|
|
588
|
+
if (this.parent["" + remoteCollapsedData][parseInt(c.toString(), 10)]["" + this.parent.idMapping] === currentData["" + this.parent.idMapping]) {
|
|
589
|
+
currentData.expanded = false;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else if (currentData.level === 0 && isNullOrUndefined(parentRecords) && !currentData.hasChildRecords) {
|
|
594
|
+
currentData.level = currentData.level + 1;
|
|
595
|
+
}
|
|
596
|
+
if (currentData["" + this.parent.hasChildMapping] && !isNullOrUndefined(currentData["" + this.parent.expandStateMapping])) {
|
|
597
|
+
currentData.expanded = currentData["" + this.parent.expandStateMapping];
|
|
598
|
+
currentData.hasChildRecords = true;
|
|
599
|
+
}
|
|
600
|
+
this.parent.flatData.push(currentData);
|
|
601
|
+
}
|
|
602
|
+
else if (isNullOrUndefined(currentData["" + this.parent.parentIdMapping]) || currentData.parentItem) {
|
|
416
603
|
this.parent.flatData.push(currentData);
|
|
417
604
|
this.parent['infiniteScrollData'].push(currentData);
|
|
418
605
|
}
|
|
@@ -448,9 +635,9 @@ var DataManipulation = /** @class */ (function () {
|
|
|
448
635
|
var primaryKeyColumnName = this.parent.getPrimaryKeyFieldNames()[0];
|
|
449
636
|
var dataValue = getObject('data', actionAddArgs);
|
|
450
637
|
if ((!isNullOrUndefined(actionAddArgs)) && (!isNullOrUndefined(actionAddArgs.action)) && (actionAddArgs.action === 'add')
|
|
451
|
-
&& (!isNullOrUndefined(actionAddArgs.data)) && isNullOrUndefined(actionAddArgs.data[primaryKeyColumnName])) {
|
|
452
|
-
actionAddArgs.data[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];
|
|
453
|
-
dataValue.taskData[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];
|
|
638
|
+
&& (!isNullOrUndefined(actionAddArgs.data)) && isNullOrUndefined(actionAddArgs.data["" + primaryKeyColumnName])) {
|
|
639
|
+
actionAddArgs.data["" + primaryKeyColumnName] = args.result[actionAddArgs.index]["" + primaryKeyColumnName];
|
|
640
|
+
dataValue.taskData["" + primaryKeyColumnName] = args.result[actionAddArgs.index]["" + primaryKeyColumnName];
|
|
454
641
|
}
|
|
455
642
|
if ((!isNullOrUndefined(actionArgs) && Object.keys(actionArgs).length) || requestType === 'save') {
|
|
456
643
|
requestType = requestType ? requestType : actionArgs.requestType;
|
|
@@ -523,12 +710,12 @@ var DataManipulation = /** @class */ (function () {
|
|
|
523
710
|
var srtQry = new Query();
|
|
524
711
|
for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
|
|
525
712
|
var getColumnByField = 'getColumnByField';
|
|
526
|
-
var col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.
|
|
527
|
-
sortSettings.columns[srt].field);
|
|
713
|
+
var col = this.parent.grid.renderModule.data["" + getColumnByField](this.parent.grid.
|
|
714
|
+
sortSettings.columns[parseInt(srt.toString(), 10)].field);
|
|
528
715
|
var compFun = col.sortComparer && isOffline(this.parent) ?
|
|
529
716
|
col.sortComparer.bind(col) :
|
|
530
|
-
this.parent.grid.sortSettings.columns[srt].direction;
|
|
531
|
-
srtQry.sortBy(this.parent.grid.sortSettings.columns[srt].field, compFun);
|
|
717
|
+
this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].direction;
|
|
718
|
+
srtQry.sortBy(this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].field, compFun);
|
|
532
719
|
}
|
|
533
720
|
var modifiedData = new DataManager(parentData).executeLocal(srtQry);
|
|
534
721
|
if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
|
|
@@ -582,13 +769,13 @@ var DataManipulation = /** @class */ (function () {
|
|
|
582
769
|
}
|
|
583
770
|
var isPdfExport = 'isPdfExport';
|
|
584
771
|
var isCollapsedStatePersist = 'isCollapsedStatePersist';
|
|
585
|
-
if ((isPrinting === true || (args[isPdfExport] && (isNullOrUndefined(args[isCollapsedStatePersist])
|
|
586
|
-
|| args[isCollapsedStatePersist]))) && this.parent.printMode === 'AllPages') {
|
|
772
|
+
if ((isPrinting === true || (args["" + isPdfExport] && (isNullOrUndefined(args["" + isCollapsedStatePersist])
|
|
773
|
+
|| args["" + isCollapsedStatePersist]))) && this.parent.printMode === 'AllPages') {
|
|
587
774
|
var actualResults = [];
|
|
588
775
|
for (var i = 0; i < results.length; i++) {
|
|
589
|
-
var expandStatus = getExpandStatus(this.parent, results[i], this.parent.parentData);
|
|
776
|
+
var expandStatus = getExpandStatus(this.parent, results[parseInt(i.toString(), 10)], this.parent.parentData);
|
|
590
777
|
if (expandStatus) {
|
|
591
|
-
actualResults.push(results[i]);
|
|
778
|
+
actualResults.push(results[parseInt(i.toString(), 10)]);
|
|
592
779
|
}
|
|
593
780
|
}
|
|
594
781
|
results = actualResults;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend, merge} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs, Row } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import {RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { ActionEventArgs, TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';
|
|
1
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend, merge} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs, Row } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import { RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { LoadingIndicator } from '../models/loading-indicator';import { LoadingIndicatorModel } from '../models/loading-indicator-model';import { ActionEventArgs, TextAlign } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -469,6 +469,22 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
469
469
|
*/
|
|
470
470
|
width?: string | number;
|
|
471
471
|
|
|
472
|
+
/**
|
|
473
|
+
* Configures the loading indicator of the Tree Grid. Specifies whether to display spinner or shimmer effect
|
|
474
|
+
* during the waiting time on any actions (paging, sorting, filtering, CRUD operations) performed in Tree Grid.
|
|
475
|
+
*
|
|
476
|
+
* @default {indicatorType: 'Spinner'}
|
|
477
|
+
*/
|
|
478
|
+
loadingIndicator?: LoadingIndicatorModel;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Specifies whether to display shimmer effect during scrolling action in virtual scrolling feature.
|
|
482
|
+
* If disabled, spinner is shown instead of shimmer effect.
|
|
483
|
+
*
|
|
484
|
+
* @default true
|
|
485
|
+
*/
|
|
486
|
+
enableVirtualMaskRow?: boolean;
|
|
487
|
+
|
|
472
488
|
/**
|
|
473
489
|
* If `enableVirtualization` set to true, then the TreeGrid will render only the rows visible within the view-port
|
|
474
490
|
* and load subsequent rows on vertical scrolling. This helps to load large dataset in TreeGrid.
|
|
@@ -545,14 +561,14 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
545
561
|
*
|
|
546
562
|
* @event collapsing
|
|
547
563
|
*/
|
|
548
|
-
collapsing?: EmitType<
|
|
564
|
+
collapsing?: EmitType<RowCollapsingEventArgs>;
|
|
549
565
|
|
|
550
566
|
/**
|
|
551
567
|
* Triggers after the record is collapsed.
|
|
552
568
|
*
|
|
553
569
|
* @event collapsed
|
|
554
570
|
*/
|
|
555
|
-
collapsed?: EmitType<
|
|
571
|
+
collapsed?: EmitType<RowCollapsedEventArgs>;
|
|
556
572
|
|
|
557
573
|
/**
|
|
558
574
|
* Triggers when cell is saved.
|
|
@@ -579,7 +595,7 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
579
595
|
* @event actionComplete
|
|
580
596
|
*/
|
|
581
597
|
|
|
582
|
-
actionComplete?: EmitType<PageEventArgs | FilterEventArgs | SortEventArgs| SearchEventArgs | AddEventArgs | SaveEventArgs | EditEventArgs | DeleteEventArgs
|
|
598
|
+
actionComplete?: EmitType<PageEventArgs | FilterEventArgs | SortEventArgs| SearchEventArgs | AddEventArgs | SaveEventArgs | EditEventArgs | DeleteEventArgs>;
|
|
583
599
|
|
|
584
600
|
/**
|
|
585
601
|
* Triggers before the record is to be edit.
|
|
@@ -5,6 +5,7 @@ import { Column, ColumnModel } from '../models/column';
|
|
|
5
5
|
import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs } from '@syncfusion/ej2-grids';
|
|
6
6
|
import { ColumnQueryModeType, HeaderCellInfoEventArgs } from '@syncfusion/ej2-grids';
|
|
7
7
|
import { RowDragEventArgs, RowDropSettingsModel } from '@syncfusion/ej2-grids';
|
|
8
|
+
import { LoadingIndicatorModel } from '../models/loading-indicator-model';
|
|
8
9
|
import { DetailDataBoundEventArgs, ClipMode, ColumnChooser } from '@syncfusion/ej2-grids';
|
|
9
10
|
import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs } from '@syncfusion/ej2-grids';
|
|
10
11
|
import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs } from '@syncfusion/ej2-grids';
|
|
@@ -41,8 +42,8 @@ import { Render } from '../renderer/render';
|
|
|
41
42
|
import { DataManipulation } from './data';
|
|
42
43
|
import { RowDD } from '../actions/rowdragdrop';
|
|
43
44
|
import { Sort } from '../actions/sort';
|
|
44
|
-
import { ITreeData, RowExpandedEventArgs, TreeGridExcelExportProperties } from './interface';
|
|
45
|
-
import {
|
|
45
|
+
import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';
|
|
46
|
+
import { DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';
|
|
46
47
|
import { GridLine } from '@syncfusion/ej2-grids';
|
|
47
48
|
import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';
|
|
48
49
|
import { ToolbarItems, ToolbarItem, ContextMenuItem, RowPosition, CopyHierarchyType } from '../enum';
|
|
@@ -112,6 +113,10 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
112
113
|
/** @hidden */
|
|
113
114
|
private infiniteScrollData;
|
|
114
115
|
/** @hidden */
|
|
116
|
+
private remoteCollapsedData;
|
|
117
|
+
/** @hidden */
|
|
118
|
+
private remoteExpandedData;
|
|
119
|
+
/** @hidden */
|
|
115
120
|
isLocalData: boolean;
|
|
116
121
|
/** @hidden */
|
|
117
122
|
parentData: Object[];
|
|
@@ -586,6 +591,20 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
586
591
|
* @default 'auto'
|
|
587
592
|
*/
|
|
588
593
|
width: string | number;
|
|
594
|
+
/**
|
|
595
|
+
* Configures the loading indicator of the Tree Grid. Specifies whether to display spinner or shimmer effect
|
|
596
|
+
* during the waiting time on any actions (paging, sorting, filtering, CRUD operations) performed in Tree Grid.
|
|
597
|
+
*
|
|
598
|
+
* @default {indicatorType: 'Spinner'}
|
|
599
|
+
*/
|
|
600
|
+
loadingIndicator: LoadingIndicatorModel;
|
|
601
|
+
/**
|
|
602
|
+
* Specifies whether to display shimmer effect during scrolling action in virtual scrolling feature.
|
|
603
|
+
* If disabled, spinner is shown instead of shimmer effect.
|
|
604
|
+
*
|
|
605
|
+
* @default true
|
|
606
|
+
*/
|
|
607
|
+
enableVirtualMaskRow: boolean;
|
|
589
608
|
/**
|
|
590
609
|
* If `enableVirtualization` set to true, then the TreeGrid will render only the rows visible within the view-port
|
|
591
610
|
* and load subsequent rows on vertical scrolling. This helps to load large dataset in TreeGrid.
|
|
@@ -653,13 +672,13 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
653
672
|
*
|
|
654
673
|
* @event collapsing
|
|
655
674
|
*/
|
|
656
|
-
collapsing: EmitType<
|
|
675
|
+
collapsing: EmitType<RowCollapsingEventArgs>;
|
|
657
676
|
/**
|
|
658
677
|
* Triggers after the record is collapsed.
|
|
659
678
|
*
|
|
660
679
|
* @event collapsed
|
|
661
680
|
*/
|
|
662
|
-
collapsed: EmitType<
|
|
681
|
+
collapsed: EmitType<RowCollapsedEventArgs>;
|
|
663
682
|
/**
|
|
664
683
|
* Triggers when cell is saved.
|
|
665
684
|
*
|
|
@@ -681,7 +700,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
681
700
|
* Triggers when TreeGrid actions such as sorting, filtering, paging etc. are completed.
|
|
682
701
|
* @event actionComplete
|
|
683
702
|
*/
|
|
684
|
-
actionComplete: EmitType<PageEventArgs | FilterEventArgs | SortEventArgs | SearchEventArgs | AddEventArgs | SaveEventArgs | EditEventArgs | DeleteEventArgs
|
|
703
|
+
actionComplete: EmitType<PageEventArgs | FilterEventArgs | SortEventArgs | SearchEventArgs | AddEventArgs | SaveEventArgs | EditEventArgs | DeleteEventArgs>;
|
|
685
704
|
/**
|
|
686
705
|
* Triggers before the record is to be edit.
|
|
687
706
|
* @event beginEdit
|