2016-06-14 78 views
0

我添加自定义列到AG-网格这样如何在AG-网格改变自定义动态列的单元格的值

this.columnDefs.push({headerName: "Action Status", cellStyle:{"text-align":"center"}}); 

如何改变在运行时该列的单元格的值?

我想这解决方案,但没有工作

this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) { 
    rowNode.columnController.originalColumns[1].colDef.headerCellTemplate="test" 

}); 

     this.gridOptions.api.softRefreshView(); 
     this.gridOptions.api.refreshView(); 

回答

0

答案

  • 首先把字段名这样
this.columnDefs.push(
      {headerName: "Action Status",field:"actionStatus", cellStyle:{"text-align":"center"} }) 

-set新的价值像这样

this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) { 

      rowNode.setDataValue("actionStatus","the new value") ... ... ... 
相关问题