我将自定义列添加到ag-grid,就像这样
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 :(得分:1)
答案
this.columnDefs.push( {headerName: "Action Status",field:"actionStatus", cellStyle:{"text-align":"center"} })
- 设置像这样的新值
this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) {
rowNode.setDataValue("actionStatus","the new value") ... ... ...