@refinitiv-ui/efx-grid 6.0.147 → 6.0.149
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +497 -273
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +1 -1
- package/lib/core/es6/data/DataTable.js +64 -59
- package/lib/core/es6/data/DataView.d.ts +1 -1
- package/lib/core/es6/data/DataView.js +5 -6
- package/lib/core/es6/data/Segment.d.ts +15 -1
- package/lib/core/es6/data/Segment.js +336 -169
- package/lib/core/es6/data/SegmentCollection.d.ts +1 -1
- package/lib/core/es6/data/SegmentCollection.js +91 -38
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +78 -35
- package/lib/types/es6/Core/data/DataTable.d.ts +1 -1
- package/lib/types/es6/Core/data/DataView.d.ts +1 -1
- package/lib/types/es6/Core/data/Segment.d.ts +15 -1
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -1
- package/lib/versions.json +1 -1
- package/package.json +1 -1
@@ -58,7 +58,7 @@ declare class SegmentCollection extends EventDispatcher {
|
|
58
58
|
|
59
59
|
public fillSegments(rids: (string)[]|null): boolean;
|
60
60
|
|
61
|
-
public calcSegmentOrder(rids: (string)[]|null): void;
|
61
|
+
public calcSegmentOrder(rids: (string)[]|null, useCache?: boolean|null): void;
|
62
62
|
|
63
63
|
public logStructure(): string;
|
64
64
|
|
@@ -14,6 +14,7 @@ let SegmentCollection = function() {
|
|
14
14
|
this._removalList = [];
|
15
15
|
|
16
16
|
this._shared = {
|
17
|
+
segments: this._segments,
|
17
18
|
childToSegment: {}, // child Id to segment Id
|
18
19
|
dirtyCollapsingState: false,
|
19
20
|
defaultCollapsing: false
|
@@ -74,10 +75,6 @@ SegmentCollection.prototype.dispose = function() {
|
|
74
75
|
*/
|
75
76
|
SegmentCollection.prototype.addSegment = function(rid, childRids) {
|
76
77
|
if(rid && !this._segments[rid]) {
|
77
|
-
if(this.getParentRowId(rid)) {
|
78
|
-
console.log("child of a segment cannot be set as a segment separator");
|
79
|
-
return false;
|
80
|
-
}
|
81
78
|
let segment = this._segments[rid] = new Segment(rid, this._shared);
|
82
79
|
segment.addEventListener("subSegmentAdded", this._onSubSegmentAdded);
|
83
80
|
segment.addEventListener("subSegmentRemoved", this._onSubSegmentRemoved);
|
@@ -124,33 +121,41 @@ SegmentCollection.prototype.getParentRowId = function(rid) {
|
|
124
121
|
*/
|
125
122
|
SegmentCollection.prototype.removeSegment = function(rid) {
|
126
123
|
let segment = this._segments[rid];
|
127
|
-
if(segment) {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
124
|
+
if(!segment) {
|
125
|
+
return false;
|
126
|
+
}
|
127
|
+
|
128
|
+
if(this._segmentCount <= 1) {
|
129
|
+
return this.removeAllSegments();
|
130
|
+
}
|
131
|
+
let subSegment = segment.isSubSegment();
|
132
|
+
if(subSegment) {
|
133
|
+
this._removalList.push(segment.getId());
|
134
|
+
}
|
135
|
+
let subSegIds = segment.getSubSegmentIds();
|
136
|
+
if(subSegIds) {
|
137
|
+
let len = subSegIds.length;
|
138
|
+
for(let i = 0; i < len; ++i) {
|
139
|
+
let subSegId = subSegIds[i];
|
140
|
+
if(this._segments[subSegId]) {
|
141
|
+
this._removalList.push(subSegId);
|
142
|
+
delete this._segments[subSegId]; // Slow
|
143
|
+
--this._segmentCount;
|
144
144
|
}
|
145
145
|
}
|
146
|
-
segment.removeAllChildren(); // This is important for updating childToSegment
|
147
|
-
segment.dispose();
|
148
|
-
|
149
|
-
delete this._segments[rid]; // Slow
|
150
|
-
--this._segmentCount;
|
151
|
-
return true;
|
152
146
|
}
|
153
|
-
|
147
|
+
if(!subSegment) {
|
148
|
+
let parentSeg = segment.getParent();
|
149
|
+
if(parentSeg) { // Move existing children to its parent
|
150
|
+
parentSeg.addChildren(segment.getChildIds()); // WARNING: passing private member
|
151
|
+
}
|
152
|
+
}
|
153
|
+
segment.removeAllChildren(); // This is important for updating childToSegment
|
154
|
+
segment.dispose();
|
155
|
+
|
156
|
+
delete this._segments[rid]; // Slow
|
157
|
+
--this._segmentCount;
|
158
|
+
return true;
|
154
159
|
};
|
155
160
|
/** @public
|
156
161
|
* @return {boolean} Returns true if there is any change. Otherwise, returns false
|
@@ -163,6 +168,7 @@ SegmentCollection.prototype.removeAllSegments = function() {
|
|
163
168
|
this._segments = {};
|
164
169
|
this._segmentCount = 0;
|
165
170
|
this._segmentList = null;
|
171
|
+
this._shared.segments = this._segments;
|
166
172
|
this._shared.childToSegment = {};
|
167
173
|
|
168
174
|
this._classification = this._classifierChanged = false;
|
@@ -288,7 +294,7 @@ SegmentCollection.prototype.getCollapsedRows = function() {
|
|
288
294
|
collapsedRids = {};
|
289
295
|
for(let rid in segmentSeparators) {
|
290
296
|
let segment = segmentSeparators[rid];
|
291
|
-
if(
|
297
|
+
if(segment.isRootSegment()) {
|
292
298
|
if(segment.getCollapsingStates(collapsedRids)) {
|
293
299
|
++count;
|
294
300
|
}
|
@@ -300,6 +306,31 @@ SegmentCollection.prototype.getCollapsedRows = function() {
|
|
300
306
|
return this._collapsedRids;
|
301
307
|
};
|
302
308
|
|
309
|
+
/** Invalidate segment order cache, if the given row id is a segment separator
|
310
|
+
* @private
|
311
|
+
* @param {string|Array.<string>} segmentIds
|
312
|
+
* @returns {boolean} Returns true if there is any change
|
313
|
+
*/
|
314
|
+
SegmentCollection.prototype._invalidateSegmentOrder = function(segmentIds) {
|
315
|
+
if(this._segmentList) {
|
316
|
+
if(typeof segmentIds === "string") {
|
317
|
+
if(this._segments[segmentIds]) {
|
318
|
+
this._segmentList = null;
|
319
|
+
return true;
|
320
|
+
}
|
321
|
+
} else if(Array.isArray(segmentIds)) {
|
322
|
+
let len = segmentIds.length;
|
323
|
+
for(let i = 0; i < len; ++i) {
|
324
|
+
let segmentId = segmentIds[i];
|
325
|
+
if(this._segments[segmentId]) {
|
326
|
+
this._segmentList = null;
|
327
|
+
return true;
|
328
|
+
}
|
329
|
+
}
|
330
|
+
}
|
331
|
+
}
|
332
|
+
return false;
|
333
|
+
};
|
303
334
|
/** @public
|
304
335
|
* @param {string} segmentId
|
305
336
|
* @param {string} rid
|
@@ -309,6 +340,8 @@ SegmentCollection.prototype.getCollapsedRows = function() {
|
|
309
340
|
SegmentCollection.prototype.addSegmentChild = function(segmentId, rid, dataId) {
|
310
341
|
let segment = this._segments[segmentId];
|
311
342
|
if(segment && !segment.isSubSegment()) {
|
343
|
+
// If a segment becomes a child of other segment, then the segment order needs to be recalculated
|
344
|
+
this._invalidateSegmentOrder(rid);
|
312
345
|
return segment.addChild(rid, dataId);
|
313
346
|
}
|
314
347
|
return false;
|
@@ -322,11 +355,14 @@ SegmentCollection.prototype.addSegmentChild = function(segmentId, rid, dataId) {
|
|
322
355
|
SegmentCollection.prototype.addSegmentChildren = function(segmentId, rids, dataIds) {
|
323
356
|
let segment = this._segments[segmentId];
|
324
357
|
if(segment && !segment.isSubSegment()) {
|
358
|
+
// If a segment becomes a child of other segment, then the segment order needs to be recalculated
|
359
|
+
this._invalidateSegmentOrder(rids);
|
325
360
|
return segment.addChildren(rids, dataIds);
|
326
361
|
}
|
327
362
|
return false;
|
328
363
|
};
|
329
|
-
/**
|
364
|
+
/** This only works for immediate children of the specified segment
|
365
|
+
* @public
|
330
366
|
* @param {string} segmentId
|
331
367
|
* @param {string} rid
|
332
368
|
* @return {boolean} Returns true if there is any change. Otherwise, returns false
|
@@ -346,6 +382,7 @@ SegmentCollection.prototype.containsSegmentChild = function(segmentId, rid) {
|
|
346
382
|
SegmentCollection.prototype.removeSegmentChild = function(segmentId, rid) {
|
347
383
|
let segment = this._segments[segmentId];
|
348
384
|
if(segment) {
|
385
|
+
this._invalidateSegmentOrder(rid);
|
349
386
|
return segment.removeChild(rid);
|
350
387
|
}
|
351
388
|
return false;
|
@@ -358,6 +395,7 @@ SegmentCollection.prototype.removeSegmentChild = function(segmentId, rid) {
|
|
358
395
|
SegmentCollection.prototype.removeSegmentChildren = function(segmentId, rids) {
|
359
396
|
let segment = this._segments[segmentId];
|
360
397
|
if(segment) {
|
398
|
+
this._invalidateSegmentOrder(rids);
|
361
399
|
return segment.removeChildren(rids);
|
362
400
|
}
|
363
401
|
return false;
|
@@ -377,6 +415,7 @@ SegmentCollection.prototype.removeAllSegmentChildren = function() {
|
|
377
415
|
}
|
378
416
|
|
379
417
|
if(dirty) {
|
418
|
+
this._segmentList = null; // WARNING: not optimized
|
380
419
|
this.classify(null);
|
381
420
|
}
|
382
421
|
|
@@ -435,10 +474,14 @@ SegmentCollection.prototype.fillSegments = function(rids) {
|
|
435
474
|
};
|
436
475
|
/** @public
|
437
476
|
* @param {Array.<string>} rids
|
477
|
+
* @param {boolean=} useCache=false If this is true, skip the calculation when there is already a cache for segment order
|
438
478
|
*/
|
439
|
-
SegmentCollection.prototype.calcSegmentOrder = function(rids) {
|
479
|
+
SegmentCollection.prototype.calcSegmentOrder = function(rids, useCache) {
|
440
480
|
let segmentList = this._segmentList;
|
441
481
|
if(segmentList) {
|
482
|
+
if(useCache) {
|
483
|
+
return; // Use previous cache for segment order
|
484
|
+
}
|
442
485
|
segmentList.length = 0;
|
443
486
|
} else {
|
444
487
|
segmentList = this._segmentList = [];
|
@@ -452,9 +495,10 @@ SegmentCollection.prototype.calcSegmentOrder = function(rids) {
|
|
452
495
|
let rid = rids[i];
|
453
496
|
let segment = segmentSeparators[rid];
|
454
497
|
if(segment) {
|
455
|
-
if(
|
498
|
+
if(segment.isRootSegment()) {
|
456
499
|
this._segmentList.push(segment);
|
457
500
|
segment.setOrder(++order); // WARNING: Segments and sub segments start with 1
|
501
|
+
segment.updateTreeStructure(0);
|
458
502
|
}
|
459
503
|
if(--segmentCount <= 0) {
|
460
504
|
break;
|
@@ -478,7 +522,7 @@ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
|
|
478
522
|
let prevSegment = null;
|
479
523
|
let segmentValues = new Array(rowCount);
|
480
524
|
let segmentVal = 0;
|
481
|
-
let highestVal =
|
525
|
+
let highestVal = 0;
|
482
526
|
let offset = 0;
|
483
527
|
for(let r = 0; r < rowCount; ++r) {
|
484
528
|
let rid = rids[r];
|
@@ -486,7 +530,7 @@ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
|
|
486
530
|
if(curSegment) { // segment separator
|
487
531
|
segmentVal = curSegment.getOrder() * 100;
|
488
532
|
offset = 0;
|
489
|
-
if(
|
533
|
+
if(curSegment.isRootSegment()) {
|
490
534
|
if(prevSegment !== curSegment) {
|
491
535
|
prevSegment = curSegment;
|
492
536
|
highestVal = curSegment.getLastOrder() * 100;
|
@@ -498,12 +542,14 @@ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
|
|
498
542
|
curSegment = segmentSeparators[parentId];
|
499
543
|
segmentVal = curSegment.getOrder() * 100;
|
500
544
|
offset = 1;
|
501
|
-
if(partial) {
|
545
|
+
if(partial) { // This fixes the out of order sub segment
|
502
546
|
highestVal = curSegment.getLastOrder() * 100;
|
503
547
|
}
|
504
548
|
} else { // row outside of segments
|
505
549
|
if(highestVal) {
|
506
|
-
segmentVal
|
550
|
+
if(segmentVal < highestVal) {
|
551
|
+
segmentVal = highestVal;
|
552
|
+
}
|
507
553
|
offset = 10;
|
508
554
|
} else {
|
509
555
|
segmentVal = offset = 0;
|
@@ -527,7 +573,10 @@ SegmentCollection.prototype.logStructure = function() {
|
|
527
573
|
let segmentCount = segmentList.length;
|
528
574
|
let lines = [];
|
529
575
|
for(let i = 0; i < segmentCount; ++i) {
|
530
|
-
segmentList[i]
|
576
|
+
let segment = segmentList[i];
|
577
|
+
if(segment.isRootSegment()) {
|
578
|
+
segment.log(lines);
|
579
|
+
}
|
531
580
|
}
|
532
581
|
|
533
582
|
return lines.join("\n");
|
@@ -537,10 +586,14 @@ SegmentCollection.prototype.logStructure = function() {
|
|
537
586
|
*/
|
538
587
|
SegmentCollection.prototype.logRowIdMap = function() {
|
539
588
|
let lines = [];
|
589
|
+
let segmentSeparators = this._segments;
|
540
590
|
let childToSegmentId = this._shared.childToSegment;
|
541
591
|
for(let rid in childToSegmentId) {
|
542
592
|
let segmentId = childToSegmentId[rid];
|
543
|
-
|
593
|
+
let segment = segmentSeparators[segmentId];
|
594
|
+
if(!segment || !segment.isSubSegment()) {
|
595
|
+
lines.push(rid + " > " + segmentId);
|
596
|
+
}
|
544
597
|
}
|
545
598
|
|
546
599
|
return lines.join("\n");
|
package/lib/grid/index.js
CHANGED
@@ -20,6 +20,7 @@ import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
|
|
20
20
|
* @property {string=} rowSpanningField="ROW_SPANNING" Field to be used for spanning segment header rows based on the field values
|
21
21
|
* @property {string=} segmentIdField="" Field used for initializing segments based on text id
|
22
22
|
* @property {string=} collapsingField="" Field used for indicating that the corresponding segment row is collapsed
|
23
|
+
* @property {string=} parentIdField="" Field used for specifying parent segment of the row
|
23
24
|
* @property {boolean=} defaultCollapsing=false If enabled, any newly created segment will be collapsed by default
|
24
25
|
* @property {(string|number)=} displayColumn=null Render tags in the given column. It can be either the column index, column ID, or field
|
25
26
|
*/
|
@@ -105,6 +106,10 @@ RowSegmentingPlugin.prototype._segmentIdField = "";
|
|
105
106
|
* @private
|
106
107
|
*/
|
107
108
|
RowSegmentingPlugin.prototype._collapsingField = "";
|
109
|
+
/** @type {string}
|
110
|
+
* @private
|
111
|
+
*/
|
112
|
+
RowSegmentingPlugin.prototype._parentIdField = "";
|
108
113
|
/** @type {number}
|
109
114
|
* @private
|
110
115
|
*/
|
@@ -241,17 +246,26 @@ RowSegmentingPlugin.prototype.requestSeparatorRefresh = function () {
|
|
241
246
|
let separatorArr = [];
|
242
247
|
let collapsingAry = [];
|
243
248
|
let expandingAry = [];
|
249
|
+
let parentId = "";
|
244
250
|
for(let i = 0; i < rowCount; i++) {
|
245
251
|
rowId = rowIds[i];
|
246
252
|
rowData = this._rowGetter(dt.getRowData(rowId));
|
247
253
|
segmentId = rowData[this._segmentIdField];
|
248
|
-
|
254
|
+
parentId = rowData[this._parentIdField];
|
255
|
+
if(segmentId == null && parentId == null) {
|
249
256
|
continue;
|
250
257
|
}
|
258
|
+
this._prevSegmentBySegmentId = true;
|
259
|
+
|
251
260
|
let segmentInfo = segmentMap[segmentId];
|
261
|
+
let parentInfo = parentId !== segmentId ? segmentMap[parentId] : null; // WARNING: parent must exist beforehand
|
252
262
|
if(segmentInfo) {
|
263
|
+
if(parentInfo) {
|
264
|
+
segmentInfo = parentInfo;
|
265
|
+
parentInfo = null;
|
266
|
+
}
|
253
267
|
segmentInfo.rowIds.push(rowId);
|
254
|
-
} else {
|
268
|
+
} else if(segmentId) {
|
255
269
|
segmentInfo = segmentMap[segmentId] = {
|
256
270
|
rowIds: [],
|
257
271
|
segmentId: rowId
|
@@ -268,7 +282,10 @@ RowSegmentingPlugin.prototype.requestSeparatorRefresh = function () {
|
|
268
282
|
}
|
269
283
|
}
|
270
284
|
}
|
271
|
-
|
285
|
+
|
286
|
+
if(parentInfo) {
|
287
|
+
parentInfo.rowIds.push(rowId);
|
288
|
+
}
|
272
289
|
}
|
273
290
|
if(segmentArr.length) {
|
274
291
|
this.setSegmentSeparators(separatorArr); // TODO: This method can be merged into setSegmentChildren
|
@@ -335,6 +352,9 @@ RowSegmentingPlugin.prototype.config = function (options) {
|
|
335
352
|
if (option.collapsingField != null) {
|
336
353
|
this._collapsingField = option.collapsingField;
|
337
354
|
}
|
355
|
+
if (option.parentIdField != null) {
|
356
|
+
this._parentIdField = option.parentIdField;
|
357
|
+
}
|
338
358
|
if (option.predefinedColors != null && typeof option.predefinedColors === "object") {
|
339
359
|
this._predefinedColors = option.predefinedColors;
|
340
360
|
}
|
@@ -418,6 +438,9 @@ RowSegmentingPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
418
438
|
if(this._collapsingField) {
|
419
439
|
extOptions.collapsingField = this._collapsingField;
|
420
440
|
}
|
441
|
+
if(this._parentIdField) {
|
442
|
+
extOptions.parentIdField = this._parentIdField;
|
443
|
+
}
|
421
444
|
if(this._defaultCollapsing) {
|
422
445
|
extOptions.defaultCollapsing = true;
|
423
446
|
}
|
@@ -445,7 +468,32 @@ RowSegmentingPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
445
468
|
return obj;
|
446
469
|
};
|
447
470
|
|
448
|
-
|
471
|
+
/** @private
|
472
|
+
* @function
|
473
|
+
* @param {!Object} obj
|
474
|
+
* @param {string} field
|
475
|
+
* @param {*} val
|
476
|
+
*/
|
477
|
+
let _setObjectValue = function(obj, field, val) {
|
478
|
+
if(field) {
|
479
|
+
if(!obj.values) {
|
480
|
+
obj.values = {};
|
481
|
+
}
|
482
|
+
obj.values[field] = val;
|
483
|
+
}
|
484
|
+
};
|
485
|
+
/** @private
|
486
|
+
* @function
|
487
|
+
* @param {!Object} obj
|
488
|
+
* @param {string} field
|
489
|
+
*/
|
490
|
+
let _deleteObjectValue = function(obj, field) {
|
491
|
+
if(field && obj.values) {
|
492
|
+
if(obj.values[field]) {
|
493
|
+
delete obj.values[field]; // Slow
|
494
|
+
}
|
495
|
+
}
|
496
|
+
};
|
449
497
|
/** @public
|
450
498
|
* @param {Object} rowData row config object
|
451
499
|
* @param {string} rowId
|
@@ -453,37 +501,35 @@ RowSegmentingPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
453
501
|
*/
|
454
502
|
RowSegmentingPlugin.prototype.getRowConfigObject = function (rowData, rowId) {
|
455
503
|
let obj = rowData || {};
|
456
|
-
|
457
|
-
if(!
|
504
|
+
let segmentIdField = this._segmentIdField;
|
505
|
+
if(!segmentIdField) {
|
458
506
|
return obj;
|
459
507
|
}
|
460
508
|
|
461
|
-
|
462
|
-
|
463
|
-
delete obj.values[this._segmentIdField]; // clear only segmentIdField
|
464
|
-
}
|
465
|
-
}
|
509
|
+
_deleteObjectValue(obj, segmentIdField);
|
510
|
+
_deleteObjectValue(obj, this._parentIdField);
|
466
511
|
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
512
|
+
let dv = this._getDataView();
|
513
|
+
let segment = dv.getSegment(rowId);
|
514
|
+
if(segment) {
|
515
|
+
_setObjectValue(obj, segmentIdField, ++this._runningId);
|
516
|
+
segment.runningId = this._runningId; // WANRING: Add
|
517
|
+
|
518
|
+
let collapsed = segment.isCollapsed();
|
519
|
+
_setObjectValue(obj, this._collapsingField, collapsed);
|
472
520
|
|
473
|
-
let collapsed = this.isSegmentCollapsed(rowId);
|
474
|
-
if(this._collapsingField) {
|
475
|
-
obj.values[this._collapsingField] = collapsed;
|
476
|
-
}
|
477
521
|
if(obj["collapsed"] == null) { // Avoid overriding value from real-time grid
|
478
522
|
obj["collapsed"] = collapsed;
|
479
523
|
}
|
480
|
-
}
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
obj
|
524
|
+
}
|
525
|
+
|
526
|
+
let parentSegment = dv.getSegmentParent(rowId);
|
527
|
+
if(parentSegment) {
|
528
|
+
if(this._parentIdField) {
|
529
|
+
// WARNING: this assumes the parent segment is always appeared before this row id
|
530
|
+
_setObjectValue(obj, this._parentIdField, parentSegment.runningId || this._runningId);
|
531
|
+
} else if(!segment) {
|
532
|
+
_setObjectValue(obj, segmentIdField, this._runningId);
|
487
533
|
}
|
488
534
|
}
|
489
535
|
|
@@ -601,12 +647,8 @@ RowSegmentingPlugin.prototype._hasSegmentation = function (settings) {
|
|
601
647
|
RowSegmentingPlugin.prototype.getSegmentParentRowId = function (rowRef) {
|
602
648
|
let dv = this._getDataView();
|
603
649
|
if(dv) {
|
604
|
-
|
605
|
-
|
606
|
-
rowId = dv.getRowId(rowRef); // WARNING: This is very slow
|
607
|
-
} else {
|
608
|
-
rowId = rowRef;
|
609
|
-
}
|
650
|
+
// WARNING: getRowId is slow
|
651
|
+
let rowId = (typeof rowRef === "number") ? dv.getRowId(rowRef) : rowRef;
|
610
652
|
return dv.getSegmentParentRowId(rowId);
|
611
653
|
}
|
612
654
|
return "";
|
@@ -711,9 +753,10 @@ RowSegmentingPlugin.prototype._updateHeader = function (settings, firstRowIndex,
|
|
711
753
|
} else {
|
712
754
|
arg.groupLevel = 0;
|
713
755
|
let indentLevel = 0;
|
714
|
-
let parentId =
|
756
|
+
let parentId = dv.getSegmentParentRowId(rowId);
|
715
757
|
if(parentId) {
|
716
|
-
|
758
|
+
let parentSegment = dv.getSegment(parentId);
|
759
|
+
indentLevel = parentSegment ? parentSegment.getSegmentLevel() + 1 : 1;
|
717
760
|
arg.nonGroupRow = false;
|
718
761
|
let parentRowData = parentRows[parentId];
|
719
762
|
if (!parentRowData) {
|
@@ -82,7 +82,7 @@ declare class DataTable extends DataCache {
|
|
82
82
|
|
83
83
|
public setSegmentSeparators(rids: (string)[]|null, enabled?: boolean|null): boolean;
|
84
84
|
|
85
|
-
public setSegmentSeparator(rid: string,
|
85
|
+
public setSegmentSeparator(rid: string, options?: any): boolean;
|
86
86
|
|
87
87
|
public unsetAllSegmentSeparators(): boolean;
|
88
88
|
|
@@ -248,7 +248,7 @@ declare class DataView extends EventDispatcher {
|
|
248
248
|
|
249
249
|
public setSegmentSeparators(rowIds: (string)[]|null, enabled?: boolean|null): boolean;
|
250
250
|
|
251
|
-
public setSegmentSeparator(rowRef: string|number|null,
|
251
|
+
public setSegmentSeparator(rowRef: string|number|null, options?: any): boolean;
|
252
252
|
|
253
253
|
public unsetAllSegmentSeparators(): boolean;
|
254
254
|
|
@@ -11,6 +11,8 @@ declare class Segment extends EventDispatcher {
|
|
11
11
|
|
12
12
|
public getParentId(): string;
|
13
13
|
|
14
|
+
public getParent(): Segment|null;
|
15
|
+
|
14
16
|
public getSubSegmentIds(out_ary?: (string)[]|null): (string)[]|null;
|
15
17
|
|
16
18
|
public addChild(rid: string, dataId?: string|null): boolean;
|
@@ -19,6 +21,8 @@ declare class Segment extends EventDispatcher {
|
|
19
21
|
|
20
22
|
public containsChild(rid: string): boolean;
|
21
23
|
|
24
|
+
public getChildIndex(rid: string): number;
|
25
|
+
|
22
26
|
public removeChild(rid: string): boolean;
|
23
27
|
|
24
28
|
public removeChildren(rids: (string)[]|null): boolean;
|
@@ -31,6 +35,8 @@ declare class Segment extends EventDispatcher {
|
|
31
35
|
|
32
36
|
public getChildCount(): number;
|
33
37
|
|
38
|
+
public markCollapsingStateDirty(): void;
|
39
|
+
|
34
40
|
public getClassification(): (string)[]|null;
|
35
41
|
|
36
42
|
public setClassification(fields: string|(string)[]|null): boolean;
|
@@ -41,10 +47,16 @@ declare class Segment extends EventDispatcher {
|
|
41
47
|
|
42
48
|
public isSubSegment(): boolean;
|
43
49
|
|
50
|
+
public isRootSegment(): boolean;
|
51
|
+
|
44
52
|
public getFirstAncestor(): Segment|null;
|
45
53
|
|
46
54
|
public getAllSubSegments(out_ary?: (Segment)[]|null): (Segment)[]|null;
|
47
55
|
|
56
|
+
public updateTreeStructure(counter: number): number;
|
57
|
+
|
58
|
+
public calcSubSegmentOrder(counter: number): number;
|
59
|
+
|
48
60
|
public getSegmentLevel(): number;
|
49
61
|
|
50
62
|
public setRowData(rows?: any, clsSource?: any): void;
|
@@ -65,7 +77,9 @@ declare class Segment extends EventDispatcher {
|
|
65
77
|
|
66
78
|
public setOrder(val: number): void;
|
67
79
|
|
68
|
-
public
|
80
|
+
public setLastOrder(val: number): number;
|
81
|
+
|
82
|
+
public log(lines?: (string)[]|null, tabLevel?: number|null): (string)[];
|
69
83
|
|
70
84
|
}
|
71
85
|
|
@@ -58,7 +58,7 @@ declare class SegmentCollection extends EventDispatcher {
|
|
58
58
|
|
59
59
|
public fillSegments(rids: (string)[]|null): boolean;
|
60
60
|
|
61
|
-
public calcSegmentOrder(rids: (string)[]|null): void;
|
61
|
+
public calcSegmentOrder(rids: (string)[]|null, useCache?: boolean|null): void;
|
62
62
|
|
63
63
|
public logStructure(): string;
|
64
64
|
|
package/lib/versions.json
CHANGED
package/package.json
CHANGED