@refinitiv-ui/efx-grid 6.0.159 → 6.0.161
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +43 -17
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +2 -0
- package/lib/rt-grid/es6/Grid.js +43 -17
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +2 -0
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +46 -19
- package/lib/types/es6/InCellEditing.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
- package/lib/versions.json +1 -1
- package/package.json +1 -1
package/lib/grid/index.js
CHANGED
@@ -48464,22 +48464,46 @@ Grid_Grid.prototype._getRowId = function(rowRef) {
|
|
48464
48464
|
return "";
|
48465
48465
|
};
|
48466
48466
|
|
48467
|
+
/** Clear all existing data from the specified column(s).
|
48468
|
+
* @public
|
48469
|
+
* @param {Grid~ColumnReference|Array.<Grid~ColumnReference>} colRefs
|
48470
|
+
*/
|
48471
|
+
Grid_Grid.prototype.clearColumnData = function(colRefs) {
|
48472
|
+
let colIndices = this.getColumnIndices(colRefs);
|
48473
|
+
let colCount = colIndices.length;
|
48474
|
+
if(!colCount) {
|
48475
|
+
return;
|
48476
|
+
}
|
48477
|
+
let emptyData = {};
|
48478
|
+
for(let c = 0; c < colCount; ++c) {
|
48479
|
+
let colIndex = colIndices[c];
|
48480
|
+
let field = this.getColumnField(colIndex);
|
48481
|
+
if(field) {
|
48482
|
+
emptyData[field] = null;
|
48483
|
+
}
|
48484
|
+
}
|
48485
|
+
|
48486
|
+
let rowDefs = this.getAllRowDefinitions();
|
48487
|
+
let rowCount = rowDefs.length;
|
48488
|
+
for(let r = 0; r < rowCount; ++r) {
|
48489
|
+
rowDefs[r].setRowData(emptyData); // There is a conflator caching the data change in DataCache
|
48490
|
+
}
|
48491
|
+
};
|
48492
|
+
|
48467
48493
|
/** @public
|
48468
48494
|
* @param {Grid~ColumnReference} colRef
|
48469
48495
|
* @return {number}
|
48470
48496
|
*/
|
48471
48497
|
Grid_Grid.prototype.getColumnIndex = function(colRef) {
|
48472
|
-
if(colRef) {
|
48473
|
-
|
48474
|
-
|
48475
|
-
|
48476
|
-
|
48477
|
-
|
48478
|
-
return i;
|
48479
|
-
}
|
48498
|
+
if(colRef instanceof ColumnDefinition) {
|
48499
|
+
let colCount = this.getColumnCount();
|
48500
|
+
for(let i = 0; i < colCount; ++i) {
|
48501
|
+
let colDef = this.getColumnDefinition(i);
|
48502
|
+
if(colDef === colRef) {
|
48503
|
+
return i;
|
48480
48504
|
}
|
48481
|
-
return -1;
|
48482
48505
|
}
|
48506
|
+
return -1;
|
48483
48507
|
}
|
48484
48508
|
return this._grid.getColumnIndex(colRef);
|
48485
48509
|
};
|
@@ -48490,14 +48514,16 @@ Grid_Grid.prototype.getColumnIndex = function(colRef) {
|
|
48490
48514
|
*/
|
48491
48515
|
Grid_Grid.prototype.getColumnIndices = function(colRefs) {
|
48492
48516
|
let ary = [];
|
48493
|
-
|
48494
|
-
|
48495
|
-
|
48496
|
-
|
48497
|
-
|
48498
|
-
let
|
48499
|
-
|
48500
|
-
|
48517
|
+
if(colRefs || colRefs === 0) {
|
48518
|
+
let colCount = this.getColumnCount();
|
48519
|
+
let inputAry = Array.isArray(colRefs) ? colRefs : [colRefs];
|
48520
|
+
let len = inputAry.length;
|
48521
|
+
// Verify user input
|
48522
|
+
for(let i = 0; i < len; ++i) {
|
48523
|
+
let colIndex = this.getColumnIndex(inputAry[i]);
|
48524
|
+
if(colIndex >= 0 && colIndex < colCount) {
|
48525
|
+
ary.push(colIndex); // WARNING: We have not checked for duplication
|
48526
|
+
}
|
48501
48527
|
}
|
48502
48528
|
}
|
48503
48529
|
return ary;
|