Ag grid 如何更改ag网格中自定义动态列的单元格值
我向ag网格添加了自定义列,如下所示Ag grid 如何更改ag网格中自定义动态列的单元格值,ag-grid,Ag Grid,我向ag网格添加了自定义列,如下所示 this.columnDefs.push( {headerName: "Action Status", cellStyle:{"text-align":"center"}}); this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) { rowNode.setDataValue("actionStatus","the new va
this.columnDefs.push( {headerName: "Action Status", cellStyle:{"text-align":"center"}});
this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) {
rowNode.setDataValue("actionStatus","the new value") ... ... ...
如何在运行时更改此列的单元格值
我尝试了这个解决方案,但没有成功
this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) {
rowNode.columnController.originalColumns[1].colDef.headerCellTemplate="test"
});
this.gridOptions.api.softRefreshView();
this.gridOptions.api.refreshView();
答案
- 首先像这样输入字段名
this.columnDefs.push( {headerName: "Action Status", cellStyle:{"text-align":"center"}});
this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) {
rowNode.setDataValue("actionStatus","the new value") ... ... ...
答案
- 首先像这样输入字段名
this.columnDefs.push( {headerName: "Action Status", cellStyle:{"text-align":"center"}});
this.gridOptions.api.forEachNodeAfterFilterAndSort(function (rowNode:RowNode) {
rowNode.setDataValue("actionStatus","the new value") ... ... ...