2016-06-14 76 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") ... ... ... 
相關問題