@refinitiv-ui/efx-grid 6.0.109 → 6.0.111

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.
@@ -25710,7 +25710,7 @@ Core_Core.prototype._hasPendingRowChange = false;
25710
25710
  * @return {string}
25711
25711
  */
25712
25712
  Core_Core.getVersion = function () {
25713
- return "5.1.111";
25713
+ return "5.1.113";
25714
25714
  };
25715
25715
  /** {@link ElementWrapper#dispose}
25716
25716
  * @override
@@ -25853,6 +25853,9 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
25853
25853
  if (columnDef["rightPinned"]) {
25854
25854
  column["rightPinned"] = columnDef["rightPinned"];
25855
25855
  }
25856
+ if (columnDef["backgroundColor"]) {
25857
+ column["backgroundColor"] = columnDef["backgroundColor"];
25858
+ }
25856
25859
  }
25857
25860
 
25858
25861
  // It will be overwrite in rt-grid or atlas-blotter
@@ -27141,6 +27144,10 @@ Core_Core.prototype._deserializeColumn = function (index, jsonObj) {
27141
27144
  if (value != null) {
27142
27145
  colDef["rightPinned"] = value ? true : false;
27143
27146
  }
27147
+ value = jsonObj["backgroundColor"];
27148
+ if (value != null) {
27149
+ this.setColumnBackgroundColor(index, value);
27150
+ }
27144
27151
 
27145
27152
  this.setColumnRenderingHandler(index, jsonObj["renderingHandler"]);
27146
27153
  this.setColumnDataBindingHandler(index, jsonObj["dataBindingHandler"]);
@@ -27400,6 +27407,56 @@ Core_Core.prototype.setColumnStyle = function (colIndex, style, value, opt_type)
27400
27407
  }
27401
27408
  };
27402
27409
 
27410
+ /** @public
27411
+ * @param {number} colIndex
27412
+ * @return {string}
27413
+ */
27414
+ Core_Core.prototype.getColumnBackgroundColor = function(colIndex) {
27415
+ let colDef = this._getColumnDef(colIndex);
27416
+ return colDef["backgroundColor"] || "";
27417
+ };
27418
+ /** @public
27419
+ * @param {number} colIndex
27420
+ * @param {string=} color
27421
+ */
27422
+ Core_Core.prototype.setColumnBackgroundColor = function(colIndex, color) {
27423
+ if(colIndex == null || typeof colIndex !== "number") {
27424
+ return;
27425
+ }
27426
+
27427
+ let colDef = this._getColumnDef(colIndex);
27428
+ if(colDef["backgroundColor"] === color) {
27429
+ return;
27430
+ }
27431
+
27432
+ colDef["backgroundColor"] = color;
27433
+ color = color != null ? color : "";
27434
+
27435
+ let sectionCount = this._settings.length;
27436
+ for(let i = 0; i < sectionCount; ++i) {
27437
+ let settings = this._settings[i];
27438
+ let section = settings.getSection();
27439
+ if(!section) {
27440
+ continue;
27441
+ }
27442
+
27443
+ if(settings.getType() !== "content") {
27444
+ let rowCount = section.getRowCount();
27445
+ for(let r = 0; r < rowCount; r++) {
27446
+ let cellSpan = section.getCellColSpan(colIndex, r);
27447
+ if(cellSpan > 1) { continue; }
27448
+ let cell = section.getCell(colIndex, r);
27449
+ if(cell) {
27450
+ cell.setStyle("backgroundColor", color);
27451
+ }
27452
+ }
27453
+ } else {
27454
+ let column = section.getColumn(colIndex);
27455
+ column.setStyle("backgroundColor", color);
27456
+ }
27457
+ }
27458
+ };
27459
+
27403
27460
  /** @public
27404
27461
  * @param {number} colIndex
27405
27462
  * @param {string} clsName
@@ -30059,6 +30116,9 @@ Core_Core.prototype._dispatchRowExpansionBinding = function (e) {
30059
30116
  }
30060
30117
 
30061
30118
  let ctxRow = section.getContextRow(r);
30119
+ if(!ctxRow) {
30120
+ continue; // The row may have been pushed out of view due to row count or height changed during the binding
30121
+ }
30062
30122
  let parentId = dataView.getExpansionParentByRowId(rowId);
30063
30123
  if(parentId) { // dispatch to render row expansion
30064
30124
  e["originalRowData"] = dataView.getRowData(parentId);