@refinitiv-ui/efx-grid 6.0.122 → 6.0.123

Sign up to get free protection for your applications and to get access to all the features.
package/lib/grid/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {Grid} from "./lib/efx-grid.js";
2
2
  export {Grid}
3
- window.EFX_GRID = { version: "6.0.122" };
3
+ window.EFX_GRID = { version: "6.0.123" };
@@ -14082,9 +14082,10 @@ RowDefinition.prototype.addConstituent = function(ric) {
14082
14082
  };
14083
14083
 
14084
14084
  /** Used to convert autogenerated row to regular real-time row
14085
- * @private
14085
+ * @public
14086
+ * @ignore
14086
14087
  */
14087
- RowDefinition.prototype._toRealTimeRow = function() {
14088
+ RowDefinition.prototype.toRealTimeRow = function() {
14088
14089
  if(!this._ric) { // Empty row
14089
14090
  return;
14090
14091
  }
@@ -14113,14 +14114,6 @@ RowDefinition.prototype.unlinkChain = function() {
14113
14114
  return;
14114
14115
  }
14115
14116
 
14116
- if(this.isChainExpanded()) {
14117
- let rowDefs = this.getDescendants();
14118
- let len = rowDefs.length;
14119
- for(let i = 0; i < len; i++) {
14120
- rowDefs[i]._toRealTimeRow();
14121
- }
14122
- }
14123
-
14124
14117
  let staticData = this._cloneStaticRowData();
14125
14118
  this.unsubscribeForUpdates();
14126
14119
 
@@ -47589,21 +47582,31 @@ Grid.prototype._removeRow = function(rowDef) {
47589
47582
  }
47590
47583
  this._dispatch("beforeRowRemoved", {});
47591
47584
 
47592
- let connector = this._connector;
47593
- let dt = this._dt;
47594
47585
  let childRowDefs = rowDef.getDescendants(); // TODO: Support nested child
47595
- if(childRowDefs) { // Remove all children first
47596
- for(let i = 0; i < childRowDefs.length; i++) {
47597
- connector.removeRic(childRowDefs[i]);
47598
- }
47599
- let rowIds = childRowDefs.map(RowDefinition.toRowId);
47600
- dt.removeRows(rowIds);
47586
+ if(childRowDefs) {
47587
+ this._removeConstituentRows(childRowDefs);
47601
47588
  }
47602
- connector.removeRic(rowDef);
47603
- dt.removeRow(rowDef.getRowId()); // TODO: Merge this with the above removeRows() method
47589
+ this._connector.removeRic(rowDef);
47590
+ this._dt.removeRow(rowDef.getRowId()); // TODO: Merge this with the above removeRows() method
47604
47591
  rowDef.dispose(); // WARNING: This does not remove child reference from its parent
47605
47592
  };
47606
47593
 
47594
+ /** @private
47595
+ * @param {Array.<RowDefinition>} rowDefs
47596
+ */
47597
+ Grid.prototype._removeConstituentRows = function(rowDefs) {
47598
+ let connector = this._connector;
47599
+ let rowIds = [];
47600
+ for(let i = 0; i < rowDefs.length; i++) {
47601
+ let childRowDef = rowDefs[i];
47602
+ rowIds.push(childRowDef.getRowId());
47603
+ connector.removeRic(childRowDef);
47604
+ childRowDef.dispose();
47605
+ }
47606
+
47607
+ this._dt.removeRows(rowIds);
47608
+ };
47609
+
47607
47610
  /** @public
47608
47611
  * @param {Grid~RowReference} rowRef
47609
47612
  * @param {boolean=} hidden if false, show instead of hide
@@ -47708,7 +47711,20 @@ Grid.prototype.unlinkChain = function(rowRef) {
47708
47711
  }
47709
47712
 
47710
47713
  this._unlinking = true;
47714
+
47715
+ let childRowDefs = rowDef.getDescendants(); // TODO: Support nested child
47716
+ if(childRowDefs) {
47717
+ if(rowDef.isChainExpanded()) {
47718
+ for(let i = 0; i < childRowDefs.length; i++) {
47719
+ childRowDefs[i].toRealTimeRow();
47720
+ }
47721
+ } else {
47722
+ this._removeConstituentRows(childRowDefs);
47723
+ }
47724
+ }
47725
+
47711
47726
  rowDef.unlinkChain();
47727
+
47712
47728
  this._unlinking = false;
47713
47729
  };
47714
47730
 
@@ -48477,7 +48493,7 @@ Grid.prototype._onDataChanged = function(e) {
48477
48493
  let subId = rowData[SUB_ID]; // The constituent will share the same sub id as its parent
48478
48494
  if(subId) {
48479
48495
  let parentDef = this._getRowDefinitionById(subId);
48480
- if(parentDef && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
48496
+ if(parentDef && parentDef.isChain() && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
48481
48497
  if(!this._chainMembers) {
48482
48498
  this._chainMembers = {};
48483
48499
  }