更新Ag-Grid中的列值

时间:2018-02-01 06:57:47

标签: angular ag-grid

我正在Component A加载网格。在Component B我正在修改某个值时,该修改后的值应反映在Component A中。

使用Subject我可以成功地将修改后的值转换为Component A,但不会显示更新后的值。

请帮助我,我坚持这个问题。

以下是我的代码

setTimeout(() => {
  this.sessionWatch.transitDaysAvg.subscribe((newValue) => {
    if (newValue) {
      // newValue is 6 Old value is 1
      var rowNode = this.gridOptions.api.getRowNode("0");
      rowNode.setDataValue("transitLink.businessDays", newValue);
      this.gridOptions.api.refreshCells({
        force: true
      });

    }
  });
}, 1000);
<div role="row" row-index="0" comp-id="602">
  <div tabindex="-1" role="gridcell" comp-id="753" col-id="transitLink.businessDays">1</div>
</div>

0 个答案:

没有答案
相关问题