@syncfusion/ej2-treegrid 34.2.8 → 35.1.37
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/README.md +16 -2
- 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 +1028 -588
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1120 -608
- 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 +5 -5
- package/src/global.js +1 -1
- package/src/treegrid/actions/crud-actions.js +4 -9
- package/src/treegrid/actions/dom-virtualization.d.ts +66 -0
- package/src/treegrid/actions/dom-virtualization.js +240 -0
- package/src/treegrid/actions/edit.d.ts +1 -4
- package/src/treegrid/actions/edit.js +23 -191
- package/src/treegrid/actions/filter.js +1 -1
- package/src/treegrid/actions/index.d.ts +1 -0
- package/src/treegrid/actions/index.js +1 -0
- package/src/treegrid/actions/page.js +12 -6
- package/src/treegrid/actions/rowdragdrop.js +20 -1
- package/src/treegrid/actions/selection.d.ts +21 -0
- package/src/treegrid/actions/selection.js +197 -31
- package/src/treegrid/actions/toolbar.js +8 -5
- package/src/treegrid/base/constant.d.ts +4 -0
- package/src/treegrid/base/constant.js +4 -0
- package/src/treegrid/base/data.d.ts +17 -0
- package/src/treegrid/base/data.js +189 -132
- package/src/treegrid/base/treegrid-model.d.ts +35 -4
- package/src/treegrid/base/treegrid.d.ts +43 -7
- package/src/treegrid/base/treegrid.js +181 -73
- package/src/treegrid/enum.d.ts +12 -0
- package/src/treegrid/models/column.d.ts +2 -2
- package/src/treegrid/models/dom-virtualization-settings-model.d.ts +50 -0
- package/src/treegrid/models/dom-virtualization-settings.d.ts +43 -0
- package/src/treegrid/models/dom-virtualization-settings.js +47 -0
- package/src/treegrid/models/index.d.ts +2 -0
- package/src/treegrid/models/index.js +1 -0
- package/src/treegrid/models/summary-model.d.ts +1 -1
- package/src/treegrid/models/summary.d.ts +1 -1
- package/src/treegrid/renderer/dom-virtual-tree-content-renderer.d.ts +20 -0
- package/src/treegrid/renderer/dom-virtual-tree-content-renderer.js +49 -0
- package/src/treegrid/renderer/index.d.ts +1 -0
- package/src/treegrid/renderer/index.js +1 -0
- package/src/treegrid/renderer/render.js +4 -3
- package/src/treegrid/renderer/virtual-tree-content-render.js +1 -2
- package/helpers/e2e/index.d.ts +0 -1
- package/helpers/e2e/index.js +0 -8
- package/helpers/e2e/treegridhelper.d.ts +0 -21
- package/helpers/e2e/treegridhelper.js +0 -83
- package/styles/bds-lite.css +0 -402
- package/styles/bds-lite.scss +0 -3
- package/styles/bds.css +0 -422
- package/styles/bds.scss +0 -4
- package/styles/bootstrap-dark-lite.css +0 -406
- package/styles/bootstrap-dark-lite.scss +0 -3
- package/styles/bootstrap-dark.css +0 -426
- package/styles/bootstrap-dark.scss +0 -4
- package/styles/bootstrap-lite.css +0 -409
- package/styles/bootstrap-lite.scss +0 -3
- package/styles/bootstrap.css +0 -432
- package/styles/bootstrap.scss +0 -4
- package/styles/bootstrap4-lite.css +0 -406
- package/styles/bootstrap4-lite.scss +0 -3
- package/styles/bootstrap4.css +0 -426
- package/styles/bootstrap4.scss +0 -4
- package/styles/bootstrap5-dark-lite.css +0 -406
- package/styles/bootstrap5-dark-lite.scss +0 -3
- package/styles/bootstrap5-dark.css +0 -426
- package/styles/bootstrap5-dark.scss +0 -4
- package/styles/bootstrap5-lite.css +0 -406
- package/styles/bootstrap5-lite.scss +0 -3
- package/styles/bootstrap5.3-lite.css +0 -490
- package/styles/bootstrap5.3-lite.scss +0 -3
- package/styles/bootstrap5.3.css +0 -510
- package/styles/bootstrap5.3.scss +0 -4
- package/styles/bootstrap5.css +0 -426
- package/styles/bootstrap5.scss +0 -4
- package/styles/fabric-dark-lite.css +0 -409
- package/styles/fabric-dark-lite.scss +0 -3
- package/styles/fabric-dark.css +0 -432
- package/styles/fabric-dark.scss +0 -4
- package/styles/fabric-lite.css +0 -409
- package/styles/fabric-lite.scss +0 -3
- package/styles/fabric.css +0 -432
- package/styles/fabric.scss +0 -4
- package/styles/fluent-dark-lite.css +0 -417
- package/styles/fluent-dark-lite.scss +0 -3
- package/styles/fluent-dark.css +0 -444
- package/styles/fluent-dark.scss +0 -4
- package/styles/fluent-lite.css +0 -417
- package/styles/fluent-lite.scss +0 -3
- package/styles/fluent.css +0 -444
- package/styles/fluent.scss +0 -4
- package/styles/fluent2-lite.css +0 -507
- package/styles/fluent2-lite.scss +0 -3
- package/styles/fluent2.css +0 -531
- package/styles/fluent2.scss +0 -4
- package/styles/highcontrast-light-lite.css +0 -406
- package/styles/highcontrast-light-lite.scss +0 -3
- package/styles/highcontrast-light.css +0 -426
- package/styles/highcontrast-light.scss +0 -4
- package/styles/highcontrast-lite.css +0 -413
- package/styles/highcontrast-lite.scss +0 -3
- package/styles/highcontrast.css +0 -439
- package/styles/highcontrast.scss +0 -4
- package/styles/material-dark-lite.css +0 -406
- package/styles/material-dark-lite.scss +0 -3
- package/styles/material-dark.css +0 -426
- package/styles/material-dark.scss +0 -4
- package/styles/material-lite.css +0 -406
- package/styles/material-lite.scss +0 -3
- package/styles/material.css +0 -426
- package/styles/material.scss +0 -4
- package/styles/material3-dark-lite.css +0 -488
- package/styles/material3-dark-lite.scss +0 -3
- package/styles/material3-dark.css +0 -508
- package/styles/material3-dark.scss +0 -4
- package/styles/material3-lite.css +0 -490
- package/styles/material3-lite.scss +0 -3
- package/styles/material3.css +0 -510
- package/styles/material3.scss +0 -4
- package/styles/tailwind-dark-lite.css +0 -406
- package/styles/tailwind-dark-lite.scss +0 -3
- package/styles/tailwind-dark.css +0 -426
- package/styles/tailwind-dark.scss +0 -4
- package/styles/tailwind-lite.css +0 -406
- package/styles/tailwind-lite.scss +0 -3
- package/styles/tailwind.css +0 -426
- package/styles/tailwind.scss +0 -4
- package/styles/tailwind3-lite.css +0 -480
- package/styles/tailwind3-lite.scss +0 -3
- package/styles/tailwind3.css +0 -500
- package/styles/tailwind3.scss +0 -4
- package/styles/treegrid/_all.scss +0 -2
- package/styles/treegrid/_bds-definition.scss +0 -28
- package/styles/treegrid/_bigger.scss +0 -70
- package/styles/treegrid/_bootstrap-dark-definition.scss +0 -33
- package/styles/treegrid/_bootstrap-definition.scss +0 -33
- package/styles/treegrid/_bootstrap4-definition.scss +0 -33
- package/styles/treegrid/_bootstrap5-dark-definition.scss +0 -28
- package/styles/treegrid/_bootstrap5-definition.scss +0 -28
- package/styles/treegrid/_bootstrap5.3-definition.scss +0 -28
- package/styles/treegrid/_fabric-dark-definition.scss +0 -33
- package/styles/treegrid/_fabric-definition.scss +0 -33
- package/styles/treegrid/_fluent-dark-definition.scss +0 -29
- package/styles/treegrid/_fluent-definition.scss +0 -29
- package/styles/treegrid/_fluent2-definition.scss +0 -28
- package/styles/treegrid/_fusionnew-definition.scss +0 -26
- package/styles/treegrid/_highcontrast-definition.scss +0 -33
- package/styles/treegrid/_highcontrast-light-definition.scss +0 -33
- package/styles/treegrid/_icons.scss +0 -47
- package/styles/treegrid/_layout.scss +0 -531
- package/styles/treegrid/_material-dark-definition.scss +0 -33
- package/styles/treegrid/_material-definition.scss +0 -33
- package/styles/treegrid/_material3-dark-definition.scss +0 -28
- package/styles/treegrid/_material3-definition.scss +0 -28
- package/styles/treegrid/_tailwind-dark-definition.scss +0 -28
- package/styles/treegrid/_tailwind-definition.scss +0 -28
- package/styles/treegrid/_tailwind3-definition.scss +0 -28
- package/styles/treegrid/_theme.scss +0 -1
- package/styles/treegrid/_variables.scss +0 -2
- package/styles/treegrid/bds.css +0 -422
- package/styles/treegrid/bds.scss +0 -4
- package/styles/treegrid/bootstrap-dark.css +0 -426
- package/styles/treegrid/bootstrap-dark.scss +0 -4
- package/styles/treegrid/bootstrap.css +0 -432
- package/styles/treegrid/bootstrap.scss +0 -4
- package/styles/treegrid/bootstrap4.css +0 -426
- package/styles/treegrid/bootstrap4.scss +0 -4
- package/styles/treegrid/bootstrap5-dark.css +0 -426
- package/styles/treegrid/bootstrap5-dark.scss +0 -4
- package/styles/treegrid/bootstrap5.3.css +0 -510
- package/styles/treegrid/bootstrap5.3.scss +0 -4
- package/styles/treegrid/bootstrap5.css +0 -426
- package/styles/treegrid/bootstrap5.scss +0 -4
- package/styles/treegrid/fabric-dark.css +0 -432
- package/styles/treegrid/fabric-dark.scss +0 -4
- package/styles/treegrid/fabric.css +0 -432
- package/styles/treegrid/fabric.scss +0 -4
- package/styles/treegrid/fluent-dark.css +0 -444
- package/styles/treegrid/fluent-dark.scss +0 -4
- package/styles/treegrid/fluent.css +0 -444
- package/styles/treegrid/fluent.scss +0 -4
- package/styles/treegrid/fluent2.css +0 -531
- package/styles/treegrid/fluent2.scss +0 -4
- package/styles/treegrid/highcontrast-light.css +0 -426
- package/styles/treegrid/highcontrast-light.scss +0 -4
- package/styles/treegrid/highcontrast.css +0 -439
- package/styles/treegrid/highcontrast.scss +0 -4
- package/styles/treegrid/icons/_bds.scss +0 -38
- package/styles/treegrid/icons/_bootstrap-dark.scss +0 -48
- package/styles/treegrid/icons/_bootstrap.scss +0 -48
- package/styles/treegrid/icons/_bootstrap4.scss +0 -48
- package/styles/treegrid/icons/_bootstrap5-dark.scss +0 -1
- package/styles/treegrid/icons/_bootstrap5.3.scss +0 -48
- package/styles/treegrid/icons/_bootstrap5.scss +0 -48
- package/styles/treegrid/icons/_fabric-dark.scss +0 -48
- package/styles/treegrid/icons/_fabric.scss +0 -48
- package/styles/treegrid/icons/_fluent-dark.scss +0 -1
- package/styles/treegrid/icons/_fluent.scss +0 -48
- package/styles/treegrid/icons/_fluent2.scss +0 -48
- package/styles/treegrid/icons/_fusionnew.scss +0 -31
- package/styles/treegrid/icons/_highcontrast-light.scss +0 -48
- package/styles/treegrid/icons/_highcontrast.scss +0 -48
- package/styles/treegrid/icons/_material-dark.scss +0 -48
- package/styles/treegrid/icons/_material.scss +0 -48
- package/styles/treegrid/icons/_material3-dark.scss +0 -1
- package/styles/treegrid/icons/_material3.scss +0 -48
- package/styles/treegrid/icons/_tailwind-dark.scss +0 -48
- package/styles/treegrid/icons/_tailwind.scss +0 -48
- package/styles/treegrid/icons/_tailwind3.scss +0 -48
- package/styles/treegrid/material-dark.css +0 -426
- package/styles/treegrid/material-dark.scss +0 -4
- package/styles/treegrid/material.css +0 -426
- package/styles/treegrid/material.scss +0 -4
- package/styles/treegrid/material3-dark.css +0 -508
- package/styles/treegrid/material3-dark.scss +0 -4
- package/styles/treegrid/material3.css +0 -510
- package/styles/treegrid/material3.scss +0 -4
- package/styles/treegrid/tailwind-dark.css +0 -426
- package/styles/treegrid/tailwind-dark.scss +0 -4
- package/styles/treegrid/tailwind.css +0 -426
- package/styles/treegrid/tailwind.scss +0 -4
- package/styles/treegrid/tailwind3.css +0 -500
- package/styles/treegrid/tailwind3.scss +0 -4
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import { extend, isNullOrUndefined, setValue, getValue, addClass, removeClass } from '@syncfusion/ej2-base';
|
|
2
13
|
import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';
|
|
3
14
|
import { showSpinner, hideSpinner } from '@syncfusion/ej2-popups';
|
|
@@ -22,6 +33,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
22
33
|
this.addEventListener();
|
|
23
34
|
this.dataResults = {};
|
|
24
35
|
this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);
|
|
36
|
+
this.enableCollapseAll = this.parent.enableCollapseAll;
|
|
37
|
+
this.uniqueIDCollection = this.parent.uniqueIDCollection;
|
|
25
38
|
}
|
|
26
39
|
/**
|
|
27
40
|
* @hidden
|
|
@@ -131,17 +144,19 @@ var DataManipulation = /** @class */ (function () {
|
|
|
131
144
|
this.hierarchyData = data;
|
|
132
145
|
}
|
|
133
146
|
else {
|
|
147
|
+
var idMapping = this.parent.idMapping;
|
|
134
148
|
var keys = Object.keys(data);
|
|
135
149
|
for (var i = 0; i < keys.length; i++) {
|
|
136
150
|
var tempData = data[parseInt(i.toString(), 10)];
|
|
137
151
|
this.hierarchyData.push(extend({}, tempData));
|
|
138
|
-
if (!isNullOrUndefined(tempData[
|
|
139
|
-
this.taskIds.push(tempData[
|
|
152
|
+
if (!isNullOrUndefined(tempData["" + idMapping])) {
|
|
153
|
+
this.taskIds.push(tempData["" + idMapping]);
|
|
140
154
|
}
|
|
141
155
|
}
|
|
142
156
|
}
|
|
143
157
|
if (this.isSelfReference) {
|
|
144
158
|
var selfData = [];
|
|
159
|
+
var childMapping = this.parent.childMapping;
|
|
145
160
|
var mappingData = new DataManager(this.hierarchyData).executeLocal(new Query()
|
|
146
161
|
.group(this.parent.parentIdMapping));
|
|
147
162
|
for (var i = 0; i < mappingData.length; i++) {
|
|
@@ -150,7 +165,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
150
165
|
if (!isNullOrUndefined(groupData.key)) {
|
|
151
166
|
if (index > -1) {
|
|
152
167
|
var childData = (groupData.items);
|
|
153
|
-
this.hierarchyData[parseInt(index.toString(), 10)][
|
|
168
|
+
this.hierarchyData[parseInt(index.toString(), 10)]["" + childMapping] = childData;
|
|
154
169
|
continue;
|
|
155
170
|
}
|
|
156
171
|
}
|
|
@@ -197,7 +212,6 @@ var DataManipulation = /** @class */ (function () {
|
|
|
197
212
|
* @returns {void}
|
|
198
213
|
*/
|
|
199
214
|
DataManipulation.prototype.updateParentRemoteData = function (args) {
|
|
200
|
-
var _this = this;
|
|
201
215
|
var actionArgs = 'actionArgs';
|
|
202
216
|
if (isRemoteData(this.parent) && this.parent.enableVirtualization && args["" + actionArgs].requestType === 'virtualscroll') {
|
|
203
217
|
this.parent.hideSpinner();
|
|
@@ -213,16 +227,20 @@ var DataManipulation = /** @class */ (function () {
|
|
|
213
227
|
}
|
|
214
228
|
else {
|
|
215
229
|
if (this.parent.loadChildOnDemand) {
|
|
230
|
+
var isRemote = isRemoteData(this.parent);
|
|
231
|
+
var enableVirtualization = this.parent.enableVirtualization;
|
|
232
|
+
var getUidval = getUid(this.parent.element.id + '_data_');
|
|
233
|
+
var parentIdMapping_1 = this.parent.parentIdMapping;
|
|
234
|
+
var idMapping_1 = this.parent.idMapping;
|
|
216
235
|
var _loop_1 = function (rec) {
|
|
217
236
|
if (isCountRequired(this_1.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&
|
|
218
237
|
this_1.parent.initialRender) {
|
|
219
238
|
records[parseInt(rec.toString(), 10)].expanded = false;
|
|
220
239
|
}
|
|
221
|
-
if (
|
|
240
|
+
if (isRemote && enableVirtualization) {
|
|
222
241
|
var childRecords_1 = [];
|
|
223
|
-
var parent_1 = this_1.parent;
|
|
224
242
|
records.filter(function (e) {
|
|
225
|
-
if (e["" +
|
|
243
|
+
if (e["" + parentIdMapping_1] === records[parseInt(rec.toString(), 10)]["" + idMapping_1]) {
|
|
226
244
|
childRecords_1.push(e);
|
|
227
245
|
}
|
|
228
246
|
});
|
|
@@ -235,17 +253,17 @@ var DataManipulation = /** @class */ (function () {
|
|
|
235
253
|
}
|
|
236
254
|
if (isNullOrUndefined(records[parseInt(rec.toString(), 10)].index)) {
|
|
237
255
|
records[parseInt(rec.toString(), 10)].taskData = extend({}, records[parseInt(rec.toString(), 10)]);
|
|
238
|
-
records[parseInt(rec.toString(), 10)].uniqueID =
|
|
256
|
+
records[parseInt(rec.toString(), 10)].uniqueID = getUidval;
|
|
239
257
|
setValue('uniqueIDCollection.' + records[parseInt(rec.toString(), 10)].uniqueID, records[parseInt(rec.toString(), 10)], this_1.parent);
|
|
240
|
-
if (
|
|
241
|
-
var parentID_1 = records[parseInt(rec.toString(), 10)]["" +
|
|
242
|
-
var parentRec = records.find(function (record) { return record["" +
|
|
258
|
+
if (isRemote && enableVirtualization && records[parseInt(rec.toString(), 10)]["" + parentIdMapping_1] && (isNullOrUndefined(records[parseInt(rec.toString(), 10)].level) || records[parseInt(rec.toString(), 10)].level === 0)) {
|
|
259
|
+
var parentID_1 = records[parseInt(rec.toString(), 10)]["" + parentIdMapping_1];
|
|
260
|
+
var parentRec = records.find(function (record) { return record["" + idMapping_1] === parentID_1; });
|
|
243
261
|
if (parentRec) {
|
|
244
262
|
records[parseInt(rec.toString(), 10)].level = parentRec.level + 1;
|
|
245
263
|
}
|
|
246
264
|
else {
|
|
247
|
-
var parentRec_1 = args.actual.flatData.find(function (record) { return record["" +
|
|
248
|
-
if (isNullOrUndefined(parentRec_1["" +
|
|
265
|
+
var parentRec_1 = args.actual.flatData.find(function (record) { return record["" + idMapping_1] === parentID_1; });
|
|
266
|
+
if (isNullOrUndefined(parentRec_1["" + parentIdMapping_1])) {
|
|
249
267
|
records[parseInt(rec.toString(), 10)].level = 1;
|
|
250
268
|
}
|
|
251
269
|
else {
|
|
@@ -258,7 +276,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
258
276
|
}
|
|
259
277
|
records[parseInt(rec.toString(), 10)].index = Math.ceil(Math.random() * 1000);
|
|
260
278
|
if ((records[parseInt(rec.toString(), 10)][this_1.parent.hasChildMapping] ||
|
|
261
|
-
this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)][
|
|
279
|
+
this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)]["" + idMapping_1]) !== -1)) {
|
|
262
280
|
records[parseInt(rec.toString(), 10)].hasChildRecords = true;
|
|
263
281
|
}
|
|
264
282
|
records[parseInt(rec.toString(), 10)].checkboxState = 'uncheck';
|
|
@@ -315,35 +333,44 @@ var DataManipulation = /** @class */ (function () {
|
|
|
315
333
|
gridRows = [].slice.call(rows);
|
|
316
334
|
}
|
|
317
335
|
var childRecord;
|
|
318
|
-
if (rowDetails.rows.length > 0
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
336
|
+
if (rowDetails.rows.length > 0 || (this.parent.enableDomVirtualization &&
|
|
337
|
+
this.parent.uniqueIDCollpaseCollection[rowDetails.record.uniqueID])) {
|
|
338
|
+
if (this.parent.enableDomVirtualization) {
|
|
339
|
+
this.parent.notify(events.virtualExpandCollapse, { action: 'expand', row: rowDetails.parentRow, record: rowDetails.record });
|
|
340
|
+
this.parent.notify(events.localPagedExpandCollapse, { action: 'expand', row: rowDetails.parentRow, record: rowDetails.record });
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
if (!isChild) {
|
|
344
|
+
rowDetails.record.expanded = true;
|
|
345
|
+
}
|
|
346
|
+
var rowTemplate = this.parent.rowTemplate;
|
|
347
|
+
var loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
348
|
+
for (var i = 0; i < rowDetails.rows.length; i++) {
|
|
349
|
+
this.parent['toggleRowVisibility'](rowDetails.rows[parseInt(i.toString(), 10)], 'e-childrow-visible');
|
|
350
|
+
if (!loadChildOnDemand) {
|
|
351
|
+
var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];
|
|
352
|
+
childRecord = rowTemplate ?
|
|
353
|
+
this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :
|
|
354
|
+
this.parent.grid.getRowObjectFromUID(rowDetails.rows[parseInt(i.toString(), 10)].getAttribute('data-uid')).data;
|
|
355
|
+
if (!isNullOrUndefined(targetEle) && childRecord.expanded) {
|
|
356
|
+
addClass([targetEle], 'e-treegridexpand');
|
|
357
|
+
removeClass([targetEle], 'e-treegridcollapse');
|
|
358
|
+
}
|
|
359
|
+
var childRows = [];
|
|
360
|
+
childRows = gridRows.filter(function (r) {
|
|
361
|
+
return r.querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1));
|
|
362
|
+
});
|
|
363
|
+
if (childRows.length && childRecord.expanded) {
|
|
364
|
+
this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);
|
|
365
|
+
}
|
|
332
366
|
}
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
});
|
|
337
|
-
if (childRows.length && childRecord.expanded) {
|
|
338
|
-
this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);
|
|
367
|
+
var expandingTd = rowDetails.rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowcollapse');
|
|
368
|
+
if (!isNullOrUndefined(expandingTd)) {
|
|
369
|
+
this.parent.grid.detailRowModule.expand(expandingTd);
|
|
339
370
|
}
|
|
340
371
|
}
|
|
341
|
-
|
|
342
|
-
if (!isNullOrUndefined(expandingTd)) {
|
|
343
|
-
this.parent.grid.detailRowModule.expand(expandingTd);
|
|
344
|
-
}
|
|
372
|
+
this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
|
|
345
373
|
}
|
|
346
|
-
this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
|
|
347
374
|
}
|
|
348
375
|
else {
|
|
349
376
|
this.fetchRemoteChildData({ action: rowDetails["" + name], record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
|
|
@@ -383,12 +410,14 @@ var DataManipulation = /** @class */ (function () {
|
|
|
383
410
|
var remoteExpandedData = 'remoteExpandedData';
|
|
384
411
|
var remoteCollapsedData = 'remoteCollapsedData';
|
|
385
412
|
var level = 'level';
|
|
386
|
-
var
|
|
413
|
+
var currentViewData = _this.parent.grid.currentViewData;
|
|
414
|
+
var datas = currentViewData.slice();
|
|
387
415
|
var inx;
|
|
388
416
|
var idMapping = _this.parent.idMapping;
|
|
417
|
+
var parentIdMapping = _this.parent.parentIdMapping;
|
|
389
418
|
if (_this.parent['isGantt'] && _this.parent.loadChildOnDemand && _this.parent.hasChildMapping) {
|
|
390
|
-
for (var i = 0; i <
|
|
391
|
-
if (rowDetails.record[idMapping] ===
|
|
419
|
+
for (var i = 0; i < currentViewData.length; i++) {
|
|
420
|
+
if (rowDetails.record[idMapping] === currentViewData[i][idMapping]) {
|
|
392
421
|
inx = i;
|
|
393
422
|
break;
|
|
394
423
|
}
|
|
@@ -400,7 +429,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
400
429
|
if (_this.parent.enableVirtualization && (rowDetails.action === 'collapse' || rowDetails.action === 'remoteExpand')) {
|
|
401
430
|
datas = [];
|
|
402
431
|
for (var i = 0; i < inx; i++) {
|
|
403
|
-
datas.push(
|
|
432
|
+
datas.push(currentViewData[parseInt(i.toString(), 10)]);
|
|
404
433
|
}
|
|
405
434
|
}
|
|
406
435
|
if (inx === -1) {
|
|
@@ -415,14 +444,14 @@ var DataManipulation = /** @class */ (function () {
|
|
|
415
444
|
var resultChildData = [];
|
|
416
445
|
if (rowDetails.action === 'remoteExpand' && _this.parent.grid.filterModule && _this.parent.grid.filterModule['value']) {
|
|
417
446
|
for (var i = 0; i < datas.length; i++) {
|
|
418
|
-
if (Object.prototype.hasOwnProperty.call(datas[parseInt(i.toString(), 10)],
|
|
447
|
+
if (Object.prototype.hasOwnProperty.call(datas[parseInt(i.toString(), 10)], parentIdMapping) && datas[parseInt(i.toString(), 10)]['' + parentIdMapping] !== null && datas[parseInt(i.toString(), 10)].level === 0) {
|
|
419
448
|
datas.splice(i, 1);
|
|
420
449
|
i--;
|
|
421
450
|
}
|
|
422
451
|
}
|
|
423
452
|
for (var i = 0; i < result.length; i++) {
|
|
424
|
-
if (rowDetails.record['' +
|
|
425
|
-
rowDetails.record['' +
|
|
453
|
+
if (rowDetails.record['' + idMapping] !== result[parseInt(i.toString(), 10)]['' + idMapping] &&
|
|
454
|
+
rowDetails.record['' + idMapping] === result[parseInt(i.toString(), 10)]['' + parentIdMapping]) {
|
|
426
455
|
if (Object.prototype.hasOwnProperty.call(result, i)) {
|
|
427
456
|
resultChildData.push(result[parseInt(i.toString(), 10)]);
|
|
428
457
|
}
|
|
@@ -433,8 +462,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
433
462
|
if (_this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
|
|
434
463
|
rowDetails.record.childRecords = [];
|
|
435
464
|
for (var i = 0; i < result.length; i++) {
|
|
436
|
-
if (rowDetails.record['' +
|
|
437
|
-
rowDetails.record['' +
|
|
465
|
+
if (rowDetails.record['' + idMapping] !== result[parseInt(i.toString(), 10)]['' + idMapping] &&
|
|
466
|
+
rowDetails.record['' + idMapping] === result[parseInt(i.toString(), 10)]['' + parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
|
|
438
467
|
rowDetails.record.childRecords.push(result[parseInt(i.toString(), 10)]);
|
|
439
468
|
}
|
|
440
469
|
}
|
|
@@ -444,20 +473,20 @@ var DataManipulation = /** @class */ (function () {
|
|
|
444
473
|
}
|
|
445
474
|
var _loop_2 = function (r) {
|
|
446
475
|
var record = result[parseInt(r.toString(), 10)];
|
|
447
|
-
if (_this.parent.enableVirtualization && record["" +
|
|
476
|
+
if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action === 'remoteExpand') {
|
|
448
477
|
_this.parent["" + remoteExpandedData].push(rowDetails.record);
|
|
449
478
|
}
|
|
450
|
-
else if (_this.parent.enableVirtualization && record["" +
|
|
479
|
+
else if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action === 'collapse') {
|
|
451
480
|
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
452
|
-
if (rowDetails.record["" +
|
|
481
|
+
if (rowDetails.record["" + idMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + idMapping]) {
|
|
453
482
|
_this.parent["" + remoteExpandedData].splice(i, 1);
|
|
454
483
|
}
|
|
455
484
|
}
|
|
456
485
|
}
|
|
457
486
|
record.taskData = extend({}, record);
|
|
458
|
-
if (record["" +
|
|
487
|
+
if (record["" + parentIdMapping] && _this.parent.enableVirtualization && _this.parent["" + remoteExpandedData].length) {
|
|
459
488
|
for (var i = 0; i < _this.parent["" + remoteExpandedData].length; i++) {
|
|
460
|
-
if (record["" +
|
|
489
|
+
if (record["" + parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + idMapping]) {
|
|
461
490
|
record.level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
|
|
462
491
|
var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
|
|
463
492
|
delete parentData.childRecords;
|
|
@@ -468,9 +497,9 @@ var DataManipulation = /** @class */ (function () {
|
|
|
468
497
|
}
|
|
469
498
|
else if (_this.parent.enableVirtualization) {
|
|
470
499
|
if ((record["" + _this.parent.hasChildMapping] ||
|
|
471
|
-
_this.parentItems.indexOf(record["" +
|
|
500
|
+
_this.parentItems.indexOf(record["" + idMapping]) !== -1)
|
|
472
501
|
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
473
|
-
if (isNullOrUndefined(record["" +
|
|
502
|
+
if (isNullOrUndefined(record["" + parentIdMapping])) {
|
|
474
503
|
record.level = 0;
|
|
475
504
|
if (rowDetails.action === 'remoteExpand') {
|
|
476
505
|
record.childRecords = [];
|
|
@@ -497,45 +526,45 @@ var DataManipulation = /** @class */ (function () {
|
|
|
497
526
|
}
|
|
498
527
|
record.index = Math.ceil(Math.random() * 1000);
|
|
499
528
|
record.uniqueID = getUid(_this.parent.element.id + '_data_');
|
|
500
|
-
if (rowDetails.record["" +
|
|
529
|
+
if (rowDetails.record["" + idMapping] === record["" + idMapping]) {
|
|
501
530
|
rowDetails.record.uniqueID = record.uniqueID;
|
|
502
531
|
}
|
|
503
532
|
record.checkboxState = 'uncheck';
|
|
504
533
|
if (_this.parent.enableVirtualization && isNullOrUndefined(record.level)) {
|
|
505
|
-
for (var p = 0; p <
|
|
506
|
-
if (
|
|
507
|
-
record.level =
|
|
534
|
+
for (var p = 0; p < currentViewData.length; p++) {
|
|
535
|
+
if (currentViewData[parseInt(p.toString(), 10)]["" + idMapping] === record["" + parentIdMapping]) {
|
|
536
|
+
record.level = currentViewData[parseInt(p.toString(), 10)]['level'] + 1;
|
|
508
537
|
}
|
|
509
538
|
}
|
|
510
539
|
}
|
|
511
540
|
setValue('uniqueIDCollection.' + record.uniqueID, record, _this.parent);
|
|
512
541
|
// delete result[r].parentItem.childRecords;
|
|
513
542
|
if ((record["" + _this.parent.hasChildMapping] ||
|
|
514
|
-
_this.parentItems.indexOf(record["" +
|
|
543
|
+
_this.parentItems.indexOf(record["" + idMapping]) !== -1)
|
|
515
544
|
&& !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
|
|
516
545
|
record.hasChildRecords = true;
|
|
517
546
|
if (_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand) {
|
|
518
547
|
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
519
|
-
if (record["" +
|
|
548
|
+
if (record["" + idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + idMapping]) {
|
|
520
549
|
record.expanded = _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];
|
|
521
550
|
}
|
|
522
551
|
}
|
|
523
|
-
if (rowDetails.action === 'collapse' && record["" +
|
|
552
|
+
if (rowDetails.action === 'collapse' && record["" + idMapping] !== rowDetails.record["" + idMapping] && record.expanded !== false) {
|
|
524
553
|
record.expanded = true;
|
|
525
554
|
}
|
|
526
|
-
else if (rowDetails.action === 'collapse' && record["" +
|
|
555
|
+
else if (rowDetails.action === 'collapse' && record["" + idMapping] === rowDetails.record["" + idMapping]) {
|
|
527
556
|
record.expanded = false;
|
|
528
557
|
_this.parent["" + remoteCollapsedData].push(rowDetails.record);
|
|
529
558
|
}
|
|
530
559
|
else if (rowDetails.action === 'remoteExpand') {
|
|
531
|
-
for (var i = 0; i <
|
|
532
|
-
if (
|
|
533
|
-
result.splice(r, 1,
|
|
560
|
+
for (var i = 0; i < currentViewData.length; i++) {
|
|
561
|
+
if (currentViewData[parseInt(i.toString(), 10)]["" + _this.parent.idMapping] === record["" + _this.parent.idMapping]) {
|
|
562
|
+
result.splice(r, 1, currentViewData[parseInt(i.toString(), 10)]);
|
|
534
563
|
}
|
|
535
564
|
}
|
|
536
565
|
if (record[_this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping]) {
|
|
537
566
|
for (var i = 0; i < _this.parent["" + remoteCollapsedData].length; i++) {
|
|
538
|
-
if (rowDetails.record["" +
|
|
567
|
+
if (rowDetails.record["" + idMapping] === _this.parent["" + remoteCollapsedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
|
|
539
568
|
_this.parent["" + remoteCollapsedData].splice(i, 1);
|
|
540
569
|
}
|
|
541
570
|
}
|
|
@@ -545,14 +574,14 @@ var DataManipulation = /** @class */ (function () {
|
|
|
545
574
|
}
|
|
546
575
|
}
|
|
547
576
|
}
|
|
548
|
-
else if (_this.parent.enableVirtualization && record["" +
|
|
577
|
+
else if (_this.parent.enableVirtualization && record["" + idMapping] === rowDetails.record["" + idMapping] && rowDetails.action !== 'collapse') {
|
|
549
578
|
record.expanded = true;
|
|
550
579
|
}
|
|
551
580
|
else if (!(_this.parent.enableVirtualization && !_this.parent.loadChildOnDemand)) {
|
|
552
581
|
record.expanded = false;
|
|
553
582
|
}
|
|
554
583
|
}
|
|
555
|
-
var exists = datas.some(function (data) { return data["" +
|
|
584
|
+
var exists = datas.some(function (data) { return data["" + idMapping] === record["" + idMapping]; });
|
|
556
585
|
if (!exists) {
|
|
557
586
|
datas.splice(inx + r + 1, 0, record);
|
|
558
587
|
}
|
|
@@ -560,7 +589,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
560
589
|
for (var r = 0; r < result.length; r++) {
|
|
561
590
|
_loop_2(r);
|
|
562
591
|
}
|
|
563
|
-
var localIdMapping =
|
|
592
|
+
var localIdMapping = idMapping;
|
|
564
593
|
if (_this.parent.enableVirtualization && _this.parent.loadChildOnDemand) {
|
|
565
594
|
datas.sort(function (firstRecord, secondRecord) {
|
|
566
595
|
return firstRecord["" + localIdMapping] - secondRecord["" + localIdMapping];
|
|
@@ -597,6 +626,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
597
626
|
_this.parent.notify('infinite-remote-expand', notifyArgs);
|
|
598
627
|
}
|
|
599
628
|
else {
|
|
629
|
+
virtualArgs = _this.parent.enableDomVirtualization ? { requestType: 'refresh' } : virtualArgs;
|
|
600
630
|
getValue('grid.renderModule', _this.parent).dataManagerSuccess(e, virtualArgs);
|
|
601
631
|
}
|
|
602
632
|
_this.parent.trigger(events.expanded, args);
|
|
@@ -628,100 +658,123 @@ var DataManipulation = /** @class */ (function () {
|
|
|
628
658
|
}
|
|
629
659
|
}
|
|
630
660
|
};
|
|
631
|
-
DataManipulation.prototype.
|
|
661
|
+
DataManipulation.prototype.createConvertRecords = function (data, parentRecords) {
|
|
632
662
|
var treeGridData = [];
|
|
663
|
+
var flatData = this.parent.flatData;
|
|
664
|
+
var parentData = this.parent.parentData;
|
|
633
665
|
var keys = Object.keys(data);
|
|
634
|
-
|
|
635
|
-
|
|
666
|
+
var levelBase = 0;
|
|
667
|
+
var parentItem = null;
|
|
668
|
+
var parentUniqueID = null;
|
|
669
|
+
if (!isNullOrUndefined(parentRecords)) {
|
|
670
|
+
parentItem = __assign({}, parentRecords);
|
|
671
|
+
delete parentItem.childRecords;
|
|
672
|
+
delete parentItem[this.childMapping];
|
|
673
|
+
if (this.isSelfReference) {
|
|
674
|
+
delete parentItem.taskData[this.childMapping];
|
|
675
|
+
}
|
|
676
|
+
levelBase = (parentItem.level || 0) + 1;
|
|
677
|
+
parentUniqueID = parentItem.uniqueID;
|
|
678
|
+
}
|
|
679
|
+
for (var i = 0; i < keys.length; i++) {
|
|
680
|
+
var currentData = __assign({}, data[parseInt(i.toString(), 10)]);
|
|
636
681
|
currentData.taskData = data[parseInt(i.toString(), 10)];
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
|
|
682
|
+
if (!currentData.index) {
|
|
683
|
+
this.storedIndex++;
|
|
640
684
|
currentData.index = this.storedIndex;
|
|
641
685
|
}
|
|
642
|
-
var childMapping = currentData[this.parent.childMapping];
|
|
643
|
-
var hasChildren = !isNullOrUndefined(childMapping) && childMapping.length > 0;
|
|
644
|
-
var shouldCount = isCountRequired(this.parent);
|
|
645
|
-
var hasChildMapping = currentData[this.parent.hasChildMapping];
|
|
646
|
-
if ((hasChildren && !shouldCount) || (hasChildMapping && shouldCount)) {
|
|
647
|
-
currentData.hasChildRecords = true;
|
|
648
|
-
}
|
|
649
686
|
else {
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
687
|
+
this.storedIndex++;
|
|
688
|
+
}
|
|
689
|
+
var childMapping = currentData[this.childMapping];
|
|
690
|
+
var hasChildren = childMapping && childMapping.length > 0;
|
|
691
|
+
var hasChildMapping = currentData[this.hasChildMapping];
|
|
692
|
+
currentData.hasChildRecords = ((hasChildren && !this.isCountRequired) ||
|
|
693
|
+
(hasChildMapping && this.isCountRequired)) ? true : false;
|
|
694
|
+
if (currentData.hasChildRecords) {
|
|
695
|
+
if (this.enableCollapseAll || (!isNullOrUndefined(this.parent.dataStateChange) && !childMapping)) {
|
|
656
696
|
currentData.expanded = false;
|
|
657
697
|
}
|
|
658
698
|
else {
|
|
659
|
-
currentData.expanded = !isNullOrUndefined(currentData[this.
|
|
660
|
-
? currentData[this.parent.expandStateMapping] : true;
|
|
699
|
+
currentData.expanded = !isNullOrUndefined(currentData["" + this.expandStateMapping]) ? currentData["" + this.expandStateMapping] : true;
|
|
661
700
|
}
|
|
662
701
|
}
|
|
663
|
-
if (this.isSelfReference &&
|
|
664
|
-
|
|
702
|
+
if (this.isSelfReference && !currentData["" + this.parentIdMapping]) {
|
|
703
|
+
parentData.push(currentData);
|
|
665
704
|
}
|
|
666
|
-
currentData.uniqueID = getUid(this.
|
|
667
|
-
this.
|
|
668
|
-
if (
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (this.isSelfReference) {
|
|
673
|
-
delete parentData.taskData[this.parent.childMapping];
|
|
674
|
-
}
|
|
675
|
-
currentData.parentItem = parentData;
|
|
676
|
-
currentData.parentUniqueID = parentData.uniqueID;
|
|
677
|
-
level = parentRecords.level + 1;
|
|
705
|
+
currentData.uniqueID = getUid(this.cachedElementId);
|
|
706
|
+
this.uniqueIDCollection[currentData.uniqueID] = currentData;
|
|
707
|
+
if (parentItem) {
|
|
708
|
+
currentData.parentItem = parentItem;
|
|
709
|
+
currentData.parentUniqueID = parentUniqueID;
|
|
710
|
+
currentData.level = levelBase;
|
|
678
711
|
}
|
|
679
|
-
|
|
680
|
-
currentData.level =
|
|
712
|
+
else {
|
|
713
|
+
currentData.level = 0;
|
|
681
714
|
}
|
|
682
715
|
currentData.checkboxState = 'uncheck';
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
&& !this.parent.initialRender) {
|
|
686
|
-
if (!currentData.hasChildRecords && isNullOrUndefined(currentData["" + this.parent.parentIdMapping])) {
|
|
716
|
+
if (this.isVirtualRemote) {
|
|
717
|
+
if (!currentData.hasChildRecords && !currentData["" + this.parentIdMapping]) {
|
|
687
718
|
currentData.hasChildRecords = true;
|
|
688
|
-
|
|
689
|
-
|
|
719
|
+
var remoteCollapsedLen = this.remoteCollapsedList.length;
|
|
720
|
+
var currentId = currentData["" + this.idMapping];
|
|
721
|
+
for (var c = 0; c < remoteCollapsedLen; c++) {
|
|
722
|
+
if (this.remoteCollapsedList[parseInt(c.toString(), 10)]["" + this.idMapping] === currentId) {
|
|
690
723
|
currentData.expanded = false;
|
|
724
|
+
break;
|
|
691
725
|
}
|
|
692
726
|
}
|
|
693
727
|
}
|
|
694
|
-
else if (currentData.level === 0 &&
|
|
695
|
-
currentData.level
|
|
728
|
+
else if (currentData.level === 0 && !parentRecords && !currentData.hasChildRecords) {
|
|
729
|
+
currentData.level++;
|
|
696
730
|
}
|
|
697
|
-
if (currentData["" + this.parent.hasChildMapping] &&
|
|
698
|
-
currentData.expanded = currentData["" + this.
|
|
731
|
+
if (currentData["" + this.parent.hasChildMapping] && currentData["" + this.expandStateMapping] !== undefined) {
|
|
732
|
+
currentData.expanded = currentData["" + this.expandStateMapping];
|
|
699
733
|
currentData.hasChildRecords = true;
|
|
700
734
|
}
|
|
701
|
-
|
|
735
|
+
flatData.push(currentData);
|
|
702
736
|
}
|
|
703
|
-
else if (
|
|
704
|
-
if (!isNullOrUndefined(this.
|
|
737
|
+
else if (!currentData["" + this.parentIdMapping] || parentItem) {
|
|
738
|
+
if (!isNullOrUndefined(this.rowDragAndDropTargetID)) {
|
|
705
739
|
if (!this.parent.rowDragAndDropModule['isDuplicateData'](currentData)) {
|
|
706
|
-
|
|
740
|
+
flatData.push(currentData);
|
|
707
741
|
}
|
|
708
742
|
}
|
|
709
743
|
else {
|
|
710
|
-
|
|
744
|
+
flatData.push(currentData);
|
|
711
745
|
}
|
|
712
|
-
this.
|
|
746
|
+
this.infiniteScrollData.push(currentData);
|
|
713
747
|
}
|
|
714
748
|
if (!this.isSelfReference && currentData.level === 0) {
|
|
715
|
-
|
|
749
|
+
parentData.push(currentData);
|
|
716
750
|
}
|
|
717
|
-
if (
|
|
718
|
-
|
|
719
|
-
currentData.childRecords = record;
|
|
751
|
+
if (hasChildren) {
|
|
752
|
+
currentData.childRecords = this.createConvertRecords(childMapping, currentData);
|
|
720
753
|
}
|
|
721
754
|
treeGridData.push(currentData);
|
|
722
755
|
}
|
|
723
756
|
return treeGridData;
|
|
724
757
|
};
|
|
758
|
+
DataManipulation.prototype.createRecords = function (data) {
|
|
759
|
+
this.childMapping = this.parent.childMapping;
|
|
760
|
+
this.hasChildMapping = this.parent.hasChildMapping;
|
|
761
|
+
this.expandStateMapping = this.parent.expandStateMapping;
|
|
762
|
+
this.parentIdMapping = this.parent.parentIdMapping;
|
|
763
|
+
this.idMapping = this.parent.idMapping;
|
|
764
|
+
this.cachedElementId = this.parent.element.id + '_data_';
|
|
765
|
+
this.loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
766
|
+
this.initialRender = this.parent.initialRender;
|
|
767
|
+
this.isCountRequired = isCountRequired(this.parent);
|
|
768
|
+
this.rowDragAndDropTargetID = this.parent.rowDropSettings.targetID;
|
|
769
|
+
this.isVirtualRemote = this.parent.enableVirtualization && !this.loadChildOnDemand &&
|
|
770
|
+
isRemoteData(this.parent) && !this.initialRender;
|
|
771
|
+
this.isRemoteData = isRemoteData(this.parent);
|
|
772
|
+
var remoteCollapsedData = 'remoteCollapsedData';
|
|
773
|
+
this.remoteCollapsedList = this.isVirtualRemote ? this.parent["" + remoteCollapsedData] : [];
|
|
774
|
+
this.infiniteScrollData = this.parent['infiniteScrollData'];
|
|
775
|
+
this.uniqueIDCollection = this.parent.uniqueIDCollection;
|
|
776
|
+
return this.createConvertRecords(data);
|
|
777
|
+
};
|
|
725
778
|
/**
|
|
726
779
|
* Function to perform filtering/sorting action for local data
|
|
727
780
|
*
|
|
@@ -762,8 +815,9 @@ var DataManipulation = /** @class */ (function () {
|
|
|
762
815
|
dataObj = expresults;
|
|
763
816
|
}
|
|
764
817
|
else {
|
|
765
|
-
dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource)
|
|
766
|
-
|
|
818
|
+
dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource) :
|
|
819
|
+
this.parent.enableDomVirtualization && (action === 'collapse' || action === 'expand') ? args.result
|
|
820
|
+
: this.parent.grid.dataSource;
|
|
767
821
|
}
|
|
768
822
|
var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
|
|
769
823
|
var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
|
|
@@ -822,6 +876,9 @@ var DataManipulation = /** @class */ (function () {
|
|
|
822
876
|
}
|
|
823
877
|
count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
|
|
824
878
|
: results.length;
|
|
879
|
+
if (this.parent.enableDomVirtualization) {
|
|
880
|
+
this.parent.virtualDomScrollData = results;
|
|
881
|
+
}
|
|
825
882
|
var temp = this.paging(results, count, isExport, isPrinting, exportType, args);
|
|
826
883
|
results = temp.result;
|
|
827
884
|
count = temp.count;
|
|
@@ -837,9 +894,9 @@ var DataManipulation = /** @class */ (function () {
|
|
|
837
894
|
count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
|
|
838
895
|
: this.dataResults.count;
|
|
839
896
|
}
|
|
840
|
-
else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling
|
|
841
|
-
&& getValue('requestType', args) !== 'save') {
|
|
842
|
-
var actArgs = this.parent.enableInfiniteScrolling ? args : getValue('actionArgs', args);
|
|
897
|
+
else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling || this.parent.enableDomVirtualization) &&
|
|
898
|
+
(!isExport || exportType === 'CurrentPage') && getValue('requestType', args) !== 'save') {
|
|
899
|
+
var actArgs = this.parent.enableInfiniteScrolling || this.parent.enableDomVirtualization ? args : getValue('actionArgs', args);
|
|
843
900
|
this.parent.notify(events.pagingActions, { result: results, count: count, actionArgs: actArgs });
|
|
844
901
|
results = this.dataResults.result;
|
|
845
902
|
count = this.dataResults.count;
|