Ag-Grid 在网格渲染后添加单元格样式
Ag-Grid add cell styles after grid rendered
我正在尝试在 ag-grid 中实现自定义颜色格式化程序,用户可以在其中 select 来自颜色选择器的颜色并更改单元格背景颜色或字体颜色..
我能够获得 Def 列,但无法在 Ag-grid 中实施更改。
我一直在努力:
this.data.columnApi.getColumn(index).getColDef().cellStyle['color'] = 'red';
this.data.gridApi.refreshCells();
and also
this.data.gridApi.redrawRows();
如果需要更多信息,请告诉我。
我查看了您的代码并替换了
this.gridApi.refreshCells({
columns: ["make"]
});
和
this.gridApi.redrawRows();
为我提供了正确的输出
我正在尝试在 ag-grid 中实现自定义颜色格式化程序,用户可以在其中 select 来自颜色选择器的颜色并更改单元格背景颜色或字体颜色..
我能够获得 Def 列,但无法在 Ag-grid 中实施更改。
我一直在努力:
this.data.columnApi.getColumn(index).getColDef().cellStyle['color'] = 'red';
this.data.gridApi.refreshCells();
and also
this.data.gridApi.redrawRows();
如果需要更多信息,请告诉我。
我查看了您的代码并替换了
this.gridApi.refreshCells({
columns: ["make"]
});
和
this.gridApi.redrawRows();
为我提供了正确的输出