具有设置行数据的多项选择?

时间:2019-05-17 21:35:50

标签: angular ag-grid

我在ag网格中有这个

{
  field: 'readInd ',
  headerName: '<i class="fa fa-envelope" aria-hidden="true"></i>',
  cellRenderer: params => {
    return `<i class=${params.data.readInd == '0' ? "'fa fa-envelope'" : "'fa fa-envelope-open'"}> </i>`;
  }
},

当我单击行时,我致电服务,该服务会将我的读取ind从0更新为1。 而他们我正在这样做:

  this.rateSheetEmailGridOptions.api.setRowData(this.rateSheetEmailData);
       this.rateSheetEmailGridOptions.api.forEachNode((node) => {
         if (node.childIndex === cell.childIndex) {
           node.setSelected(true);
           return;
         }
       }); 

问题是当我想要多个选择行时,这不起作用。

我尝试过:

var rowNode = this.rateSheetEmailGridOptions.api.getRowNode(emailId);
    rowNode.setData(a.payload);

但是在更新时,我的图标readInd没有改变。

任何建议我该如何解决?

0 个答案:

没有答案