@refinitiv-ui/efx-grid 6.0.17 → 6.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +1 -1
- package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/core/dist/core.js +40 -23
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +4 -0
- package/lib/core/es6/data/DataView.js +19 -1
- package/lib/core/es6/data/SegmentCollection.js +20 -8
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/components/Cell.js +0 -13
- package/lib/filter-dialog/lib/filter-dialog.js +149 -131
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +198 -86
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +2 -1
- package/lib/rt-grid/es6/Grid.d.ts +12 -2
- package/lib/rt-grid/es6/Grid.js +152 -54
- package/lib/rt-grid/es6/RowDefinition.js +4 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +63 -12
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +150 -161
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +5 -9
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.js +36 -8
- package/lib/tr-grid-pagination/es6/Pagination.d.ts +1 -0
- package/lib/tr-grid-pagination/es6/Pagination.js +35 -29
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +5 -0
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +30 -0
- package/lib/tr-grid-util/es6/Popup.js +5 -1
- package/lib/types/es6/ColumnGrouping.d.ts +4 -4
- package/lib/types/es6/Core/data/DataView.d.ts +4 -0
- package/lib/types/es6/FilterInput.d.ts +1 -0
- package/lib/types/es6/Pagination.d.ts +1 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +12 -2
- package/lib/versions.json +9 -9
- package/package.json +1 -1
@@ -9801,6 +9801,7 @@ DataCache_DataCache._proto = DataCache_DataCache.prototype;
|
|
9801
9801
|
|
9802
9802
|
|
9803
9803
|
/** @constructor
|
9804
|
+
* @extends {EventDispatcher}
|
9804
9805
|
* @param {string} rid
|
9805
9806
|
* @param {!Object} sharedObj
|
9806
9807
|
*/
|
@@ -10050,7 +10051,6 @@ Segment.prototype.removeChildren = function(rids) {
|
|
10050
10051
|
return dirty ? true : false;
|
10051
10052
|
};
|
10052
10053
|
/** @public
|
10053
|
-
* @param {Object=} objMap
|
10054
10054
|
* @return {boolean}
|
10055
10055
|
*/
|
10056
10056
|
Segment.prototype.removeAllChildren = function() {
|
@@ -10171,6 +10171,11 @@ Segment.prototype.classify = function(rows) {
|
|
10171
10171
|
}
|
10172
10172
|
}
|
10173
10173
|
|
10174
|
+
var sharedObj = this._shared;
|
10175
|
+
if(this._collapsed) {
|
10176
|
+
sharedObj.dirtyCollapsingState = true;
|
10177
|
+
}
|
10178
|
+
|
10174
10179
|
// Prepare existing sub segments for checking change in its members
|
10175
10180
|
var i;
|
10176
10181
|
var segmentName = "";
|
@@ -10189,6 +10194,9 @@ Segment.prototype.classify = function(rows) {
|
|
10189
10194
|
segment._children = {};
|
10190
10195
|
segment._childCount = 0;
|
10191
10196
|
}
|
10197
|
+
if(segment._collapsed) {
|
10198
|
+
sharedObj.dirtyCollapsingState = true;
|
10199
|
+
}
|
10192
10200
|
}
|
10193
10201
|
}
|
10194
10202
|
|
@@ -10209,7 +10217,7 @@ Segment.prototype.classify = function(rows) {
|
|
10209
10217
|
var record = rows[dataId];
|
10210
10218
|
var val = record ? record[classifier] : null; // WARNING: row could already be removed
|
10211
10219
|
|
10212
|
-
|
10220
|
+
sharedObj.childToSegment[rid] = this._rid; // Relocate child in case of it has been moved to a non existence group
|
10213
10221
|
|
10214
10222
|
segmentName = "Uncategorized";
|
10215
10223
|
if(val || val === 0 || val === false) { // Check for null, undefined, "", and NaN value
|
@@ -10222,7 +10230,7 @@ Segment.prototype.classify = function(rows) {
|
|
10222
10230
|
|
10223
10231
|
segment = segmentMap[segmentName];
|
10224
10232
|
if(!segment) { // New group is detected
|
10225
|
-
segment = new Segment(this._rid + "/" + segmentName,
|
10233
|
+
segment = new Segment(this._rid + "/" + segmentName, sharedObj);
|
10226
10234
|
segment._subSegDef = this._subSegDef;
|
10227
10235
|
segment._subSegLevel = this._subSegLevel + 1;
|
10228
10236
|
segment._subSegName = segmentName;
|
@@ -10242,7 +10250,7 @@ Segment.prototype.classify = function(rows) {
|
|
10242
10250
|
}
|
10243
10251
|
} else if(isRootSegment) { // In case of no classification
|
10244
10252
|
for(rid in children) {
|
10245
|
-
|
10253
|
+
sharedObj.childToSegment[rid] = this._rid; // Relocate child in case of it has been moved to a non existence group
|
10246
10254
|
}
|
10247
10255
|
}
|
10248
10256
|
|
@@ -10342,7 +10350,7 @@ Segment.prototype.getAllSubSegments = function(out_ary) {
|
|
10342
10350
|
segment.getAllSubSegments(out_ary);
|
10343
10351
|
}
|
10344
10352
|
}
|
10345
|
-
return out_ary;
|
10353
|
+
return out_ary || null;
|
10346
10354
|
};
|
10347
10355
|
/** @public
|
10348
10356
|
* @return {number}
|
@@ -10422,7 +10430,7 @@ Segment.prototype.isCollapsed = function() {
|
|
10422
10430
|
/** @public
|
10423
10431
|
* @param {Object=} objMap
|
10424
10432
|
* @param {boolean=} parentState=false Collapsing state from parent segment
|
10425
|
-
* @return {
|
10433
|
+
* @return {boolean}
|
10426
10434
|
*/
|
10427
10435
|
Segment.prototype.getCollapsingStates = function(objMap, parentState) {
|
10428
10436
|
var segmentNames = this._subSegNames;
|
@@ -10536,6 +10544,7 @@ Segment.prototype.log = function(lines) {
|
|
10536
10544
|
|
10537
10545
|
|
10538
10546
|
/** @constructor
|
10547
|
+
* @extends {EventDispatcher}
|
10539
10548
|
*/
|
10540
10549
|
var SegmentCollection = function() {
|
10541
10550
|
this._onSubSegmentAdded = this._onSubSegmentAdded.bind(this);
|
@@ -10594,6 +10603,7 @@ SegmentCollection.prototype._classifierChanged = false;
|
|
10594
10603
|
*/
|
10595
10604
|
SegmentCollection.prototype.dispose = function() {
|
10596
10605
|
this.removeAllSegments();
|
10606
|
+
this.removeAllEventListeners();
|
10597
10607
|
this._collapsedRids = null;
|
10598
10608
|
this._segmentList = this._insertionList = this._removalList = null;
|
10599
10609
|
};
|
@@ -10871,7 +10881,7 @@ SegmentCollection.prototype.removeAllSegmentChildren = function() {
|
|
10871
10881
|
}
|
10872
10882
|
|
10873
10883
|
if(dirty) {
|
10874
|
-
this.classify();
|
10884
|
+
this.classify(null);
|
10875
10885
|
}
|
10876
10886
|
|
10877
10887
|
return dirty;
|
@@ -10971,26 +10981,38 @@ SegmentCollection.prototype.getSegmentValues = function(rids) {
|
|
10971
10981
|
var prevSegment = null;
|
10972
10982
|
var segmentValues = new Array(rowCount);
|
10973
10983
|
var segmentVal = 0;
|
10984
|
+
var highestVal = -10;
|
10974
10985
|
var offset = 0;
|
10975
10986
|
for(var r = 0; r < rowCount; ++r) {
|
10976
10987
|
var rid = rids[r];
|
10977
10988
|
curSegment = segmentSeparators[rid];
|
10978
|
-
if(curSegment) {
|
10989
|
+
if(curSegment) { // segment separator
|
10990
|
+
if(prevSegment !== curSegment) {
|
10991
|
+
prevSegment = curSegment;
|
10992
|
+
segmentVal = curSegment.getOrder() * 100;
|
10993
|
+
if(segmentVal > highestVal) {
|
10994
|
+
highestVal = segmentVal;
|
10995
|
+
}
|
10996
|
+
}
|
10979
10997
|
offset = 0;
|
10980
10998
|
} else {
|
10981
10999
|
var parentId = childToSegmentId[rid];
|
10982
|
-
if(parentId) {
|
11000
|
+
if(parentId) { // segment member
|
10983
11001
|
curSegment = segmentSeparators[parentId];
|
11002
|
+
if(prevSegment !== curSegment) {
|
11003
|
+
prevSegment = curSegment;
|
11004
|
+
segmentVal = curSegment.getOrder() * 100;
|
11005
|
+
if(segmentVal > highestVal) {
|
11006
|
+
highestVal = segmentVal;
|
11007
|
+
}
|
11008
|
+
}
|
10984
11009
|
offset = 1;
|
10985
|
-
} else {
|
10986
|
-
|
11010
|
+
} else { // row outside of segments
|
11011
|
+
segmentVal = highestVal;
|
11012
|
+
offset = 10;
|
10987
11013
|
}
|
10988
11014
|
}
|
10989
11015
|
|
10990
|
-
if(curSegment && prevSegment !== curSegment) {
|
10991
|
-
prevSegment = curSegment;
|
10992
|
-
segmentVal = curSegment.getOrder() * 100;
|
10993
|
-
}
|
10994
11016
|
segmentValues[r] = segmentVal + offset;
|
10995
11017
|
}
|
10996
11018
|
|
@@ -11236,7 +11258,7 @@ DataTable.prototype.dispose = function() {
|
|
11236
11258
|
this.clearAllData(true);
|
11237
11259
|
|
11238
11260
|
if(this._classifyingTimer) {
|
11239
|
-
clearTimeout(this.
|
11261
|
+
clearTimeout(this._classifyingTimer);
|
11240
11262
|
this._classifyingTimer = 0;
|
11241
11263
|
}
|
11242
11264
|
|
@@ -13295,6 +13317,10 @@ RowDefinition.prototype.setContent = function(userInput) {
|
|
13295
13317
|
this._ric = this._userInput.replace("0#", "");
|
13296
13318
|
this._isChain = this._expanded = true; // Only chain can be expanded by 0# TODO: RIC with 0# is not necessarily a chain
|
13297
13319
|
this._chainRic = this._userInput;
|
13320
|
+
if(this._view) {
|
13321
|
+
this._view.setSegmentSeparator(this._rowId);
|
13322
|
+
this.expandChain();
|
13323
|
+
}
|
13298
13324
|
} else {
|
13299
13325
|
this._ric = this._userInput;
|
13300
13326
|
this._chainRic = "";
|
@@ -15346,7 +15372,8 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
|
|
15346
15372
|
}
|
15347
15373
|
|
15348
15374
|
value = core.isColumnVisible(colIndex);
|
15349
|
-
|
15375
|
+
// If "hidden" property already available from core/extensions, don't override this property
|
15376
|
+
if(!value && obj["hidden"] == null) {
|
15350
15377
|
obj["hidden"] = true;
|
15351
15378
|
}
|
15352
15379
|
|
@@ -17050,8 +17077,6 @@ CellFloatingPanel.prototype._updatePanelItems = function() {
|
|
17050
17077
|
* @param {ILayoutGrid=} opt_section Parent section
|
17051
17078
|
*/
|
17052
17079
|
var Cell = function (opt_element, opt_section) {
|
17053
|
-
this._onFocus = this._onFocus.bind(this);
|
17054
|
-
|
17055
17080
|
this._id = Cell._runningId++;
|
17056
17081
|
this._element = document.createElement("div");
|
17057
17082
|
this._element.className = "cell";
|
@@ -17395,7 +17420,6 @@ Cell.prototype.initialize = function () {
|
|
17395
17420
|
this._aligner = document.createElement("div");
|
17396
17421
|
} else {
|
17397
17422
|
this._aligner = document.createElement("button");
|
17398
|
-
this._aligner.addEventListener('focus', this._onFocus);
|
17399
17423
|
}
|
17400
17424
|
this._aligner.className = "valigner";
|
17401
17425
|
if(this._frontIcon) {
|
@@ -17761,16 +17785,6 @@ Cell.prototype._updateDisplay = function () {
|
|
17761
17785
|
this._element.style.display = "none";
|
17762
17786
|
}
|
17763
17787
|
};
|
17764
|
-
|
17765
|
-
/** @private
|
17766
|
-
* @param {Event} e
|
17767
|
-
*/
|
17768
|
-
Cell.prototype._onFocus = function (e) {
|
17769
|
-
if (!this._section) return;
|
17770
|
-
|
17771
|
-
var core = this._section._getContext();
|
17772
|
-
core.getElement().focus({ preventScroll: true });
|
17773
|
-
};
|
17774
17788
|
//#endregion Private Methods
|
17775
17789
|
|
17776
17790
|
|
@@ -28579,7 +28593,7 @@ DataView.prototype.prevPage = DataView.prototype.previousPage;
|
|
28579
28593
|
* @fires DataView#dataChanged
|
28580
28594
|
*/
|
28581
28595
|
DataView.prototype.lastPage = function () {
|
28582
|
-
return this.gotoPage(this._lastPageIndex
|
28596
|
+
return this.gotoPage(this._lastPageIndex);
|
28583
28597
|
};
|
28584
28598
|
/** Goes to the first page
|
28585
28599
|
* @public
|
@@ -34515,7 +34529,7 @@ Core.prototype._rowHeightTimerId = 0;
|
|
34515
34529
|
* @return {string}
|
34516
34530
|
*/
|
34517
34531
|
Core.getVersion = function () {
|
34518
|
-
return "5.1.
|
34532
|
+
return "5.1.30";
|
34519
34533
|
};
|
34520
34534
|
/** {@link ElementWrapper#dispose}
|
34521
34535
|
* @override
|
@@ -42045,6 +42059,45 @@ var compareNumber = function(rowDefA, rowDefB, sortOrder, fieldName) { // edit n
|
|
42045
42059
|
return (rowDefA.getData(fieldName) - rowDefB.getData(fieldName)) * sortOrder; // for numeric comparison
|
42046
42060
|
};
|
42047
42061
|
|
42062
|
+
/** @private
|
42063
|
+
* @param {ColumnDefinition} colDef
|
42064
|
+
* @return {string}
|
42065
|
+
*/
|
42066
|
+
var _getId = function(colDef) {
|
42067
|
+
if(colDef) {
|
42068
|
+
return colDef.getId();
|
42069
|
+
}
|
42070
|
+
return "";
|
42071
|
+
};
|
42072
|
+
/** @private
|
42073
|
+
* @param {ColumnDefinition} colDef
|
42074
|
+
* @return {string}
|
42075
|
+
*/
|
42076
|
+
var _getField = function(colDef) {
|
42077
|
+
if(colDef) {
|
42078
|
+
return colDef.getField();
|
42079
|
+
}
|
42080
|
+
return "";
|
42081
|
+
};
|
42082
|
+
/** @private
|
42083
|
+
* @param {ColumnDefinition} colDef
|
42084
|
+
* @return {string}
|
42085
|
+
*/
|
42086
|
+
var _getName = function(colDef) {
|
42087
|
+
if(colDef) {
|
42088
|
+
return colDef.getName();
|
42089
|
+
}
|
42090
|
+
return "";
|
42091
|
+
};
|
42092
|
+
/** @private
|
42093
|
+
* @param {ColumnDefinition} colDef
|
42094
|
+
* @param {string} str
|
42095
|
+
* @return {boolean}
|
42096
|
+
*/
|
42097
|
+
var _hasFieldOrId = function(colDef, str) {
|
42098
|
+
return (colDef.getField() === str) || (colDef.getId() === str);
|
42099
|
+
};
|
42100
|
+
|
42048
42101
|
/** @constructor
|
42049
42102
|
* @extends {EventDispatcher}
|
42050
42103
|
* @param {(Element|null)=} placeholder
|
@@ -43031,7 +43084,7 @@ Grid.prototype._onFieldAdded = function(e) {
|
|
43031
43084
|
|
43032
43085
|
// JET
|
43033
43086
|
if (this._subs) {
|
43034
|
-
var colDefs = this.
|
43087
|
+
var colDefs = this.getColumnDefinitions();
|
43035
43088
|
var fields = colDefs.reduce(ColumnDefinition.getRealTimeFields, []);
|
43036
43089
|
this._subs["addFields"](fields);
|
43037
43090
|
}
|
@@ -43581,16 +43634,49 @@ Grid.prototype.removeAllColumns = function() {
|
|
43581
43634
|
}
|
43582
43635
|
};
|
43583
43636
|
|
43584
|
-
/**
|
43585
|
-
|
43586
|
-
|
43587
|
-
|
43588
|
-
|
43589
|
-
|
43590
|
-
|
43637
|
+
/** Move the column at the specified index to the target index. When moving multiple columns, the original order of the source columns will be sorted by their index and the position of the columns will not be guaranteed to be exactly at the destination index.
|
43638
|
+
* @public
|
43639
|
+
* @param {number|Array.<number>} fromColIndex index or array of indices of the column(s) to be moved.
|
43640
|
+
* @param {number} toColIndex target column index
|
43641
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
43642
|
+
* @see {@link Grid#moveColumnById}
|
43643
|
+
*/
|
43591
43644
|
Grid.prototype.moveColumn = function (fromColIndex, toColIndex) {
|
43592
43645
|
return this._grid.moveColumn(fromColIndex, toColIndex);
|
43593
43646
|
};
|
43647
|
+
/** If source column is not found, no operation is performed. If destination column is not found, the source column will be moved to the last position.<br>
|
43648
|
+
* Note: this method behaves slightly different from moveColumn method in that it always put source column at the position before the specified destination column, while moveColumn method will put column at exactly at the destination index.
|
43649
|
+
* @public
|
43650
|
+
* @param {number|string} srcCol Column Id or index
|
43651
|
+
* @param {(number|string)=} destCol Column Id or index of the destination
|
43652
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
43653
|
+
* @see {@link Grid#moveColumn}
|
43654
|
+
* @example
|
43655
|
+
* grid.moveColumnById(3, 1); // Move column 3 to position before column 1
|
43656
|
+
* grid.moveColumnById(0, 2); // Move column 0 to position before column 2 (column index 1)
|
43657
|
+
* grid.moveColumnById(0, 1); // Nothing is moved
|
43658
|
+
* grid.moveColumnById("sourceColumnId", "anotherId");
|
43659
|
+
* grid.moveColumnById("sourceColumnId", ""); // move to the last position
|
43660
|
+
*/
|
43661
|
+
Grid.prototype.moveColumnById = function (srcCol, destCol) {
|
43662
|
+
var colCount = this.getColumnCount();
|
43663
|
+
var srcIndex = this.getColumnIndex(srcCol);
|
43664
|
+
if(srcIndex < 0 || srcIndex >= colCount) {
|
43665
|
+
return false;
|
43666
|
+
}
|
43667
|
+
var destIndex = this.getColumnIndex(destCol);
|
43668
|
+
if(destIndex < 0) {
|
43669
|
+
destIndex = colCount;
|
43670
|
+
}
|
43671
|
+
if(srcIndex < destIndex) { // Ensure that the source column is put in front of the destination index
|
43672
|
+
--destIndex;
|
43673
|
+
}
|
43674
|
+
if(srcIndex === destIndex) {
|
43675
|
+
return false;
|
43676
|
+
}
|
43677
|
+
return this.moveColumn(srcIndex, destIndex);
|
43678
|
+
};
|
43679
|
+
|
43594
43680
|
|
43595
43681
|
/** The hidden column still occupies the same index.
|
43596
43682
|
* @public
|
@@ -44157,12 +44243,18 @@ Grid.prototype._removeRow = function(rowDef) {
|
|
44157
44243
|
}
|
44158
44244
|
this._dispatch("beforeRowRemoved", {});
|
44159
44245
|
|
44160
|
-
var
|
44161
|
-
|
44162
|
-
|
44246
|
+
var connector = this._connector;
|
44247
|
+
var dt = this._dt;
|
44248
|
+
var childRowDefs = rowDef.getDescendants(); // TODO: Support nested child
|
44249
|
+
if(childRowDefs) { // Remove all children first
|
44250
|
+
for(var i = 0; i < childRowDefs.length; i++) {
|
44251
|
+
connector.removeRic(childRowDefs[i]);
|
44252
|
+
}
|
44253
|
+
var rowIds = childRowDefs.map(RowDefinition.toRowId);
|
44254
|
+
dt.removeRows(rowIds);
|
44163
44255
|
}
|
44164
|
-
|
44165
|
-
|
44256
|
+
connector.removeRic(rowDef);
|
44257
|
+
dt.removeRow(rowDef.getRowId()); // TODO: Merge this with the above removeRows() method
|
44166
44258
|
rowDef.dispose(); // WARNING: This does not remove child reference from its parent
|
44167
44259
|
};
|
44168
44260
|
|
@@ -44217,19 +44309,35 @@ Grid.prototype.hasHiddenRow = function(){
|
|
44217
44309
|
* @public
|
44218
44310
|
* @param {Grid~RowReference} rowRef
|
44219
44311
|
* @param {string} str
|
44312
|
+
* @param {RowDefinition~Options=} options
|
44220
44313
|
*/
|
44221
|
-
Grid.prototype.setRic = function(rowRef, str) {
|
44314
|
+
Grid.prototype.setRic = function(rowRef, str, options) {
|
44222
44315
|
if(this._mainGrid) {
|
44223
44316
|
this._mainGrid.setRic(this._toRowId(rowRef), str);
|
44224
44317
|
return;
|
44225
44318
|
}
|
44226
44319
|
var rowDef = this._getRowDefinition(rowRef);
|
44227
44320
|
if(rowDef) {
|
44228
|
-
|
44229
|
-
|
44230
|
-
|
44231
|
-
|
44232
|
-
|
44321
|
+
options = options || {};
|
44322
|
+
var newChain = false;
|
44323
|
+
if(str.indexOf("0#") > 0 || options["asChain"]) {
|
44324
|
+
newChain = true;
|
44325
|
+
}
|
44326
|
+
if(rowDef.isChain() || newChain) {
|
44327
|
+
if(rowDef.getRic() !== str.replace("0#", "")) {
|
44328
|
+
var rowIndex = this._dv.getRowIndex(rowDef.getRowId());
|
44329
|
+
this.removeRow(rowDef);
|
44330
|
+
|
44331
|
+
options["ric"] = str;
|
44332
|
+
this.insertRow(options, rowIndex);
|
44333
|
+
}
|
44334
|
+
} else {
|
44335
|
+
var oldRic = rowDef.getRic();
|
44336
|
+
if(rowDef.setContent(str)) { // The given string may not be a RIC
|
44337
|
+
this._connector.removeRic(rowDef, oldRic);
|
44338
|
+
this._initDuplicateRicData(rowDef);
|
44339
|
+
this._connector.addRic(rowDef);
|
44340
|
+
}
|
44233
44341
|
}
|
44234
44342
|
}
|
44235
44343
|
};
|
@@ -44353,6 +44461,17 @@ Grid.prototype.getColumnDefinition = function(colIndex) {
|
|
44353
44461
|
}
|
44354
44462
|
return null;
|
44355
44463
|
};
|
44464
|
+
/** @public
|
44465
|
+
* @return {!Array.<ColumnDefinition>}
|
44466
|
+
*/
|
44467
|
+
Grid.prototype.getColumnDefinitions = function() {
|
44468
|
+
var colCount = this.getColumnCount();
|
44469
|
+
var colDefs = new Array(colCount);
|
44470
|
+
for(var i = 0; i < colCount; i++) {
|
44471
|
+
colDefs[i] = this.getColumnDefinition(i);
|
44472
|
+
}
|
44473
|
+
return colDefs;
|
44474
|
+
};
|
44356
44475
|
|
44357
44476
|
/** @public
|
44358
44477
|
* @param {string} colId
|
@@ -44360,11 +44479,7 @@ Grid.prototype.getColumnDefinition = function(colIndex) {
|
|
44360
44479
|
*/
|
44361
44480
|
Grid.prototype.getColumnDefinitionById = function(colId) {
|
44362
44481
|
if(typeof colId === "string") {
|
44363
|
-
|
44364
|
-
var colData = this._grid.getColumnData(colIndex);
|
44365
|
-
if(colData) {
|
44366
|
-
return /** @type{ColumnDefinition} */(colData[COL_DEF]) || null;
|
44367
|
-
}
|
44482
|
+
return this.getColumnDefinition(this.getColumnIndex(colId));
|
44368
44483
|
}
|
44369
44484
|
return null;
|
44370
44485
|
};
|
@@ -44400,24 +44515,13 @@ Grid.prototype._getColumnDefinition = function(colRef) {
|
|
44400
44515
|
var colCount = this.getColumnCount();
|
44401
44516
|
for(var i = 0; i < colCount; ++i) {
|
44402
44517
|
var colDef = this.getColumnDefinition(i);
|
44403
|
-
if(
|
44404
|
-
return colDef; // Return the first found
|
44518
|
+
if(_hasFieldOrId(colDef, colRef)) {
|
44519
|
+
return colDef; // Return the first found column
|
44405
44520
|
}
|
44406
44521
|
}
|
44407
44522
|
}
|
44408
44523
|
return null;
|
44409
44524
|
};
|
44410
|
-
/** @private
|
44411
|
-
* @return {Array.<ColumnDefinition>}
|
44412
|
-
*/
|
44413
|
-
Grid.prototype._getAllColumnDefinitions = function() {
|
44414
|
-
var colCount = this.getColumnCount();
|
44415
|
-
var colDefs = new Array(colCount);
|
44416
|
-
for(var i = 0; i < colCount; i++) {
|
44417
|
-
colDefs[i] = this.getColumnDefinition(i);
|
44418
|
-
}
|
44419
|
-
return colDefs;
|
44420
|
-
};
|
44421
44525
|
|
44422
44526
|
/** @public
|
44423
44527
|
* @param {number|string} rowRef Row index as shown in the view or row id (string)
|
@@ -44473,16 +44577,17 @@ Grid.prototype.getRowDefinitions = function() {
|
|
44473
44577
|
Grid.prototype._getAllRowDefinitions = function() {
|
44474
44578
|
return this._dt.getColumnData(ROW_DEF); // no group header rows
|
44475
44579
|
};
|
44476
|
-
|
44580
|
+
|
44581
|
+
/** Get all row definitions, including filtered and hidden rows, but without auto generated rows (i.e., group header and chain constituent).
|
44477
44582
|
* @public
|
44478
|
-
* @param {boolean=}
|
44583
|
+
* @param {boolean=} inclAutoGenerated=false Set to true to include auto generated rows. Default value is false (exclude auto generated rows)
|
44479
44584
|
* @return {!Array.<RowDefinition>}
|
44480
44585
|
*/
|
44481
|
-
Grid.prototype.getAllRowDefinitions = function(
|
44482
|
-
if(
|
44483
|
-
return this.
|
44586
|
+
Grid.prototype.getAllRowDefinitions = function(inclAutoGenerated) {
|
44587
|
+
if(inclAutoGenerated) {
|
44588
|
+
return this._getAllRowDefinitions();
|
44484
44589
|
}
|
44485
|
-
return this.
|
44590
|
+
return this._dt.getColumnData(ROW_DEF).filter(excludeAutoGenerated);
|
44486
44591
|
};
|
44487
44592
|
/** A shorthand to retrieve row data based on index of the specified row.
|
44488
44593
|
* @public
|
@@ -44619,7 +44724,7 @@ Grid.prototype.getColumnIndex = function(colRef) {
|
|
44619
44724
|
} else if(typeof colRef === "string") {
|
44620
44725
|
for(i = 0; i < colCount; ++i) {
|
44621
44726
|
colDef = this.getColumnDefinition(i);
|
44622
|
-
if(
|
44727
|
+
if(_hasFieldOrId(colDef, colRef)) {
|
44623
44728
|
return i; // Return the first found field
|
44624
44729
|
}
|
44625
44730
|
}
|
@@ -44652,8 +44757,14 @@ Grid.prototype.getColumnIndices = function(colRefs) {
|
|
44652
44757
|
* @see {@link Grid#getColumnDefinition}
|
44653
44758
|
*/
|
44654
44759
|
Grid.prototype.getColumnId = function(colIndex) {
|
44655
|
-
|
44656
|
-
|
44760
|
+
return _getId(this.getColumnDefinition(colIndex));
|
44761
|
+
};
|
44762
|
+
/** Get ids from each column definition.
|
44763
|
+
* @public
|
44764
|
+
* @return {!Array.<string>} New array is created
|
44765
|
+
*/
|
44766
|
+
Grid.prototype.getColumnIds = function() {
|
44767
|
+
return this.getColumnDefinitions().map(_getId);
|
44657
44768
|
};
|
44658
44769
|
/** Return field defined in the column definition
|
44659
44770
|
* @public
|
@@ -44662,20 +44773,21 @@ Grid.prototype.getColumnId = function(colIndex) {
|
|
44662
44773
|
* @see {@link Grid#getColumnDefinition}
|
44663
44774
|
*/
|
44664
44775
|
Grid.prototype.getColumnField = function(colIndex) {
|
44665
|
-
|
44666
|
-
return (colDef) ? colDef.getField() : "";
|
44776
|
+
return _getField(this.getColumnDefinition(colIndex));
|
44667
44777
|
};
|
44668
44778
|
/** Get fields from each column definition. Note that this does not include any required field or data fields. Duplicates may exist.
|
44669
44779
|
* @public
|
44670
44780
|
* @return {!Array.<string>} New array is created
|
44671
44781
|
*/
|
44672
44782
|
Grid.prototype.getColumnFields = function() {
|
44673
|
-
|
44674
|
-
|
44675
|
-
|
44676
|
-
|
44677
|
-
|
44678
|
-
|
44783
|
+
return this.getColumnDefinitions().map(_getField);
|
44784
|
+
};
|
44785
|
+
/** Get column name from each column definition. Note that this does not include any required field or data fields. Duplicates may exist.
|
44786
|
+
* @public
|
44787
|
+
* @return {!Array.<string>} New array is created
|
44788
|
+
*/
|
44789
|
+
Grid.prototype.getColumnNames = function() {
|
44790
|
+
return this.getColumnDefinitions().map(_getName);
|
44679
44791
|
};
|
44680
44792
|
/** Get all fields, including required fields and data fields, with no duplicate
|
44681
44793
|
* @public
|