@refinitiv-ui/efx-grid 6.0.20 → 6.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-dragging/es6/ColumnDragging.js +46 -24
- package/lib/core/dist/core.js +61 -14
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +11 -1
- package/lib/core/es6/grid/LayoutGrid.js +1 -0
- package/lib/core/es6/grid/components/CellSpans.d.ts +2 -0
- package/lib/core/es6/grid/components/CellSpans.js +35 -10
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +14 -3
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +362 -41
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +10 -1
- package/lib/rt-grid/es6/Grid.js +196 -17
- package/lib/rt-grid/es6/ReferenceCounter.js +13 -2
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -0
- package/lib/rt-grid/es6/RowDefinition.js +74 -8
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +9 -5
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +365 -133
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +11 -37
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +15 -15
- package/lib/tr-grid-row-selection/es6/RowSelection.js +9 -1
- package/lib/types/es6/ColumnGrouping.d.ts +9 -5
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +2 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +10 -1
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -0
- package/lib/types/es6/RowSelection.d.ts +15 -15
- package/lib/versions.json +4 -4
- package/package.json +6 -2
@@ -80,7 +80,8 @@ declare namespace Grid {
|
|
80
80
|
scrollbarParent?: Element|null,
|
81
81
|
formulaEngine?: boolean|null,
|
82
82
|
adcPollingInterval?: number|null,
|
83
|
-
fieldCaching?: boolean|null
|
83
|
+
fieldCaching?: boolean|null,
|
84
|
+
childDataField?: string|null
|
84
85
|
};
|
85
86
|
|
86
87
|
type RowReference = number|string|RowDefinition|null;
|
@@ -143,6 +144,8 @@ declare class Grid extends EventDispatcher {
|
|
143
144
|
|
144
145
|
public moveColumnById(srcCol: number|string|null, destCol?: (number|string)|null): boolean;
|
145
146
|
|
147
|
+
public reorderColumns(colRefs: number|string|(number|string)[]|null, destCol: number|string|null): boolean;
|
148
|
+
|
146
149
|
public hideColumn(colRef: Grid.ColumnReference|null, hidden?: boolean|null): void;
|
147
150
|
|
148
151
|
public hideColumns(colRefs: (Grid.ColumnReference)[]|null, hidden?: boolean|null): void;
|
@@ -257,6 +260,12 @@ declare class Grid extends EventDispatcher {
|
|
257
260
|
|
258
261
|
public freezeColumn(colIndex?: number|null, pinnedRightColumns?: number|null): void;
|
259
262
|
|
263
|
+
public pinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null): boolean;
|
264
|
+
|
265
|
+
public unpinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null, dest?: Grid.ColumnReference|null): boolean;
|
266
|
+
|
267
|
+
public unpinAllColumns(): boolean;
|
268
|
+
|
260
269
|
public updateColumnTitle(): void;
|
261
270
|
|
262
271
|
public isSorting(): boolean;
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -84,6 +84,7 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
|
|
84
84
|
* @property {boolean=} formulaEngine=false If enabled, field with leading equal sign will be treated as a formula and rows will be filled with the calculated values.
|
85
85
|
* @property {number=} adcPollingInterval=0 Length of polling interval for refreshing ADC data in milliseconds. The default value (0) means no polling.
|
86
86
|
* @property {boolean=} fieldCaching=false If enabled, field definition will be caching internal mechanism
|
87
|
+
* @property {string=} childDataField=CHILD_VALUES The given field will be used to store children's static data, such as row color assignment.
|
87
88
|
*/
|
88
89
|
|
89
90
|
/** @typedef {number|string|RowDefinition} Grid~RowReference
|
@@ -546,6 +547,10 @@ Grid.prototype._pollingEnabled = true;
|
|
546
547
|
* @private
|
547
548
|
*/
|
548
549
|
Grid.prototype._fieldCaching = false;
|
550
|
+
/** @type {string}
|
551
|
+
* @private
|
552
|
+
*/
|
553
|
+
Grid.prototype._childDataField = "";
|
549
554
|
|
550
555
|
|
551
556
|
/** @public
|
@@ -960,6 +965,9 @@ Grid.prototype.initialize = function(gridOption) {
|
|
960
965
|
}
|
961
966
|
|
962
967
|
// Row operations
|
968
|
+
if(gridOption["childDataField"] != null) {
|
969
|
+
this._childDataField = RowDefinition._childDataField = gridOption["childDataField"];
|
970
|
+
}
|
963
971
|
var rows = gridOption["rows"];
|
964
972
|
if(!rows) {
|
965
973
|
rows = gridOption["rics"] || null; // Make "rics" an alias to "rows"
|
@@ -1115,6 +1123,10 @@ Grid.prototype.getConfigObject = function (gridOptions) {
|
|
1115
1123
|
obj["fieldCaching"] = this._fieldCaching;
|
1116
1124
|
}
|
1117
1125
|
|
1126
|
+
if(this._childDataField) {
|
1127
|
+
obj["childDataField"] = this._childDataField;
|
1128
|
+
}
|
1129
|
+
|
1118
1130
|
// get all rows config
|
1119
1131
|
var rowDefs = this.getAllRowDefinitions();
|
1120
1132
|
var rows = obj["rows"] = [];
|
@@ -1252,9 +1264,8 @@ Grid.prototype._onFieldAdded = function(e) {
|
|
1252
1264
|
|
1253
1265
|
// JET
|
1254
1266
|
if (this._subs) {
|
1255
|
-
var
|
1256
|
-
|
1257
|
-
this._subs["addFields"](fields);
|
1267
|
+
var realtimeFields = addedFields.filter(ColumnDefinition.isRealTimeField);
|
1268
|
+
this._subs["addFields"](realtimeFields);
|
1258
1269
|
}
|
1259
1270
|
|
1260
1271
|
this._dispatch(e.type, e);
|
@@ -1265,6 +1276,7 @@ Grid.prototype._onFieldAdded = function(e) {
|
|
1265
1276
|
Grid.prototype._onFieldRemoved = function(e) {
|
1266
1277
|
var removedFields = e.removedFields;
|
1267
1278
|
|
1279
|
+
// TODO: ADC fields have an interval load. Currently, we only keep the field but do not delete it.
|
1268
1280
|
// JET
|
1269
1281
|
if(this._subs) {
|
1270
1282
|
this._subs["removeFields"](removedFields);
|
@@ -1518,15 +1530,7 @@ Grid.prototype._onFieldLoadedError = function (err) {
|
|
1518
1530
|
* @param {string} referrer
|
1519
1531
|
*/
|
1520
1532
|
Grid.prototype._onFieldLoaded = function (field, referrer) {
|
1521
|
-
|
1522
|
-
var colIndex = this.getColumnIndex(field);
|
1523
|
-
if(colIndex > -1) {
|
1524
|
-
var colDef = this._getColumnDefinition(field);
|
1525
|
-
if(colDef.isTimeSeriesField()) {
|
1526
|
-
this._insertTimeSeriesChildren(colDef);
|
1527
|
-
}
|
1528
|
-
this._connector.addFields(field, referrer);
|
1529
|
-
}
|
1533
|
+
this._connector.addFields(field, referrer);
|
1530
1534
|
};
|
1531
1535
|
|
1532
1536
|
/**
|
@@ -1845,6 +1849,62 @@ Grid.prototype.moveColumnById = function (srcCol, destCol) {
|
|
1845
1849
|
return this.moveColumn(srcIndex, destIndex);
|
1846
1850
|
};
|
1847
1851
|
|
1852
|
+
/** @public
|
1853
|
+
* @param {number|string|Array.<number|string>} colRefs List of column index or column id to be moved
|
1854
|
+
* @param {number|string} destCol Destination position where the moved columns will be placed BEFORE the specified position. This can be column id or index
|
1855
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
1856
|
+
*/
|
1857
|
+
Grid.prototype.reorderColumns = function (colRefs, destCol) {
|
1858
|
+
var destId = (typeof destCol === "number") ? this.getColumnId(destCol) : destCol;
|
1859
|
+
|
1860
|
+
if(Array.isArray(colRefs)) {
|
1861
|
+
var srcLen = colRefs.length;
|
1862
|
+
if(srcLen > 1) {
|
1863
|
+
var colIds = this.getColumnIds();
|
1864
|
+
var srcIds = [];
|
1865
|
+
var invalidDest = false;
|
1866
|
+
var i;
|
1867
|
+
for(i = 0; i < srcLen; ++i) {
|
1868
|
+
var colRef = colRefs[i];
|
1869
|
+
var srcId = (typeof colRef === "number") ? colIds[colRef] : colRef;
|
1870
|
+
if(srcId) {
|
1871
|
+
srcIds.push(srcId);
|
1872
|
+
if(destId === srcId) {
|
1873
|
+
invalidDest = true; // Destination must not exist in source columns
|
1874
|
+
}
|
1875
|
+
}
|
1876
|
+
}
|
1877
|
+
srcLen = srcIds.length;
|
1878
|
+
if(invalidDest) { // Find the next valid destination where it is not contained in the source columns
|
1879
|
+
var colCount = colIds.length;
|
1880
|
+
var destIdx = this.getColumnIndex(destId);
|
1881
|
+
if(destIdx >= 0) {
|
1882
|
+
while(++destIdx < colCount) {
|
1883
|
+
destId = colIds[destIdx];
|
1884
|
+
if(srcIds.indexOf(destId) < 0) {
|
1885
|
+
break;
|
1886
|
+
}
|
1887
|
+
}
|
1888
|
+
}
|
1889
|
+
if(destIdx < 0 || destIdx >= colCount) {
|
1890
|
+
destId = "";
|
1891
|
+
}
|
1892
|
+
}
|
1893
|
+
|
1894
|
+
var dirty = 0;
|
1895
|
+
for(i = 0; i < srcLen; ++i) {
|
1896
|
+
dirty |= this.moveColumnById(srcIds[i], destId);
|
1897
|
+
}
|
1898
|
+
// TODO: Handle the case where all columns stay in the same place
|
1899
|
+
return dirty ? true : false;
|
1900
|
+
} else {
|
1901
|
+
return this.moveColumnById(colRefs[0], destId);
|
1902
|
+
}
|
1903
|
+
}
|
1904
|
+
|
1905
|
+
// colRefs will be a number or string
|
1906
|
+
return this.moveColumnById(colRefs, destId);
|
1907
|
+
};
|
1848
1908
|
|
1849
1909
|
/** The hidden column still occupies the same index.
|
1850
1910
|
* @public
|
@@ -2965,17 +3025,136 @@ Grid.prototype.getAllFields = function() {
|
|
2965
3025
|
return this._connector.getAllFields();
|
2966
3026
|
};
|
2967
3027
|
/** Freeze the column at the left side of the table starting from index 0 to the specified colIndex
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
3028
|
+
* If no index is specified (null or undefined index), unfreeze all columns.
|
3029
|
+
* @public
|
3030
|
+
* @param {number=} colIndex Negative index is equivalent to null value
|
3031
|
+
* @param {number=} pinnedRightColumns Number of columns to be pinned/snapped on the right side
|
3032
|
+
*/
|
2973
3033
|
Grid.prototype.freezeColumn = function(colIndex, pinnedRightColumns) {
|
2974
3034
|
if(colIndex == null) {
|
2975
3035
|
colIndex = -1;
|
2976
3036
|
}
|
2977
3037
|
this._grid.freezeColumn(colIndex, pinnedRightColumns);
|
2978
3038
|
};
|
3039
|
+
/** Pin column to the left side by moving the specified column to the rightmost of the frozen columns. <br>
|
3040
|
+
* The method will do nothing if the specified column is already pinned to the left side
|
3041
|
+
* @public
|
3042
|
+
* @param {Grid~ColumnReference|Array.<Grid~ColumnReference>} colRef
|
3043
|
+
* @return {boolean}
|
3044
|
+
*/
|
3045
|
+
Grid.prototype.pinColumn = function(colRef) {
|
3046
|
+
if(Array.isArray(colRef)) {
|
3047
|
+
var ary = colRef;
|
3048
|
+
var len = ary.length;
|
3049
|
+
|
3050
|
+
var dirty = 0;
|
3051
|
+
for(var i = 0; i < len; ++i) {
|
3052
|
+
dirty |= this._pinColumn(ary[i]);
|
3053
|
+
}
|
3054
|
+
return dirty ? true : false;
|
3055
|
+
}
|
3056
|
+
return this._pinColumn(colRef);
|
3057
|
+
};
|
3058
|
+
/** @private
|
3059
|
+
* @param {Grid~ColumnReference} colRef
|
3060
|
+
* @return {boolean}
|
3061
|
+
*/
|
3062
|
+
Grid.prototype._pinColumn = function(colRef) {
|
3063
|
+
var colIndex = this.getColumnIndex(colRef);
|
3064
|
+
if(colIndex < 0) {
|
3065
|
+
return false;
|
3066
|
+
}
|
3067
|
+
var pinnedCount = this._grid.getFrozenColumnCount();
|
3068
|
+
if(colIndex < pinnedCount) {
|
3069
|
+
return false; // The column is already pinned area
|
3070
|
+
}
|
3071
|
+
if(!pinnedCount) {
|
3072
|
+
var stationaryIdx = this._grid.getStationaryColumnIndex();
|
3073
|
+
if(stationaryIdx >= 0) {
|
3074
|
+
pinnedCount = stationaryIdx;
|
3075
|
+
if(colIndex > stationaryIdx) {
|
3076
|
+
pinnedCount++;
|
3077
|
+
}
|
3078
|
+
}
|
3079
|
+
}
|
3080
|
+
|
3081
|
+
this.moveColumnById(colIndex, pinnedCount);
|
3082
|
+
this._grid.freezeColumn(pinnedCount);
|
3083
|
+
return true;
|
3084
|
+
};
|
3085
|
+
/** Unpin column from the left side by moving the specified column to the end of the frozen columns. <br>
|
3086
|
+
* The method will do nothing if the specified column is not pinned on the left side.
|
3087
|
+
* @public
|
3088
|
+
* @param {Grid~ColumnReference|Array.<Grid~ColumnReference>} colRef
|
3089
|
+
* @param {Grid~ColumnReference=} dest The unpinned column will be placed before the destination position after the operation
|
3090
|
+
* @return {boolean}
|
3091
|
+
*/
|
3092
|
+
Grid.prototype.unpinColumn = function(colRef, dest) {
|
3093
|
+
if(Array.isArray(colRef)) {
|
3094
|
+
var ary = colRef;
|
3095
|
+
var len = ary.length;
|
3096
|
+
|
3097
|
+
var dirty = 0;
|
3098
|
+
for(var i = len; --i >= 0;) { // WARNING: unpinning is done in reversed order
|
3099
|
+
dirty |= this._unpinColumn(ary[i], dest);
|
3100
|
+
}
|
3101
|
+
return dirty ? true : false;
|
3102
|
+
}
|
3103
|
+
return this._unpinColumn(colRef, dest);
|
3104
|
+
};
|
3105
|
+
/** @private
|
3106
|
+
* @param {Grid~ColumnReference} colRef
|
3107
|
+
* @param {Grid~ColumnReference=} dest The unpinned column will be placed before the destination position after the operation
|
3108
|
+
* @return {boolean}
|
3109
|
+
*/
|
3110
|
+
Grid.prototype._unpinColumn = function(colRef, dest) {
|
3111
|
+
var colIndex = this.getColumnIndex(colRef);
|
3112
|
+
if(colIndex < 0) {
|
3113
|
+
return false;
|
3114
|
+
}
|
3115
|
+
var pinnedCount = this._grid.getFrozenColumnCount();
|
3116
|
+
if(!pinnedCount) {
|
3117
|
+
return false;
|
3118
|
+
}
|
3119
|
+
if(colIndex >= pinnedCount) {
|
3120
|
+
return false; // The column is outside of frozen area
|
3121
|
+
}
|
3122
|
+
var srcId = null;
|
3123
|
+
var destId = null;
|
3124
|
+
if(dest != null) {
|
3125
|
+
var destIdx = this.getColumnIndex(dest);
|
3126
|
+
destId = this.getColumnId(destIdx);
|
3127
|
+
srcId = this.getColumnId(colIndex);
|
3128
|
+
}
|
3129
|
+
|
3130
|
+
var stationaryIdx = this._grid.getStationaryColumnIndex();
|
3131
|
+
|
3132
|
+
if(colIndex > stationaryIdx) {
|
3133
|
+
this.moveColumnById(colIndex, pinnedCount);
|
3134
|
+
}
|
3135
|
+
|
3136
|
+
this._grid.freezeColumn(pinnedCount - 2); // Column index is used for freezing
|
3137
|
+
|
3138
|
+
if(colIndex > stationaryIdx) {
|
3139
|
+
if(destId != null) {
|
3140
|
+
this.moveColumnById(srcId, destId);
|
3141
|
+
}
|
3142
|
+
}
|
3143
|
+
|
3144
|
+
return true;
|
3145
|
+
};
|
3146
|
+
/** A shorthand to unpin all columns from the left hand side
|
3147
|
+
* @public
|
3148
|
+
* @return {boolean}
|
3149
|
+
*/
|
3150
|
+
Grid.prototype.unpinAllColumns = function() {
|
3151
|
+
var pinnedCount = this._grid.getFrozenColumnCount();
|
3152
|
+
if(!pinnedCount) {
|
3153
|
+
return false;
|
3154
|
+
}
|
3155
|
+
this._grid.freezeColumn(-1); // Column index is used for freezing
|
3156
|
+
return true;
|
3157
|
+
};
|
2979
3158
|
|
2980
3159
|
/** @private
|
2981
3160
|
* @param {Object} e
|
@@ -66,6 +66,7 @@ ReferenceCounter.prototype.getSession = function() {
|
|
66
66
|
} else if(val < 0) {
|
67
67
|
removedEntries.push(key);
|
68
68
|
}
|
69
|
+
// else {} // when val 0 do nothing, doesn't change anything
|
69
70
|
}
|
70
71
|
return {
|
71
72
|
newEntries: newEntries.filter(Boolean),
|
@@ -94,9 +95,15 @@ ReferenceCounter.prototype.addReference = function(key, referer) {
|
|
94
95
|
|
95
96
|
if(this._counter[key]) {
|
96
97
|
++this._counter[key];
|
98
|
+
// The session will not change when a field already exists and a counter is attempted to be added
|
97
99
|
} else {
|
98
100
|
this._counter[key] = 1;
|
99
|
-
this._session[key]
|
101
|
+
if(this._session[key] === -1) {
|
102
|
+
this._session[key] = 0;
|
103
|
+
} else {
|
104
|
+
this._session[key] = 1;
|
105
|
+
}
|
106
|
+
|
100
107
|
return true;
|
101
108
|
}
|
102
109
|
}
|
@@ -146,7 +153,11 @@ ReferenceCounter.prototype.removeReference = function(key, referer, count) {
|
|
146
153
|
val -= count;
|
147
154
|
if(!val || val < 0) {
|
148
155
|
delete this._counter[key];
|
149
|
-
this._session[key]
|
156
|
+
if(this._session[key] === 1) {
|
157
|
+
this._session[key] = 0;
|
158
|
+
} else {
|
159
|
+
this._session[key] = -1;
|
160
|
+
}
|
150
161
|
return true;
|
151
162
|
}
|
152
163
|
|
@@ -45,6 +45,8 @@ declare class RowDefinition {
|
|
45
45
|
|
46
46
|
public setStaticRowData(data: { [key: string]: any }|any[], opt_fields?: (string)[]|null): void;
|
47
47
|
|
48
|
+
public _getStaticRowData(): { [key: string]: any };
|
49
|
+
|
48
50
|
public updateRowData(data: { [key: string]: any }|any[], opt_fields?: (string)[]|null): void;
|
49
51
|
|
50
52
|
public setStaticData(field: string, value: any): void;
|
@@ -50,6 +50,10 @@ var RowDefinition = function(rowOptions) {
|
|
50
50
|
* @private
|
51
51
|
*/
|
52
52
|
RowDefinition._runningId = 0;
|
53
|
+
/** @type {string}
|
54
|
+
* @private
|
55
|
+
*/
|
56
|
+
RowDefinition._childDataField = "CHILD_VALUES";
|
53
57
|
//#region Private Members
|
54
58
|
/** @type {string}
|
55
59
|
* @private
|
@@ -240,7 +244,11 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) {
|
|
240
244
|
}
|
241
245
|
}
|
242
246
|
}
|
243
|
-
|
247
|
+
var val = rowOptions["values"];
|
248
|
+
// eslint-disable-next-line no-undefined
|
249
|
+
if(val !== undefined) {
|
250
|
+
this.setStaticRowData(val, rowOptions["fields"]);
|
251
|
+
}
|
244
252
|
};
|
245
253
|
/** @public
|
246
254
|
* @param {string} userInput
|
@@ -312,11 +320,6 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
312
320
|
obj["ric"] = val;
|
313
321
|
}
|
314
322
|
|
315
|
-
val = this._staticValues;
|
316
|
-
if(val) {
|
317
|
-
obj["values"] = cloneObject(val);
|
318
|
-
}
|
319
|
-
|
320
323
|
val = this._chainRic;
|
321
324
|
if(val) {
|
322
325
|
obj["chainRic"] = val;
|
@@ -348,6 +351,40 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
348
351
|
obj["hidden"] = val;
|
349
352
|
}
|
350
353
|
|
354
|
+
val = this._getStaticRowData();
|
355
|
+
if(val) {
|
356
|
+
obj["values"] = val;
|
357
|
+
}
|
358
|
+
|
359
|
+
// obtain the static values of constituent rows
|
360
|
+
if(this.isChain()) {
|
361
|
+
var children = this.getChildren();
|
362
|
+
if(children) {
|
363
|
+
var childValues = val ? val[RowDefinition._childDataField] : {};
|
364
|
+
if(!childValues) {
|
365
|
+
childValues = {};
|
366
|
+
}
|
367
|
+
var dirty = false;
|
368
|
+
var len = children.length;
|
369
|
+
var i, rowDef, staticValues;
|
370
|
+
for(i = 0; i < len; i++) {
|
371
|
+
rowDef = children[i];
|
372
|
+
staticValues = rowDef._getStaticRowData();
|
373
|
+
if(staticValues) {
|
374
|
+
dirty = true;
|
375
|
+
childValues[rowDef.getRic()] = staticValues;
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
if(dirty) {
|
380
|
+
if(!obj["values"]) {
|
381
|
+
obj["values"] = {};
|
382
|
+
}
|
383
|
+
obj["values"][RowDefinition._childDataField] = childValues;
|
384
|
+
}
|
385
|
+
}
|
386
|
+
}
|
387
|
+
|
351
388
|
return obj;
|
352
389
|
};
|
353
390
|
/** Since an index chain (e.g. .FTSE) can automatically produce rows for its constituent, we need to separate rowId and dataId, so that the constituents still use the same data Id as that of its parent.
|
@@ -422,6 +459,12 @@ RowDefinition.prototype.setStaticRowData = function(data, opt_fields) {
|
|
422
459
|
}
|
423
460
|
};
|
424
461
|
/** @public
|
462
|
+
* @return {Object.<string, *>}
|
463
|
+
*/
|
464
|
+
RowDefinition.prototype._getStaticRowData = function() {
|
465
|
+
return this._staticValues ? cloneObject(this._staticValues) : null;
|
466
|
+
};
|
467
|
+
/** @public
|
425
468
|
* @param {Object.<string, *>|Array} data
|
426
469
|
* @param {Array.<string>=} opt_fields In case of the given data is an array, this param will be used for mapping index to field
|
427
470
|
*/
|
@@ -722,6 +765,22 @@ RowDefinition.deregisterFromView = function(rowIds, rowDef) {
|
|
722
765
|
rowDef._deregisterFromView(rowIds);
|
723
766
|
return rowIds;
|
724
767
|
};
|
768
|
+
/** @private
|
769
|
+
* @param {string} ric
|
770
|
+
* @return {Object}
|
771
|
+
*/
|
772
|
+
RowDefinition.prototype._getChildStaticRowData = function(ric) {
|
773
|
+
if(!this._staticValues) {
|
774
|
+
return null;
|
775
|
+
}
|
776
|
+
|
777
|
+
var childValues = this._staticValues[RowDefinition._childDataField];
|
778
|
+
if(!childValues) {
|
779
|
+
return null;
|
780
|
+
}
|
781
|
+
|
782
|
+
return childValues[ric] || null;
|
783
|
+
};
|
725
784
|
/** @public
|
726
785
|
* @ignore
|
727
786
|
* @param {string} ric
|
@@ -749,12 +808,19 @@ RowDefinition.prototype.addConstituent = function(ric) {
|
|
749
808
|
|
750
809
|
var newChild = !childDef;
|
751
810
|
if(newChild) {
|
752
|
-
|
811
|
+
var rowOptions = {
|
753
812
|
"asConstituent": true,
|
754
813
|
"dataId": this._subId + ric,
|
755
814
|
"ric": ric,
|
756
815
|
"parent": this
|
757
|
-
}
|
816
|
+
};
|
817
|
+
|
818
|
+
var staticData = this._getChildStaticRowData(ric);
|
819
|
+
if(staticData) {
|
820
|
+
rowOptions["values"] = staticData;
|
821
|
+
}
|
822
|
+
|
823
|
+
childDef = new RowDefinition(rowOptions);
|
758
824
|
}
|
759
825
|
|
760
826
|
if(this._view) {
|
@@ -38,19 +38,19 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
38
38
|
|
39
39
|
public addColumnToGroup(column: any, groupId: string, colIndex: number): void;
|
40
40
|
|
41
|
-
public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null):
|
41
|
+
public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null): string;
|
42
42
|
|
43
43
|
public addColumnGrouping(groupDef: ColumnGroupingPlugin.GroupDefinition|null): void;
|
44
44
|
|
45
|
-
public removeGroup(groupId: string):
|
45
|
+
public removeGroup(groupId: string): ColumnGroupingPlugin.GroupDefinition|null;
|
46
46
|
|
47
|
-
public
|
47
|
+
public getGroupDefinition(groupId: string): ColumnGroupingPlugin.GroupDefinition|null;
|
48
48
|
|
49
49
|
public getGroupDefinitions(): ColumnGroupingPlugin.GroupDefinitions;
|
50
50
|
|
51
|
-
public setGroupDefinition(groupId: string,
|
51
|
+
public setGroupDefinition(groupId: string, groupDef?: ColumnGroupingPlugin.GroupDefinition|null): string;
|
52
52
|
|
53
|
-
public
|
53
|
+
public setGroupDefinitions(groupDefs: ColumnGroupingPlugin.GroupDefinitions|null): void;
|
54
54
|
|
55
55
|
public setGroupChildren(groupId: string, newChildList: (string)[]|null): void;
|
56
56
|
|
@@ -70,6 +70,10 @@ declare class ColumnGroupingPlugin extends GridPlugin {
|
|
70
70
|
|
71
71
|
public setColumnParent(colRef: number|string|null, groupId: string): void;
|
72
72
|
|
73
|
+
public getValidDestinationIndex(id: string, destCol: number|string|null): number;
|
74
|
+
|
75
|
+
public moveGroup(id: string, destCol: number|string|null): void;
|
76
|
+
|
73
77
|
}
|
74
78
|
|
75
79
|
export default ColumnGroupingPlugin;
|